diff mbox series

[net-next,v3,2/4] eth: mlx4: don't try to complete XDP frames in netpoll

Message ID 20250213010635.1354034-3-kuba@kernel.org (mailing list archive)
State Accepted
Commit 8fdeafd66edaf420ea0063a1f13442fe3470fe70
Delegated to: Netdev Maintainers
Headers show
Series eth: mlx4: use the page pool for Rx buffers | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 5 maintainers not CCed: ast@kernel.org daniel@iogearbox.net john.fastabend@gmail.com linux-rdma@vger.kernel.org bpf@vger.kernel.org
netdev/build_clang success Errors and warnings before: 2 this patch: 2
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-02-15--03-00 (tests: 891)

Commit Message

Jakub Kicinski Feb. 13, 2025, 1:06 a.m. UTC
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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
v2:
 - clarify the commit msg
v1: https://lore.kernel.org/20250205031213.358973-3-kuba@kernel.org
---
 drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tariq Toukan Feb. 18, 2025, 12:11 p.m. UTC | #1
On 13/02/2025 3:06, Jakub Kicinski wrote:
> 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.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> v2:
>   - clarify the commit msg
> v1: https://lore.kernel.org/20250205031213.358973-3-kuba@kernel.org
> ---
>   drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> index 1ddb11cb25f9..6e077d202827 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
> @@ -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);
>   

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 1ddb11cb25f9..6e077d202827 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -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);