Skip to content

Commit 40afb3b

Browse files
dtatuleaSaeed Mahameed
authored andcommitted
net/mlx5e: RX, Fix XDP_TX page release for legacy rq nonlinear case
When the XDP handler marks the data for transmission (XDP_TX), it is incorrect to release the page fragment. Instead, the fragments should be marked as MLX5E_WQE_FRAG_SKIP_RELEASE because XDP will release the page directly to the page_pool (page_pool_put_defragged_page) after TX completion. The linear case already does this. This patch fixes the nonlinear part as well. Also, the looping over the fragments was incorrect: When handling pages after XDP_TX in the legacy rq nonlinear case, the loop was skipping the first wqe fragment. Fixes: 3f93f82 ("net/mlx5e: RX, Defer page release in legacy rq for better recycling") Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent c8e9090 commit 40afb3b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,10 +1746,10 @@ mlx5e_skb_from_cqe_nonlinear(struct mlx5e_rq *rq, struct mlx5e_wqe_frag_info *wi
17461746
prog = rcu_dereference(rq->xdp_prog);
17471747
if (prog && mlx5e_xdp_handle(rq, prog, &mxbuf)) {
17481748
if (test_bit(MLX5E_RQ_FLAG_XDP_XMIT, rq->flags)) {
1749-
int i;
1749+
struct mlx5e_wqe_frag_info *pwi;
17501750

1751-
for (i = wi - head_wi; i < rq->wqe.info.num_frags; i++)
1752-
mlx5e_put_rx_frag(rq, &head_wi[i]);
1751+
for (pwi = head_wi; pwi < wi; pwi++)
1752+
pwi->flags |= BIT(MLX5E_WQE_FRAG_SKIP_RELEASE);
17531753
}
17541754
return NULL; /* page/packet was consumed by XDP */
17551755
}

0 commit comments

Comments
 (0)