patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajitkhaparde@gmail.com>
To: dev@dpdk.org
Cc: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
	stable@dpdk.org, Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [dpdk-stable] [PATCH v3 13/17] net/bnxt: fix vnic RSS configure function
Date: Wed,  9 Dec 2020 15:53:43 -0800	[thread overview]
Message-ID: <20201209235347.16180-14-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20201209235347.16180-1-ajit.khaparde@broadcom.com>

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

1. moved invalid VNIC id check to the beginning of the function.
2. removed a duplicate check which avoids unnecessary code indentation.

Fixes: 49d0709b257fc ("net/bnxt: delete and flush L2 filters cleanly")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 6f5402070..cee2656c1 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4896,37 +4896,35 @@ int bnxt_vnic_rss_configure(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 {
 	unsigned int rss_idx, fw_idx, i;
 
+	if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
+		return 0;
+
 	if (!(vnic->rss_table && vnic->hash_type))
 		return 0;
 
 	if (BNXT_CHIP_P5(bp))
 		return bnxt_vnic_rss_configure_p5(bp, vnic);
 
-	if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
-		return 0;
-
-	if (vnic->rss_table && vnic->hash_type) {
-		/*
-		 * Fill the RSS hash & redirection table with
-		 * ring group ids for all VNICs
-		 */
-		for (rss_idx = 0, fw_idx = 0; rss_idx < HW_HASH_INDEX_SIZE;
-			rss_idx++, fw_idx++) {
-			for (i = 0; i < bp->rx_cp_nr_rings; i++) {
-				fw_idx %= bp->rx_cp_nr_rings;
-				if (vnic->fw_grp_ids[fw_idx] !=
-				    INVALID_HW_RING_ID)
-					break;
-				fw_idx++;
-			}
-			if (i == bp->rx_cp_nr_rings)
-				return 0;
-			vnic->rss_table[rss_idx] = vnic->fw_grp_ids[fw_idx];
+	/*
+	 * Fill the RSS hash & redirection table with
+	 * ring group ids for all VNICs
+	 */
+	for (rss_idx = 0, fw_idx = 0; rss_idx < HW_HASH_INDEX_SIZE;
+	     rss_idx++, fw_idx++) {
+		for (i = 0; i < bp->rx_cp_nr_rings; i++) {
+			fw_idx %= bp->rx_cp_nr_rings;
+			if (vnic->fw_grp_ids[fw_idx] != INVALID_HW_RING_ID)
+				break;
+			fw_idx++;
 		}
-		return bnxt_hwrm_vnic_rss_cfg(bp, vnic);
+
+		if (i == bp->rx_cp_nr_rings)
+			return 0;
+
+		vnic->rss_table[rss_idx] = vnic->fw_grp_ids[fw_idx];
 	}
 
-	return 0;
+	return bnxt_hwrm_vnic_rss_cfg(bp, vnic);
 }
 
 static void bnxt_hwrm_set_coal_params(struct bnxt_coal *hw_coal,
-- 
2.21.1 (Apple Git-122.3)


  parent reply	other threads:[~2020-12-09 23:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201209192233.6518-1-ajit.khaparde@broadcom.com>
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 01/17] net/bnxt: fix RX rings in RSS redirection table Ajit Khaparde
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 02/17] net/bnxt: fix VNIC config on Rx queue stop Ajit Khaparde
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 04/17] net/bnxt: release hwrm lock in the error case Ajit Khaparde
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 06/17] net/bnxt: fix to return error when fw command fails Ajit Khaparde
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 07/17] net/bnxt: fix cleanup on mutex init failure Ajit Khaparde
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 08/17] net/bnxt: fix format specifier for unsigned int Ajit Khaparde
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 09/17] net/bnxt: fix max rings computation Ajit Khaparde
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 13/17] net/bnxt: fix vnic RSS configure function Ajit Khaparde
2020-12-09 19:22 ` [dpdk-stable] [PATCH v2 14/17] net/bnxt: fix PF resource query Ajit Khaparde
     [not found] ` <20201209235347.16180-1-ajit.khaparde@broadcom.com>
2020-12-09 23:53   ` [dpdk-stable] [PATCH v3 01/17] net/bnxt: fix RX rings in RSS redirection table Ajit Khaparde
2020-12-09 23:53   ` [dpdk-stable] [PATCH v3 02/17] net/bnxt: fix VNIC config on Rx queue stop Ajit Khaparde
2020-12-09 23:53   ` [dpdk-stable] [PATCH v3 04/17] net/bnxt: release hwrm lock in the error case Ajit Khaparde
2020-12-09 23:53   ` [dpdk-stable] [PATCH v3 06/17] net/bnxt: fix to return error when fw command fails Ajit Khaparde
2020-12-09 23:53   ` [dpdk-stable] [PATCH v3 07/17] net/bnxt: fix cleanup on mutex init failure Ajit Khaparde
2020-12-10 15:42     ` [dpdk-stable] [dpdk-dev] " Lance Richardson
2020-12-09 23:53   ` [dpdk-stable] [PATCH v3 08/17] net/bnxt: fix format specifier for unsigned int Ajit Khaparde
2020-12-10 15:54     ` [dpdk-stable] [dpdk-dev] " Lance Richardson
2020-12-09 23:53   ` [dpdk-stable] [PATCH v3 09/17] net/bnxt: fix max rings computation Ajit Khaparde
2020-12-09 23:53   ` Ajit Khaparde [this message]
2020-12-09 23:53   ` [dpdk-stable] [PATCH v3 14/17] net/bnxt: fix PF resource query 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=20201209235347.16180-14-ajit.khaparde@broadcom.com \
    --to=ajitkhaparde@gmail.com \
    --cc=dev@dpdk.org \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=somnath.kotur@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).