Skip to content

Commit 46589db

Browse files
Gerhard Englederdavem330
authored andcommitted
tsnep: Fix NAPI polling with budget 0
According to the NAPI documentation networking/napi.rst, Rx specific APIs like page pool and XDP cannot be used at all when budget is 0. skb Tx processing should happen regardless of the budget. Stop NAPI polling after Tx processing and skip Rx processing if budget is 0. Signed-off-by: Gerhard Engleder <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a7f9919 commit 46589db

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/engleder/tsnep_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,10 @@ static int tsnep_poll(struct napi_struct *napi, int budget)
17341734
if (queue->tx)
17351735
complete = tsnep_tx_poll(queue->tx, budget);
17361736

1737+
/* handle case where we are called by netpoll with a budget of 0 */
1738+
if (unlikely(budget <= 0))
1739+
return budget;
1740+
17371741
if (queue->rx) {
17381742
done = queue->rx->xsk_pool ?
17391743
tsnep_rx_poll_zc(queue->rx, napi, budget) :

0 commit comments

Comments
 (0)