netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, kuba@kernel.org
Subject: [PATCH net-next 5/8] bnxt_en: Return correct RSS indirection table entries to ethtool -x.
Date: Mon, 29 Jun 2020 02:34:21 -0400	[thread overview]
Message-ID: <1593412464-503-6-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1593412464-503-1-git-send-email-michael.chan@broadcom.com>

Now that we have the logical indirection table, we can return these
proper logical indices directly to ethtool -x instead of the physical
IDs.

Reported-by: Jakub Kicinski <kicinski@fb.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 6b88143..46f3978 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1275,6 +1275,12 @@ static int bnxt_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
 
 static u32 bnxt_get_rxfh_indir_size(struct net_device *dev)
 {
+	struct bnxt *bp = netdev_priv(dev);
+
+	if (bp->flags & BNXT_FLAG_CHIP_P5) {
+		return (bp->rx_nr_rings + BNXT_RSS_TABLE_ENTRIES_P5 - 1) &
+		       ~(BNXT_RSS_TABLE_ENTRIES_P5 - 1);
+	}
 	return HW_HASH_INDEX_SIZE;
 }
 
@@ -1288,7 +1294,7 @@ static int bnxt_get_rxfh(struct net_device *dev, u32 *indir, u8 *key,
 {
 	struct bnxt *bp = netdev_priv(dev);
 	struct bnxt_vnic_info *vnic;
-	int i = 0;
+	u32 i, tbl_size;
 
 	if (hfunc)
 		*hfunc = ETH_RSS_HASH_TOP;
@@ -1297,9 +1303,10 @@ static int bnxt_get_rxfh(struct net_device *dev, u32 *indir, u8 *key,
 		return 0;
 
 	vnic = &bp->vnic_info[0];
-	if (indir && vnic->rss_table) {
-		for (i = 0; i < HW_HASH_INDEX_SIZE; i++)
-			indir[i] = le16_to_cpu(vnic->rss_table[i]);
+	if (indir && bp->rss_indir_tbl) {
+		tbl_size = bnxt_get_rxfh_indir_size(dev);
+		for (i = 0; i < tbl_size; i++)
+			indir[i] = bp->rss_indir_tbl[i];
 	}
 
 	if (key && vnic->rss_hash_key)
-- 
1.8.3.1


  parent reply	other threads:[~2020-06-29 21:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  6:34 [PATCH net-next 0/8] bnxt_en: Driver update for net-next Michael Chan
2020-06-29  6:34 ` [PATCH net-next 1/8] bnxt_en: Set up the chip specific RSS table size Michael Chan
2020-06-29  6:34 ` [PATCH net-next 2/8] bnxt_en: Add logical RSS indirection table structure Michael Chan
2020-06-29 23:53   ` Jakub Kicinski
2020-06-29  6:34 ` [PATCH net-next 3/8] bnxt_en: Add helper function to return the number of RSS contexts Michael Chan
2020-06-29  6:34 ` [PATCH net-next 4/8] bnxt_en: Fill HW RSS table from the RSS logical indirection table Michael Chan
2020-06-29 23:58   ` Jakub Kicinski
2020-06-30  0:42     ` Michael Chan
2020-06-29  6:34 ` Michael Chan [this message]
2020-06-29  6:34 ` [PATCH net-next 6/8] bnxt_en: Implement ethtool -X to set " Michael Chan
2020-06-30  0:06   ` Jakub Kicinski
2020-06-30  0:38     ` Michael Chan
2020-06-30 19:05       ` Jakub Kicinski
2020-06-30 19:42         ` Michael Chan
2020-06-29  6:34 ` [PATCH net-next 7/8] bnxt_en: clean up VLAN feature bit handling Michael Chan
2020-06-29  6:34 ` [PATCH net-next 8/8] bnxt_en: allow firmware to disable VLAN offloads Michael Chan

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=1593412464-503-6-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.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).