diff options
author | Jonathan Lemon <bsd@fb.com> | 2020-10-08 11:45:26 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-10-12 14:02:32 -0700 |
commit | b2b8a92733b288128feb57ffa694758cf475106c (patch) | |
tree | 4d969ccbb80a430a685bcc0adc0ea5ee289a87f4 /drivers/net/ethernet/mellanox/mlx4/en_rx.c | |
parent | 3af5f0f5c74ecbaf757ef06c3f80d56751277637 (diff) |
mlx4: handle non-napi callers to napi_poll
netcons calls napi_poll with a budget of 0 to transmit packets.
Handle this by:
- skipping RX processing
- do not try to recycle TX packets to the RX cache
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_rx.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index b50c567ef508..24006440e86e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c @@ -943,6 +943,9 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget) bool clean_complete = true; int done; + if (!budget) + return 0; + if (priv->tx_ring_num[TX_XDP]) { xdp_tx_cq = priv->tx_cq[TX_XDP][cq->ring]; if (xdp_tx_cq->xdp_busy) { |