DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: dev@dpdk.org
Cc: ajit.khaparde@broadcom.com
Subject: [PATCH 04/17] net/bnxt: fix Rxq configure
Date: Wed, 27 Apr 2022 20:28:08 +0530	[thread overview]
Message-ID: <20220427145821.5987-5-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20220427145821.5987-1-kalesh-anakkur.purayil@broadcom.com>

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

We are currently not handling RX/RSS modes correctly.
After launching testpmd with multiple RXQs, if the user tries to set
the number of RXQs to 1, driver is not updating the "hash_type"
and "hash_mode" values of the VNICs. As a result, driver issues
bnxt_vnic_rss_configure() unnecessarily and the FW command fails.

Fixed bnxt_mq_rx_configure() to update VNIC RSS fields unconditionally.

Fixes: 4191bc8f79a8 ("net/bnxt: handle multi queue mode properly")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxq.c | 37 ++++++++++++++-----------------------
 1 file changed, 14 insertions(+), 23 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index 3c2283b..8977138 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -65,6 +65,7 @@ void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq)
 int bnxt_mq_rx_configure(struct bnxt *bp)
 {
 	struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
+	struct rte_eth_rss_conf *rss = &bp->rss_conf;
 	const struct rte_eth_vmdq_rx_conf *conf =
 		    &dev_conf->rx_adv_conf.vmdq_rx_conf;
 	unsigned int i, j, nb_q_per_grp = 1, ring_idx = 0;
@@ -172,29 +173,19 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
 
 	bp->rx_num_qs_per_vnic = nb_q_per_grp;
 
-	if (dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) {
-		struct rte_eth_rss_conf *rss = &bp->rss_conf;
-
-		for (i = 0; i < bp->nr_vnics; i++) {
-			uint32_t lvl = RTE_ETH_RSS_LEVEL(rss->rss_hf);
-
-			vnic = &bp->vnic_info[i];
-			vnic->hash_type =
-				bnxt_rte_to_hwrm_hash_types(rss->rss_hf);
-			vnic->hash_mode =
-				bnxt_rte_to_hwrm_hash_level(bp,
-							    rss->rss_hf,
-							    lvl);
-
-			/*
-			 * Use the supplied key if the key length is
-			 * acceptable and the rss_key is not NULL
-			 */
-			if (rss->rss_key &&
-			    rss->rss_key_len <= HW_HASH_KEY_SIZE)
-				memcpy(vnic->rss_hash_key,
-				       rss->rss_key, rss->rss_key_len);
-		}
+	for (i = 0; i < bp->nr_vnics; i++) {
+		uint32_t lvl = RTE_ETH_RSS_LEVEL(rss->rss_hf);
+
+		vnic = &bp->vnic_info[i];
+		vnic->hash_type = bnxt_rte_to_hwrm_hash_types(rss->rss_hf);
+		vnic->hash_mode = bnxt_rte_to_hwrm_hash_level(bp, rss->rss_hf, lvl);
+
+		/*
+		 * Use the supplied key if the key length is
+		 * acceptable and the rss_key is not NULL
+		 */
+		if (rss->rss_key && rss->rss_key_len <= HW_HASH_KEY_SIZE)
+			memcpy(vnic->rss_hash_key, rss->rss_key, rss->rss_key_len);
 	}
 
 	return rc;
-- 
2.10.1


  parent reply	other threads:[~2022-04-27 14:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 14:58 [dpdk-dev] [PATCH 00/17] bnxt PMD fixes Kalesh A P
2022-04-27 14:58 ` [PATCH 01/17] net/bnxt: update HWRM structures Kalesh A P
2022-04-27 14:58 ` [PATCH 02/17] net/bnxt: fix device capability reporting Kalesh A P
2022-04-27 14:58 ` [PATCH 03/17] net/bnxt: fix to remove an unused macro Kalesh A P
2022-04-27 14:58 ` Kalesh A P [this message]
2022-04-27 14:58 ` [PATCH 05/17] net/bnxt: fix support for tunnel stateless offloads Kalesh A P
2022-04-27 14:58 ` [PATCH 06/17] net/bnxt: remove support for COUNT action Kalesh A P
2022-04-27 14:58 ` [PATCH 07/17] net/bnxt: fix RSS action support Kalesh A P
2022-04-27 14:58 ` [PATCH 08/17] net/bnxt: fix to reconfigure the VNIC's default receive ring Kalesh A P
2022-04-27 14:58 ` [PATCH 09/17] net/bnxt: add check for dupliate queue ids Kalesh A P
2022-04-27 14:58 ` [PATCH 10/17] net/bnxt: fix to handle queue stop during RSS flow create Kalesh A P
2022-04-27 14:58 ` [PATCH 11/17] net/bnxt: avoid unnecessary endianness conversion Kalesh A P
2022-04-27 14:58 ` [PATCH 12/17] net/bnxt: fix setting autoneg speed Kalesh A P
2022-04-27 14:58 ` [PATCH 13/17] net/bnxt: force PHY update on certain configurations Kalesh A P
2022-04-27 14:58 ` [PATCH 14/17] net/bnxt: fix reporting link status when port is stopped Kalesh A P
2022-04-27 14:58 ` [PATCH 15/17] net/bnxt: recheck FW readiness if FW is in reset process Kalesh A P
2022-04-27 14:58 ` [PATCH 16/17] net/bnxt: fix freeing of VNIC filters Kalesh A P
2022-04-27 14:58 ` [PATCH 17/17] net/bnxt: don't wait for link up completion in dev start Kalesh A P
2022-05-10  5:16 ` [dpdk-dev] [PATCH 00/17] bnxt PMD fixes Ajit Khaparde

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=20220427145821.5987-5-kalesh-anakkur.purayil@broadcom.com \
    --to=kalesh-anakkur.purayil@broadcom.com \
    --cc=ajit.khaparde@broadcom.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).