Skip to content

Commit cc59220

Browse files
BryanW11731-MCHPdavem330
authored andcommitted
lan743x: fix return value for lan743x_tx_napi_poll
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: 23f0703 ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Bryan Whitehead <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4b5adba commit cc59220

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/net/ethernet/microchip/lan743x_main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ static int lan743x_tx_napi_poll(struct napi_struct *napi, int weight)
16721672
netif_wake_queue(adapter->netdev);
16731673
}
16741674

1675-
if (!napi_complete_done(napi, weight))
1675+
if (!napi_complete(napi))
16761676
goto done;
16771677

16781678
/* enable isr */
@@ -1681,7 +1681,7 @@ static int lan743x_tx_napi_poll(struct napi_struct *napi, int weight)
16811681
lan743x_csr_read(adapter, INT_STS);
16821682

16831683
done:
1684-
return weight;
1684+
return 0;
16851685
}
16861686

16871687
static void lan743x_tx_ring_cleanup(struct lan743x_tx *tx)
@@ -1870,9 +1870,9 @@ static int lan743x_tx_open(struct lan743x_tx *tx)
18701870
tx->vector_flags = lan743x_intr_get_vector_flags(adapter,
18711871
INT_BIT_DMA_TX_
18721872
(tx->channel_number));
1873-
netif_napi_add(adapter->netdev,
1874-
&tx->napi, lan743x_tx_napi_poll,
1875-
tx->ring_size - 1);
1873+
netif_tx_napi_add(adapter->netdev,
1874+
&tx->napi, lan743x_tx_napi_poll,
1875+
tx->ring_size - 1);
18761876
napi_enable(&tx->napi);
18771877

18781878
data = 0;

0 commit comments

Comments
 (0)