DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/cpfl: fix RSS lookup table configuration
@ 2023-07-03 11:28 beilei.xing
  2023-07-03  7:32 ` Wu, Jingjing
  0 siblings, 1 reply; 3+ messages in thread
From: beilei.xing @ 2023-07-03 11:28 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev, Beilei Xing

From: Beilei Xing <beilei.xing@intel.com>

Ethdev Rx queues includes normal data queues and hairpin queues,
RSS should direct traffic only to the normal data queues.

Fixes: fda03330fcaa ("net/cpfl: support hairpin queue configuration")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/cpfl/cpfl_ethdev.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index 9755ffe508..c4ca9343c3 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -817,6 +817,24 @@ cpfl_rxq_hairpin_mz_bind(struct rte_eth_dev *dev)
 	}
 }
 
+static int
+cpfl_rss_lut_config(struct cpfl_vport *cpfl_vport, uint16_t nb_q)
+{
+	struct idpf_vport *vport = &cpfl_vport->base;
+	uint16_t lut_size = vport->rss_lut_size;
+	uint16_t i;
+	int ret;
+
+	for (i = 0; i < lut_size; i++)
+		vport->rss_lut[i] = i % nb_q;
+
+	ret = idpf_vc_rss_lut_set(vport);
+	if (ret)
+		PMD_INIT_LOG(ERR, "Failed to configure RSS lut");
+
+	return ret;
+}
+
 static int
 cpfl_start_queues(struct rte_eth_dev *dev)
 {
@@ -951,6 +969,10 @@ cpfl_start_queues(struct rte_eth_dev *dev)
 		}
 	}
 
+	/* re-configure RSS lut if there's hairpin queue */
+	if (cpfl_vport->nb_p2p_rxq > 0)
+		err = cpfl_rss_lut_config(cpfl_vport, cpfl_vport->nb_data_rxq);
+
 	return err;
 }
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-04  1:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 11:28 [PATCH] net/cpfl: fix RSS lookup table configuration beilei.xing
2023-07-03  7:32 ` Wu, Jingjing
2023-07-04  1:23   ` Zhang, Qi Z

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).