Skip to content

Commit 193a11f

Browse files
vmedvedkbruce-richardson
authored andcommitted
net/ice: adjust RSS LUT settings
For E830, using global RSS LUT for PFs with a small number of queues shows better performance than using per-PF RSS LUT. This patch adds a condition to use global RSS LUT instead of PF LUT if number of queues is less than 64. Signed-off-by: Vladimir Medvedkin <[email protected]> Acked-by: Bruce Richardson <[email protected]>
1 parent 744ff57 commit 193a11f

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

drivers/net/intel/ice/ice_ethdev.c

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ enum ice_link_state_on_close {
104104
#define ICE_MAC_TC_MAX_WATERMARK (((hw)->mac_type == ICE_MAC_E830) ? \
105105
ICE_MAC_E830_MAX_WATERMARK : ICE_MAC_E810_MAX_WATERMARK)
106106

107+
#define ICE_RSS_LUT_GLOBAL_QUEUE_NB 64
108+
107109
static int ice_dev_configure(struct rte_eth_dev *dev);
108110
static int ice_dev_start(struct rte_eth_dev *dev);
109111
static int ice_dev_stop(struct rte_eth_dev *dev);
@@ -3776,11 +3778,47 @@ static int ice_init_rss(struct ice_pf *pf)
37763778
for (i = 0; i < vsi->rss_lut_size; i++)
37773779
vsi->rss_lut[i] = i % nb_q;
37783780

3781+
if (nb_q <= ICE_RSS_LUT_GLOBAL_QUEUE_NB && (hw)->mac_type == ICE_MAC_E830) {
3782+
struct ice_vsi_ctx vsi_ctx;
3783+
uint16_t global_lut;
3784+
3785+
if (!vsi->global_lut_allocated) {
3786+
ret = ice_alloc_rss_global_lut(hw, false, &global_lut);
3787+
if (ret)
3788+
goto out;
3789+
vsi->global_lut_allocated = true;
3790+
vsi->global_lut_id = global_lut;
3791+
}
3792+
global_lut = vsi->global_lut_id;
3793+
3794+
vsi_ctx.flags = ICE_AQ_VSI_TYPE_PF;
3795+
vsi_ctx.info = vsi->info;
3796+
vsi_ctx.info.q_opt_rss &= ICE_AQ_VSI_Q_OPT_RSS_LUT_M |
3797+
ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M;
3798+
vsi_ctx.info.q_opt_rss |= ICE_AQ_VSI_Q_OPT_RSS_LUT_GBL |
3799+
((global_lut << ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S) &
3800+
ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M);
3801+
3802+
vsi_ctx.info.valid_sections =
3803+
rte_cpu_to_le_16(ICE_AQ_VSI_PROP_Q_OPT_VALID);
3804+
3805+
ret = ice_update_vsi(hw, vsi->idx, &vsi_ctx, NULL);
3806+
if (ret != ICE_SUCCESS) {
3807+
PMD_INIT_LOG(ERR, "update vsi failed, err = %d", ret);
3808+
goto out;
3809+
}
3810+
3811+
vsi->info = vsi_ctx.info;
3812+
lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL;
3813+
lut_params.global_lut_id = global_lut;
3814+
} else {
3815+
lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;
3816+
lut_params.global_lut_id = 0;
3817+
}
3818+
37793819
lut_params.vsi_handle = vsi->idx;
37803820
lut_params.lut_size = vsi->rss_lut_size;
3781-
lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;
37823821
lut_params.lut = vsi->rss_lut;
3783-
lut_params.global_lut_id = 0;
37843822
ret = ice_aq_set_rss_lut(hw, &lut_params);
37853823
if (ret)
37863824
goto out;

drivers/net/intel/ice/ice_ethdev.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ struct ice_vsi {
333333
uint8_t vlan_anti_spoof_on; /* The VLAN anti-spoofing enabled */
334334
uint8_t vlan_filter_on; /* The VLAN filter enabled */
335335
/* information about rss configuration */
336+
uint8_t global_lut_allocated : 1;
337+
uint8_t global_lut_id : 7;
336338
u32 rss_key_size;
337339
u32 rss_lut_size;
338340
uint8_t *rss_lut;

0 commit comments

Comments
 (0)