eth: mlx4: don't try to complete XDP frames in netpoll
authorJakub Kicinski <kuba@kernel.org>
Thu, 13 Feb 2025 01:06:33 +0000 (17:06 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 18 Feb 2025 23:32:20 +0000 (15:32 -0800)
mlx4 doesn't support ndo_xdp_xmit / XDP_REDIRECT and wasn't
using page pool until now, so it could run XDP completions
in netpoll (NAPI budget == 0) just fine. Page pool has calling
context requirements, make sure we don't try to call it from
what is potentially HW IRQ context.

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250213010635.1354034-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx4/en_tx.c

index 1ddb11cb25f9162cc1eaf73601038c1cf13f347f..6e077d202827a23212786a2fa3e0b988d701ed50 100644 (file)
@@ -450,6 +450,8 @@ int mlx4_en_process_tx_cq(struct net_device *dev,
 
        if (unlikely(!priv->port_up))
                return 0;
+       if (unlikely(!napi_budget) && cq->type == TX_XDP)
+               return 0;
 
        netdev_txq_bql_complete_prefetchw(ring->tx_queue);