From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH net v2 3/3] net: systemport: fix TX NAPI work done return value
Date: Thu, 26 Jun 2014 10:06:46 -0700 [thread overview]
Message-ID: <1403802406-10992-4-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1403802406-10992-1-git-send-email-f.fainelli@gmail.com>
Although we do not limit the number of packets the TX completion
function bcm_sysport_tx_reclaim() is allowed to reclaim, we were still
using its return value as-is. This means that we could hit the WARN() in
net/core/dev.c where work_done >= budget.
Make sure we do exit the NAPI context when the TX ring is empty, and
pretend there was no work to do.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
New patch in v2
drivers/net/ethernet/broadcom/bcmsysport.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index d31f7d239064..5776e503e4c5 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -654,13 +654,13 @@ static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget)
work_done = bcm_sysport_tx_reclaim(ring->priv, ring);
- if (work_done < budget) {
+ if (work_done == 0) {
napi_complete(napi);
/* re-enable TX interrupt */
intrl2_1_mask_clear(ring->priv, BIT(ring->index));
}
- return work_done;
+ return 0;
}
static void bcm_sysport_tx_reclaim_all(struct bcm_sysport_priv *priv)
--
1.9.1
next prev parent reply other threads:[~2014-06-26 17:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 17:06 [PATCH net v2 0/3] net: systemport: misc fixes Florian Fainelli
2014-06-26 17:06 ` [PATCH net v2 1/3] net: systemport: do not clear IFF_MULTICAST flag Florian Fainelli
2014-06-26 17:06 ` [PATCH net v2 2/3] net: systemport: fix UniMAC reset logic Florian Fainelli
2014-06-26 17:06 ` Florian Fainelli [this message]
2014-07-02 0:16 ` [PATCH net v2 0/3] net: systemport: misc 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=1403802406-10992-4-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.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).