net/mlx5e: Match cleanup order in mlx5e_free_rq in reverse of mlx5e_alloc_rq
mlx5e_free_rq previously cleaned resources in an order that was not the reverse of the resource allocation order in mlx5e_alloc_rq. Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20240911201757.1505453-16-saeed@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
909fc8d107
commit
cc18129189
@@ -1016,30 +1016,31 @@ err_rq_xdp_prog:
|
||||
|
||||
static void mlx5e_free_rq(struct mlx5e_rq *rq)
|
||||
{
|
||||
struct bpf_prog *old_prog;
|
||||
|
||||
if (xdp_rxq_info_is_reg(&rq->xdp_rxq)) {
|
||||
old_prog = rcu_dereference_protected(rq->xdp_prog,
|
||||
lockdep_is_held(&rq->priv->state_lock));
|
||||
if (old_prog)
|
||||
bpf_prog_put(old_prog);
|
||||
}
|
||||
kvfree(rq->dim);
|
||||
page_pool_destroy(rq->page_pool);
|
||||
|
||||
switch (rq->wq_type) {
|
||||
case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ:
|
||||
mlx5e_rq_free_shampo(rq);
|
||||
kvfree(rq->mpwqe.info);
|
||||
mlx5_core_destroy_mkey(rq->mdev, be32_to_cpu(rq->mpwqe.umr_mkey_be));
|
||||
mlx5e_free_mpwqe_rq_drop_page(rq);
|
||||
mlx5e_rq_free_shampo(rq);
|
||||
break;
|
||||
default: /* MLX5_WQ_TYPE_CYCLIC */
|
||||
mlx5e_free_wqe_alloc_info(rq);
|
||||
}
|
||||
|
||||
kvfree(rq->dim);
|
||||
xdp_rxq_info_unreg(&rq->xdp_rxq);
|
||||
page_pool_destroy(rq->page_pool);
|
||||
mlx5_wq_destroy(&rq->wq_ctrl);
|
||||
|
||||
if (xdp_rxq_info_is_reg(&rq->xdp_rxq)) {
|
||||
struct bpf_prog *old_prog;
|
||||
|
||||
old_prog = rcu_dereference_protected(rq->xdp_prog,
|
||||
lockdep_is_held(&rq->priv->state_lock));
|
||||
if (old_prog)
|
||||
bpf_prog_put(old_prog);
|
||||
}
|
||||
xdp_rxq_info_unreg(&rq->xdp_rxq);
|
||||
}
|
||||
|
||||
int mlx5e_create_rq(struct mlx5e_rq *rq, struct mlx5e_rq_param *param, u16 q_counter)
|
||||
|
||||
Reference in New Issue
Block a user