Skip to content

Commit 2e2d196

Browse files
dtatuleaSaeed Mahameed
authored andcommitted
net/mlx5e: RX, Fix flush and close release flow of regular rq for legacy rq
Regular (non-XSK) RQs get flushed on XSK setup and re-activated on XSK close. If the same regular RQ is closed (a config change for example) soon after the XSK close, a double release occurs because the missing wqes get released a second time. Fixes: 3f93f82 ("net/mlx5e: RX, Defer page release in legacy rq for better recycling") Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent d543b64 commit 2e2d196

File tree

1 file changed

+10
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,18 @@ static void mlx5e_dealloc_rx_wqe(struct mlx5e_rq *rq, u16 ix)
390390
{
391391
struct mlx5e_wqe_frag_info *wi = get_frag(rq, ix);
392392

393-
if (rq->xsk_pool)
393+
if (rq->xsk_pool) {
394394
mlx5e_xsk_free_rx_wqe(wi);
395-
else
395+
} else {
396396
mlx5e_free_rx_wqe(rq, wi);
397+
398+
/* Avoid a second release of the wqe pages: dealloc is called
399+
* for the same missing wqes on regular RQ flush and on regular
400+
* RQ close. This happens when XSK RQs come into play.
401+
*/
402+
for (int i = 0; i < rq->wqe.info.num_frags; i++, wi++)
403+
wi->flags |= BIT(MLX5E_WQE_FRAG_SKIP_RELEASE);
404+
}
397405
}
398406

399407
static void mlx5e_xsk_free_rx_wqes(struct mlx5e_rq *rq, u16 ix, int wqe_bulk)

0 commit comments

Comments
 (0)