All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com
Cc: dev@dpdk.org, xiao.w.wang@intel.com, junfeng.guo@intel.com
Subject: [RFC 3/3] net/idpf: adjust RSS LUT to exclude hairpin queue
Date: Mon,  5 Sep 2022 19:30:31 +0800	[thread overview]
Message-ID: <20220905113031.3223290-4-junfeng.guo@intel.com> (raw)
In-Reply-To: <20220905113031.3223290-1-junfeng.guo@intel.com>

RSS should direct traffic only to the normal data Rx queues, so when
hairpin queue configured, RSS LUT should be adjusted to exclude
the hairpin queue.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/idpf/idpf_ethdev.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index aaca6f4202..fc9663d32e 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -625,9 +625,28 @@ idpf_config_rx_queues_irqs(struct rte_eth_dev *dev)
 	return -1;
 }
 
+static int
+idpf_config_rss_lut(struct idpf_vport *vport, uint16_t nb_q)
+{
+	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_set_rss_lut(vport);
+	if (ret)
+		PMD_INIT_LOG(ERR, "Failed to configure RSS lut");
+
+	return ret;
+}
+
 static int
 idpf_start_queues(struct rte_eth_dev *dev)
 {
+	struct idpf_vport *vport = (struct idpf_vport *)dev->data->dev_private;
+	uint16_t nb_rxq = dev->data->nb_rx_queues;
 	struct idpf_rx_queue *rxq;
 	struct idpf_tx_queue *txq;
 	int err = 0;
@@ -671,6 +690,11 @@ idpf_start_queues(struct rte_eth_dev *dev)
 		}
 	}
 
+	/* RSS only to the data queues */
+	rxq = dev->data->rx_queues[nb_rxq - 1];
+	if (nb_rxq > 1 && rxq && rxq->hairpin_q)
+		err = idpf_config_rss_lut(vport, nb_rxq - 1);
+
 	return err;
 }
 
-- 
2.25.1


      parent reply	other threads:[~2022-09-05 11:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 11:30 [RFC 0/3] enable hairpin queue Junfeng Guo
2022-09-05 11:30 ` [RFC 1/3] net/idpf: add support for CPF Junfeng Guo
2022-09-26  8:42   ` [RFC v2 0/3] enable hairpin queue Junfeng Guo
2022-09-26  8:42     ` [RFC v2 1/3] net/idpf: add support for CPF Junfeng Guo
2022-09-26  8:42     ` [RFC v2 2/3] net/idpf: add support for hairpin queue Junfeng Guo
2022-09-26  8:42     ` [RFC v2 3/3] net/idpf: adjust RSS LUT to exclude " Junfeng Guo
2024-10-02 16:41   ` [RFC 1/3] net/idpf: add support for CPF Stephen Hemminger
2022-09-05 11:30 ` [RFC 2/3] net/idpf: add support for hairpin queue Junfeng Guo
2022-09-05 11:30 ` Junfeng Guo [this message]

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=20220905113031.3223290-4-junfeng.guo@intel.com \
    --to=junfeng.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=xiao.w.wang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.