diff options
author | Gerhard Engleder <gerhard@engleder-embedded.com> | 2023-09-16 00:01:26 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-09-18 12:42:36 +0300 |
commit | 46589db3817bd8b523701274885984b5a5dda7d1 (patch) | |
tree | 96b4b22f92ed99c76e5f96b578112c6df8b7871f /drivers/net/ethernet/engleder | |
parent | a7f991953d73dd50c4c23b5437c0139960e1fad4 (diff) | |
download | linux-46589db3817bd8b523701274885984b5a5dda7d1.tar.xz |
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 <gerhard@engleder-embedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/engleder')
-rw-r--r-- | drivers/net/ethernet/engleder/tsnep_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c index 0cdf0de555ed..8b992dc9bb52 100644 --- a/drivers/net/ethernet/engleder/tsnep_main.c +++ b/drivers/net/ethernet/engleder/tsnep_main.c @@ -1734,6 +1734,10 @@ static int tsnep_poll(struct napi_struct *napi, int budget) if (queue->tx) complete = tsnep_tx_poll(queue->tx, budget); + /* handle case where we are called by netpoll with a budget of 0 */ + if (unlikely(budget <= 0)) + return budget; + if (queue->rx) { done = queue->rx->xsk_pool ? tsnep_rx_poll_zc(queue->rx, napi, budget) : |