All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 net] lan743x: fix return value for lan743x_tx_napi_poll
@ 2018-11-26 17:04 Bryan Whitehead
  2018-11-28  0:30 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan Whitehead @ 2018-11-26 17:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, UNGLinuxDriver

The lan743x driver, when under heavy traffic load, has been noticed
to sometimes hang, or cause a kernel panic.

Debugging reveals that the TX napi poll routine was returning
the wrong value, 'weight'. Most other drivers return 0.
And call napi_complete, instead of napi_complete_done.

Additionally when creating the tx napi poll routine.
Changed netif_napi_add, to netif_tx_napi_add.

Updates for v3:
    changed 'fixes' tag to match defined format

Updates for v2:
use napi_complete, instead of napi_complete_done in
    lan743x_tx_napi_poll
use netif_tx_napi_add, instead of netif_napi_add for
    registration of tx napi poll routine

fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
Signed-off-by: Bryan Whitehead <Bryan.Whitehead@microchip.com>
---
 drivers/net/ethernet/microchip/lan743x_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 867cddb..d627129 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(napi))
 		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)
@@ -1870,9 +1870,9 @@ static int lan743x_tx_open(struct lan743x_tx *tx)
 	tx->vector_flags = lan743x_intr_get_vector_flags(adapter,
 							 INT_BIT_DMA_TX_
 							 (tx->channel_number));
-	netif_napi_add(adapter->netdev,
-		       &tx->napi, lan743x_tx_napi_poll,
-		       tx->ring_size - 1);
+	netif_tx_napi_add(adapter->netdev,
+			  &tx->napi, lan743x_tx_napi_poll,
+			  tx->ring_size - 1);
 	napi_enable(&tx->napi);
 
 	data = 0;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3 net] lan743x: fix return value for lan743x_tx_napi_poll
  2018-11-26 17:04 [PATCH v3 net] lan743x: fix return value for lan743x_tx_napi_poll Bryan Whitehead
@ 2018-11-28  0:30 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-11-28  0:30 UTC (permalink / raw)
  To: Bryan.Whitehead; +Cc: netdev, UNGLinuxDriver

From: Bryan Whitehead <Bryan.Whitehead@microchip.com>
Date: Mon, 26 Nov 2018 12:04:57 -0500

> The lan743x driver, when under heavy traffic load, has been noticed
> to sometimes hang, or cause a kernel panic.
> 
> Debugging reveals that the TX napi poll routine was returning
> the wrong value, 'weight'. Most other drivers return 0.
> And call napi_complete, instead of napi_complete_done.
> 
> Additionally when creating the tx napi poll routine.
> Changed netif_napi_add, to netif_tx_napi_add.
> 
> Updates for v3:
>     changed 'fixes' tag to match defined format
> 
> Updates for v2:
> use napi_complete, instead of napi_complete_done in
>     lan743x_tx_napi_poll
> use netif_tx_napi_add, instead of netif_napi_add for
>     registration of tx napi poll routine
> 
> fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
> Signed-off-by: Bryan Whitehead <Bryan.Whitehead@microchip.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-28 11:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-26 17:04 [PATCH v3 net] lan743x: fix return value for lan743x_tx_napi_poll Bryan Whitehead
2018-11-28  0:30 ` David Miller

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.