All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan Whitehead <Bryan.Whitehead@microchip.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <UNGLinuxDriver@microchip.com>
Subject: [PATCH v1 net] lan743x: fix return value for lan743x_tx_napi_poll
Date: Tue, 20 Nov 2018 13:26:43 -0500	[thread overview]
Message-ID: <1542738403-23034-1-git-send-email-Bryan.Whitehead@microchip.com> (raw)

It has been noticed that under stress the lan743x driver will
sometimes hang or cause a kernel panic. It has been noticed
that returning '0' instead of 'weight' fixes this issue.

fixes: rare kernel panic under heavy traffic load.
Signed-off-by: Bryan Whitehead <Bryan.Whitehead@microchip.com>
---
 drivers/net/ethernet/microchip/lan743x_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 867cddb..ca33ade 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -1672,7 +1672,7 @@ static int lan743x_tx_napi_poll(struct napi_struct *napi, int weight)
 		netif_wake_queue(adapter->netdev);
 	}
 
-	if (!napi_complete_done(napi, weight))
+	if (!napi_complete_done(napi, 0))
 		goto done;
 
 	/* enable isr */
@@ -1681,7 +1681,7 @@ static int lan743x_tx_napi_poll(struct napi_struct *napi, int weight)
 	lan743x_csr_read(adapter, INT_STS);
 
 done:
-	return weight;
+	return 0;
 }
 
 static void lan743x_tx_ring_cleanup(struct lan743x_tx *tx)
-- 
2.7.4

             reply	other threads:[~2018-11-21  5:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 18:26 Bryan Whitehead [this message]
2018-11-20 19:30 ` [PATCH v1 net] lan743x: fix return value for lan743x_tx_napi_poll Andrew Lunn
2018-11-20 21:39   ` Bryan.Whitehead
2018-11-20 21:55     ` Andrew Lunn
2018-11-20 22:11     ` Florian Fainelli
2018-11-21  2:13       ` Tristram.Ha
2018-11-21  3:12         ` David Miller
2018-11-21 16:47         ` Bryan.Whitehead
2018-11-21 16:44       ` Bryan.Whitehead

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=1542738403-23034-1-git-send-email-Bryan.Whitehead@microchip.com \
    --to=bryan.whitehead@microchip.com \
    --cc=UNGLinuxDriver@microchip.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.