patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Lance Richardson <lance.richardson@broadcom.com>,
	Rahul Gupta <rahul.gupta@broadcom.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/bnxt: fix RSS RETA indirection table ops' has been queued to LTS release 18.11.3
Date: Fri, 21 Jun 2019 17:46:26 +0100	[thread overview]
Message-ID: <20190621164626.31219-42-ktraynor@redhat.com> (raw)
In-Reply-To: <20190621164626.31219-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to LTS release 18.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/26/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/c2e6cd15bfec5fa5c6831e156b83f31158c10d7b

Thanks.

Kevin Traynor

---
From c2e6cd15bfec5fa5c6831e156b83f31158c10d7b Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Date: Wed, 29 May 2019 17:02:24 -0400
Subject: [PATCH] net/bnxt: fix RSS RETA indirection table ops

[ upstream commit 378ab645bb0b9c45960c0c66893ab0017ab60e47 ]

We are trying to update the indirection table for all the VNICs.
We should update the table only for the default vnic0.

Fix the reta update function to only update table entries that are
selected by the update mask. Translate queue number to firmware
group ID when updating an entry.

Fix reta query op to only return table entries as identfied by the
provided mask. Translate firmware group IDs to queue numbers.

Removed extraneous code from bnxt_reta_query_op().

Fixes: d819382543f3 ("net/bnxt: add RSS redirection table operations")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 92 +++++++++++++++++++++++++---------
 drivers/net/bnxt/bnxt_hwrm.c   |  1 +
 2 files changed, 70 insertions(+), 23 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e26b9e3ce..00d758650 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -619,10 +619,4 @@ static void bnxt_print_link_info(struct rte_eth_dev *eth_dev)
 }
 
-static int bnxt_dev_lsc_intr_setup(struct rte_eth_dev *eth_dev)
-{
-	bnxt_print_link_info(eth_dev);
-	return 0;
-}
-
 static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 {
@@ -893,4 +887,26 @@ static void bnxt_allmulticast_disable_op(struct rte_eth_dev *eth_dev)
 }
 
+/* Return bnxt_rx_queue pointer corresponding to a given rxq. */
+static struct bnxt_rx_queue *bnxt_qid_to_rxq(struct bnxt *bp, uint16_t qid)
+{
+	if (qid >= bp->rx_nr_rings)
+		return NULL;
+
+	return bp->eth_dev->data->rx_queues[qid];
+}
+
+/* Return rxq corresponding to a given rss table ring/group ID. */
+static uint16_t bnxt_rss_to_qid(struct bnxt *bp, uint16_t fwr)
+{
+	unsigned int i;
+
+	for (i = 0; i < bp->rx_nr_rings; i++) {
+		if (bp->grp_info[i].fw_grp_id == fwr)
+			return i;
+	}
+
+	return INVALID_HW_RING_ID;
+}
+
 static int bnxt_reta_update_op(struct rte_eth_dev *eth_dev,
 			    struct rte_eth_rss_reta_entry64 *reta_conf,
@@ -899,22 +915,42 @@ static int bnxt_reta_update_op(struct rte_eth_dev *eth_dev,
 	struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
 	struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
-	struct bnxt_vnic_info *vnic;
+	struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
+	uint16_t tbl_size = HW_HASH_INDEX_SIZE;
+	uint16_t idx, sft;
 	int i;
 
+	if (!vnic->rss_table)
+		return -EINVAL;
+
 	if (!(dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG))
 		return -EINVAL;
 
-	if (reta_size != HW_HASH_INDEX_SIZE) {
+	if (reta_size != tbl_size) {
 		PMD_DRV_LOG(ERR, "The configured hash table lookup size "
 			"(%d) must equal the size supported by the hardware "
-			"(%d)\n", reta_size, HW_HASH_INDEX_SIZE);
+			"(%d)\n", reta_size, tbl_size);
 		return -EINVAL;
 	}
-	/* Update the RSS VNIC(s) */
-	for (i = 0; i < bp->max_vnics; i++) {
-		vnic = &bp->vnic_info[i];
-		memcpy(vnic->rss_table, reta_conf, reta_size);
-		bnxt_hwrm_vnic_rss_cfg(bp, vnic);
+
+	for (i = 0; i < reta_size; i++) {
+		struct bnxt_rx_queue *rxq;
+
+		idx = i / RTE_RETA_GROUP_SIZE;
+		sft = i % RTE_RETA_GROUP_SIZE;
+
+		if (!(reta_conf[idx].mask & (1ULL << sft)))
+			continue;
+
+		rxq = bnxt_qid_to_rxq(bp, reta_conf[idx].reta[sft]);
+		if (!rxq) {
+			PMD_DRV_LOG(ERR, "Invalid ring in reta_conf.\n");
+			return -EINVAL;
+		}
+
+		vnic->rss_table[i] =
+		    vnic->fw_grp_ids[reta_conf[idx].reta[sft]];
 	}
+
+	bnxt_hwrm_vnic_rss_cfg(bp, vnic);
 	return 0;
 }
@@ -926,6 +962,6 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
 	struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
 	struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
-	struct rte_intr_handle *intr_handle
-		= &bp->pdev->intr_handle;
+	uint16_t tbl_size = HW_HASH_INDEX_SIZE;
+	uint16_t idx, sft, i;
 
 	/* Retrieve from the default VNIC */
@@ -935,16 +971,26 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
 		return -EINVAL;
 
-	if (reta_size != HW_HASH_INDEX_SIZE) {
+	if (reta_size != tbl_size) {
 		PMD_DRV_LOG(ERR, "The configured hash table lookup size "
 			"(%d) must equal the size supported by the hardware "
-			"(%d)\n", reta_size, HW_HASH_INDEX_SIZE);
+			"(%d)\n", reta_size, tbl_size);
 		return -EINVAL;
 	}
-	/* EW - need to revisit here copying from uint64_t to uint16_t */
-	memcpy(reta_conf, vnic->rss_table, reta_size);
 
-	if (rte_intr_allow_others(intr_handle)) {
-		if (eth_dev->data->dev_conf.intr_conf.lsc != 0)
-			bnxt_dev_lsc_intr_setup(eth_dev);
+	for (idx = 0, i = 0; i < reta_size; i++) {
+		idx = i / RTE_RETA_GROUP_SIZE;
+		sft = i % RTE_RETA_GROUP_SIZE;
+
+		if (reta_conf[idx].mask & (1ULL << sft)) {
+			uint16_t qid;
+
+			qid = bnxt_rss_to_qid(bp, vnic->rss_table[i]);
+
+			if (qid == INVALID_HW_RING_ID) {
+				PMD_DRV_LOG(ERR, "Inv. entry in rss table.\n");
+				return -EINVAL;
+			}
+			reta_conf[idx].reta[sft] = qid;
+		}
 	}
 
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 8853391e7..55b5e9720 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1608,4 +1608,5 @@ int bnxt_hwrm_vnic_rss_cfg(struct bnxt *bp,
 	    rte_cpu_to_le_64(vnic->rss_hash_key_dma_addr);
 	req.rss_ctx_idx = rte_cpu_to_le_16(vnic->rss_rule);
+	req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
 
 	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-06-21 17:22:13.918839528 +0100
+++ 0042-net-bnxt-fix-RSS-RETA-indirection-table-ops.patch	2019-06-21 17:22:11.758518329 +0100
@@ -1 +1 @@
-From 378ab645bb0b9c45960c0c66893ab0017ab60e47 Mon Sep 17 00:00:00 2001
+From c2e6cd15bfec5fa5c6831e156b83f31158c10d7b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 378ab645bb0b9c45960c0c66893ab0017ab60e47 ]
+
@@ -19 +20,0 @@
-Cc: stable@dpdk.org
@@ -30 +31 @@
-index 41771d8e2..b5ed0536c 100644
+index e26b9e3ce..00d758650 100644
@@ -42,3 +43,3 @@
- /*
-  * Determine whether the current configuration requires support for scattered
-@@ -978,4 +972,26 @@ static void bnxt_allmulticast_disable_op(struct rte_eth_dev *eth_dev)
+ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+ {
+@@ -893,4 +887,26 @@ static void bnxt_allmulticast_disable_op(struct rte_eth_dev *eth_dev)
@@ -71 +72 @@
-@@ -984,22 +1000,42 @@ static int bnxt_reta_update_op(struct rte_eth_dev *eth_dev,
+@@ -899,22 +915,42 @@ static int bnxt_reta_update_op(struct rte_eth_dev *eth_dev,
@@ -122 +123 @@
-@@ -1011,6 +1047,6 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
+@@ -926,6 +962,6 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
@@ -131 +132 @@
-@@ -1020,16 +1056,26 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
+@@ -935,16 +971,26 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev,
@@ -166 +167 @@
-index c5aca89b2..0c6af1622 100644
+index 8853391e7..55b5e9720 100644

      parent reply	other threads:[~2019-06-21 16:53 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 16:45 [dpdk-stable] patch 'kni: fix build on RHEL8' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'examples: fix make clean when using pkg-config' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/ixgbe: fix unexpected link handler' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/fm10k: advertise supported RSS hash function' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/i40e: fix Tx threshold setup' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/ixgbe: " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/mlx5: fix missing validation of null pointer' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/mlx5: fix description of return value' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/mlx5: fix memory free on queue create error' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/bnxt: fix TSO' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/bnxt: check for error conditions in Tx path' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/bnxt: fix Tx batching' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/bnxt: optimize " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'net/vmxnet3: fix uninitialized variable' " Kevin Traynor
2019-06-21 16:45 ` [dpdk-stable] patch 'fix off-by-one errors in snprintf' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'doc: robustify PDF build' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'doc: fix PDF with greek letter' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/cxgbe: do not dereference global config struct' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'examples/multi_process: do not dereference global config' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'examples/qos_sched: do not dereference global config struct' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'test/hash: use existing lcore API' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'config: disable armv8 crypto extension' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'examples/ip_fragmentation: fix Tx queues init' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'mem: ease init in a docker container' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'doc: fix Linux guide for arm64 cross-compilation' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'examples/multi_process: fix FreeBSD build' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'bpf: fix pseudo calls for program loaded from ELF' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'acl: fix build with some arm64 compiler' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/af_packet: fix RxQ errors stat' " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/avp: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/bnxt: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/cxgbe: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/kni: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/mlx4: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/mlx5: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/null: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/pcap: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/ring: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/szedata2: " Kevin Traynor
2019-06-21 16:46 ` [dpdk-stable] patch 'net/tap: " Kevin Traynor
2019-06-27 16:48   ` Kevin Traynor
2019-06-28 10:00     ` David Marchand
2019-06-28 12:11       ` Thomas Monjalon
2019-06-21 16:46 ` [dpdk-stable] patch 'net/mlx5: fix order of items in NEON scatter' " Kevin Traynor
2019-06-21 16:46 ` Kevin Traynor [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=20190621164626.31219-42-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=lance.richardson@broadcom.com \
    --cc=rahul.gupta@broadcom.com \
    --cc=stable@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).