Skip to content

Commit c8e9090

Browse files
dtatuleaSaeed Mahameed
authored andcommitted
net/mlx5e: RX, Fix releasing page_pool pages twice for striding RQ
mlx5e_free_rx_descs is responsible for calling the dealloc_wqe op which returns pages to the page_pool. This can happen during flush or close. For XSK, the regular RQ is flushed (when replaced by the XSK RQ) and also closed later. This is normally not a problem as the wqe list is empty on a second call to mlx5e_free_rx_descs. However, for striding RQ, the previously released wqes from the list will appear as missing and will be released a second time by mlx5e_free_rx_missing_descs. This patch sets the no release bits on the striding RQ wqes in the dealloc_wqe op to prevent releasing the pages a second time. Please note that the bits are set only in the control path during close and not in the data path. Fixes: 4c2a132 ("net/mlx5e: RX, Defer page release in striding 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 cf14af1 commit c8e9090

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,11 @@ static void mlx5e_dealloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix)
861861
struct mlx5e_mpw_info *wi = mlx5e_get_mpw_info(rq, ix);
862862
/* This function is called on rq/netdev close. */
863863
mlx5e_free_rx_mpwqe(rq, wi);
864+
865+
/* Avoid a second release of the wqe pages: dealloc is called also
866+
* for missing wqes on an already flushed RQ.
867+
*/
868+
bitmap_fill(wi->skip_release_bitmap, rq->mpwqe.pages_per_wqe);
864869
}
865870

866871
INDIRECT_CALLABLE_SCOPE bool mlx5e_post_rx_wqes(struct mlx5e_rq *rq)

0 commit comments

Comments
 (0)