DPDK patches and discussions
 help / color / mirror / Atom feed
From: beilei.xing@intel.com
To: jingjing.wu@intel.com
Cc: dev@dpdk.org, Beilei Xing <beilei.xing@intel.com>
Subject: [PATCH] net/cpfl: fix RSS lookup table configuration
Date: Mon,  3 Jul 2023 11:28:04 +0000	[thread overview]
Message-ID: <20230703112804.222539-1-beilei.xing@intel.com> (raw)

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


             reply	other threads:[~2023-07-03  3:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 11:28 beilei.xing [this message]
2023-07-03  7:32 ` Wu, Jingjing
2023-07-04  1:23   ` Zhang, Qi Z

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=20230703112804.222539-1-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    /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).