From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next v2 1/9] bnxt_en: Fix invalid max channel parameter in ethtool -l.
Date: Sun, 15 May 2016 03:04:43 -0400 [thread overview]
Message-ID: <1463295891-15216-2-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1463295891-15216-1-git-send-email-michael.chan@broadcom.com>
From: Satish Baddipadige <sbaddipa@broadcom.com>
When there is only 1 MSI-X vector or in INTA mode, tx and rx pre-set
max channel parameters are shown incorrectly in ethtool -l. With only 1
vector, bnxt_get_max_rings() will return -ENOMEM. bnxt_get_channels
should check this return value, and set max_rx/max_tx to 0 if it is
non-zero.
Signed-off-by: Satish Baddipadige <sbaddipa@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index d6e41f2..28171f9 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -327,7 +327,11 @@ static void bnxt_get_channels(struct net_device *dev,
bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings, true);
channel->max_combined = max_rx_rings;
- bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings, false);
+ if (bnxt_get_max_rings(bp, &max_rx_rings, &max_tx_rings, false)) {
+ max_rx_rings = 0;
+ max_tx_rings = 0;
+ }
+
tcs = netdev_get_num_tc(dev);
if (tcs > 1)
max_tx_rings /= tcs;
--
1.8.3.1
next prev parent reply other threads:[~2016-05-15 7:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-15 7:04 [PATCH net-next v2 0/9] bnxt_en: updates for net-next Michael Chan
2016-05-15 7:04 ` Michael Chan [this message]
2016-05-15 7:04 ` [PATCH net-next v2 2/9] bnxt_en: Add Support for ETHTOOL_GMODULEINFO and ETHTOOL_GMODULEEEPRO Michael Chan
2016-05-15 7:04 ` [PATCH net-next v2 3/9] bnxt_en: Report PCIe link speed and width during driver load Michael Chan
2016-05-15 7:04 ` [PATCH net-next v2 4/9] bnxt_en: Reduce maximum ring pages if page size is 64K Michael Chan
2016-05-15 7:04 ` [PATCH net-next v2 5/9] bnxt_en: Improve the delay logic for firmware response Michael Chan
2016-05-15 7:04 ` [PATCH net-next v2 6/9] bnxt_en: Fix length value in dmesg log firmware error message Michael Chan
2016-05-15 7:04 ` [PATCH net-next v2 7/9] bnxt_en: Simplify and improve unsupported SFP+ module reporting Michael Chan
2016-05-15 7:04 ` [PATCH net-next v2 8/9] bnxt_en: Add BCM57314 device ID Michael Chan
2016-05-15 7:04 ` [PATCH net-next v2 9/9] bnxt_en: Use dma_rmb() instead of rmb() Michael Chan
2016-05-15 17:36 ` [PATCH net-next v2 0/9] bnxt_en: updates for net-next David Miller
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=1463295891-15216-2-git-send-email-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=davem@davemloft.net \
--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).