From: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, anatoly.burakov@intel.com
Subject: [PATCH] net/ice: adjust RSS LUT settings
Date: Thu, 6 Nov 2025 17:17:36 +0000 [thread overview]
Message-ID: <20251106171736.163516-1-vladimir.medvedkin@intel.com> (raw)
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 <vladimir.medvedkin@intel.com>
---
drivers/net/intel/ice/ice_ethdev.c | 42 ++++++++++++++++++++++++++++--
drivers/net/intel/ice/ice_ethdev.h | 2 ++
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index 4669eba7c7..1c8540ef1d 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -104,6 +104,8 @@ enum ice_link_state_on_close {
#define ICE_MAC_TC_MAX_WATERMARK (((hw)->mac_type == ICE_MAC_E830) ? \
ICE_MAC_E830_MAX_WATERMARK : ICE_MAC_E810_MAX_WATERMARK)
+#define ICE_RSS_LUT_GLOBAL_QUEUE_NB 64
+
static int ice_dev_configure(struct rte_eth_dev *dev);
static int ice_dev_start(struct rte_eth_dev *dev);
static int ice_dev_stop(struct rte_eth_dev *dev);
@@ -3769,11 +3771,47 @@ static int ice_init_rss(struct ice_pf *pf)
for (i = 0; i < vsi->rss_lut_size; i++)
vsi->rss_lut[i] = i % nb_q;
+ if (nb_q <= ICE_RSS_LUT_GLOBAL_QUEUE_NB && (hw)->mac_type == ICE_MAC_E830) {
+ struct ice_vsi_ctx vsi_ctx;
+ uint16_t global_lut;
+
+ if (!vsi->global_lut_allocated) {
+ ret = ice_alloc_rss_global_lut(hw, false, &global_lut);
+ if (ret)
+ goto out;
+ vsi->global_lut_allocated = true;
+ vsi->global_lut_id = global_lut;
+ }
+ global_lut = vsi->global_lut_id;
+
+ vsi_ctx.flags = ICE_AQ_VSI_TYPE_PF;
+ vsi_ctx.info = vsi->info;
+ vsi_ctx.info.q_opt_rss &= ICE_AQ_VSI_Q_OPT_RSS_LUT_M |
+ ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M;
+ vsi_ctx.info.q_opt_rss |= ICE_AQ_VSI_Q_OPT_RSS_LUT_GBL |
+ ((global_lut << ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S) &
+ ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M);
+
+ vsi_ctx.info.valid_sections =
+ rte_cpu_to_le_16(ICE_AQ_VSI_PROP_Q_OPT_VALID);
+
+ ret = ice_update_vsi(hw, vsi->idx, &vsi_ctx, NULL);
+ if (ret != ICE_SUCCESS) {
+ PMD_INIT_LOG(ERR, "update vsi failed, err = %d", ret);
+ goto out;
+ }
+
+ vsi->info = vsi_ctx.info;
+ lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL;
+ lut_params.global_lut_id = global_lut;
+ } else {
+ lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;
+ lut_params.global_lut_id = 0;
+ }
+
lut_params.vsi_handle = vsi->idx;
lut_params.lut_size = vsi->rss_lut_size;
- lut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;
lut_params.lut = vsi->rss_lut;
- lut_params.global_lut_id = 0;
ret = ice_aq_set_rss_lut(hw, &lut_params);
if (ret)
goto out;
diff --git a/drivers/net/intel/ice/ice_ethdev.h b/drivers/net/intel/ice/ice_ethdev.h
index 6478d6dfbd..efa90cf39a 100644
--- a/drivers/net/intel/ice/ice_ethdev.h
+++ b/drivers/net/intel/ice/ice_ethdev.h
@@ -333,6 +333,8 @@ struct ice_vsi {
uint8_t vlan_anti_spoof_on; /* The VLAN anti-spoofing enabled */
uint8_t vlan_filter_on; /* The VLAN filter enabled */
/* information about rss configuration */
+ uint8_t global_lut_allocated : 1;
+ uint8_t global_lut_id : 7;
u32 rss_key_size;
u32 rss_lut_size;
uint8_t *rss_lut;
--
2.43.0
next reply other threads:[~2025-11-06 17:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 17:17 Vladimir Medvedkin [this message]
2025-11-06 17:56 ` Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251106171736.163516-1-vladimir.medvedkin@intel.com \
--to=vladimir.medvedkin@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).