mirror of https://gitee.com/openkylin/linux.git
i40e: move i40e_vsi_config_rss below i40e_get_rss_aq
Move this function below the two functions related to configuring RSS via the admin queue. This helps co-locate the two functions, and made it easier to spot a bug in the first i40e_config_rss_aq function as compared to the i40e_get_rss_aq function. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
dc833def42
commit
0582b964ec
|
@ -8027,33 +8027,6 @@ static int i40e_config_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* i40e_vsi_config_rss - Prepare for VSI(VMDq) RSS if used
|
|
||||||
* @vsi: VSI structure
|
|
||||||
**/
|
|
||||||
static int i40e_vsi_config_rss(struct i40e_vsi *vsi)
|
|
||||||
{
|
|
||||||
u8 seed[I40E_HKEY_ARRAY_SIZE];
|
|
||||||
struct i40e_pf *pf = vsi->back;
|
|
||||||
u8 *lut;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!(pf->flags & I40E_FLAG_RSS_AQ_CAPABLE))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
|
|
||||||
if (!lut)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
i40e_fill_rss_lut(pf, lut, vsi->rss_table_size, vsi->rss_size);
|
|
||||||
netdev_rss_key_fill((void *)seed, I40E_HKEY_ARRAY_SIZE);
|
|
||||||
vsi->rss_size = min_t(int, pf->alloc_rss_size, vsi->num_queue_pairs);
|
|
||||||
ret = i40e_config_rss_aq(vsi, seed, lut, vsi->rss_table_size);
|
|
||||||
kfree(lut);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* i40e_get_rss_aq - Get RSS keys and lut by using AQ commands
|
* i40e_get_rss_aq - Get RSS keys and lut by using AQ commands
|
||||||
* @vsi: Pointer to vsi structure
|
* @vsi: Pointer to vsi structure
|
||||||
|
@ -8100,6 +8073,33 @@ static int i40e_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* i40e_vsi_config_rss - Prepare for VSI(VMDq) RSS if used
|
||||||
|
* @vsi: VSI structure
|
||||||
|
**/
|
||||||
|
static int i40e_vsi_config_rss(struct i40e_vsi *vsi)
|
||||||
|
{
|
||||||
|
u8 seed[I40E_HKEY_ARRAY_SIZE];
|
||||||
|
struct i40e_pf *pf = vsi->back;
|
||||||
|
u8 *lut;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!(pf->flags & I40E_FLAG_RSS_AQ_CAPABLE))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
lut = kzalloc(vsi->rss_table_size, GFP_KERNEL);
|
||||||
|
if (!lut)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
i40e_fill_rss_lut(pf, lut, vsi->rss_table_size, vsi->rss_size);
|
||||||
|
netdev_rss_key_fill((void *)seed, I40E_HKEY_ARRAY_SIZE);
|
||||||
|
vsi->rss_size = min_t(int, pf->alloc_rss_size, vsi->num_queue_pairs);
|
||||||
|
ret = i40e_config_rss_aq(vsi, seed, lut, vsi->rss_table_size);
|
||||||
|
kfree(lut);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* i40e_config_rss_reg - Configure RSS keys and lut by writing registers
|
* i40e_config_rss_reg - Configure RSS keys and lut by writing registers
|
||||||
* @vsi: Pointer to vsi structure
|
* @vsi: Pointer to vsi structure
|
||||||
|
|
Loading…
Reference in New Issue