From: "Dmitry Kravkov" <dmitry@broadcom.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: "Vladislav Zolotarov" <vladz@broadcom.com>,
"Dmitry Kravkov" <dmitry@broadcom.com>,
"Eilon Greenstein" <eilong@broadcom.com>
Subject: [PATCH 3/8] bnx2x: fix rx ring size report
Date: Tue, 30 Aug 2011 13:08:41 +0300 [thread overview]
Message-ID: <1314698926-24525-4-git-send-email-dmitry@broadcom.com> (raw)
In-Reply-To: <1314698926-24525-1-git-send-email-dmitry@broadcom.com>
From: Vladislav Zolotarov <vladz@broadcom.com>
Store the size in bp, read from bp when queried.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_cmn.c | 17 +++++++++++------
drivers/net/bnx2x/bnx2x_ethtool.c | 5 +----
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index 2a33d24..c4cbf97 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -3091,15 +3091,20 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index)
struct bnx2x_fastpath *fp = &bp->fp[index];
int ring_size = 0;
u8 cos;
+ int rx_ring_size = 0;
/* if rx_ring_size specified - use it */
- int rx_ring_size = bp->rx_ring_size ? bp->rx_ring_size :
- MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp);
+ if (!bp->rx_ring_size) {
- /* allocate at least number of buffers required by FW */
- rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA :
- MIN_RX_SIZE_TPA,
- rx_ring_size);
+ rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp);
+
+ /* allocate at least number of buffers required by FW */
+ rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA :
+ MIN_RX_SIZE_TPA, rx_ring_size);
+
+ bp->rx_ring_size = rx_ring_size;
+ } else
+ rx_ring_size = bp->rx_ring_size;
/* Common */
sb = &bnx2x_fp(bp, index, status_blk);
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index 2218630..0ceb6c7 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -1310,10 +1310,7 @@ static void bnx2x_get_ringparam(struct net_device *dev,
if (bp->rx_ring_size)
ering->rx_pending = bp->rx_ring_size;
else
- if (bp->state == BNX2X_STATE_OPEN && bp->num_queues)
- ering->rx_pending = MAX_RX_AVAIL/bp->num_queues;
- else
- ering->rx_pending = MAX_RX_AVAIL;
+ ering->rx_pending = MAX_RX_AVAIL;
ering->rx_mini_pending = 0;
ering->rx_jumbo_pending = 0;
--
1.7.2.2
next prev parent reply other threads:[~2011-08-30 10:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-30 10:08 [PATCH 0/8] bnx2x: fixes Dmitry Kravkov
2011-08-30 10:08 ` [PATCH 1/8] bnx2x: fix BRB thresholds for dropless_fc mode Dmitry Kravkov
2011-08-30 10:08 ` [PATCH 2/8] bnx2x: decrease print level to debug Dmitry Kravkov
2011-08-30 10:08 ` Dmitry Kravkov [this message]
2011-08-30 10:08 ` [PATCH 4/8] bnx2x: fix MF for 4-port devices Dmitry Kravkov
2011-08-30 10:08 ` [PATCH 5/8] bnx2x: don't reset device while reading its configuration Dmitry Kravkov
2011-08-30 10:08 ` [PATCH 6/8] bnx2x: init fw_seq after undi_unload is done Dmitry Kravkov
2011-08-30 10:08 ` [PATCH 7/8] bnx2x: don't access removed registers on 57712 and above Dmitry Kravkov
2011-08-30 10:08 ` [PATCH 8/8] bnx2x: Fix for a host coalescing bug which impared latency Dmitry Kravkov
2011-09-15 19:06 ` [PATCH 0/8] bnx2x: fixes 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=1314698926-24525-4-git-send-email-dmitry@broadcom.com \
--to=dmitry@broadcom.com \
--cc=davem@davemloft.net \
--cc=eilong@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=vladz@broadcom.com \
/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).