@@ -1016,30 +1016,31 @@ static int mlx5e_alloc_rq(struct mlx5e_params *params,
1016
1016
1017
1017
static void mlx5e_free_rq (struct mlx5e_rq * rq )
1018
1018
{
1019
- struct bpf_prog * old_prog ;
1020
-
1021
- if (xdp_rxq_info_is_reg (& rq -> xdp_rxq )) {
1022
- old_prog = rcu_dereference_protected (rq -> xdp_prog ,
1023
- lockdep_is_held (& rq -> priv -> state_lock ));
1024
- if (old_prog )
1025
- bpf_prog_put (old_prog );
1026
- }
1019
+ kvfree (rq -> dim );
1020
+ page_pool_destroy (rq -> page_pool );
1027
1021
1028
1022
switch (rq -> wq_type ) {
1029
1023
case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ :
1024
+ mlx5e_rq_free_shampo (rq );
1030
1025
kvfree (rq -> mpwqe .info );
1031
1026
mlx5_core_destroy_mkey (rq -> mdev , be32_to_cpu (rq -> mpwqe .umr_mkey_be ));
1032
1027
mlx5e_free_mpwqe_rq_drop_page (rq );
1033
- mlx5e_rq_free_shampo (rq );
1034
1028
break ;
1035
1029
default : /* MLX5_WQ_TYPE_CYCLIC */
1036
1030
mlx5e_free_wqe_alloc_info (rq );
1037
1031
}
1038
1032
1039
- kvfree (rq -> dim );
1040
- xdp_rxq_info_unreg (& rq -> xdp_rxq );
1041
- page_pool_destroy (rq -> page_pool );
1042
1033
mlx5_wq_destroy (& rq -> wq_ctrl );
1034
+
1035
+ if (xdp_rxq_info_is_reg (& rq -> xdp_rxq )) {
1036
+ struct bpf_prog * old_prog ;
1037
+
1038
+ old_prog = rcu_dereference_protected (rq -> xdp_prog ,
1039
+ lockdep_is_held (& rq -> priv -> state_lock ));
1040
+ if (old_prog )
1041
+ bpf_prog_put (old_prog );
1042
+ }
1043
+ xdp_rxq_info_unreg (& rq -> xdp_rxq );
1043
1044
}
1044
1045
1045
1046
int mlx5e_create_rq (struct mlx5e_rq * rq , struct mlx5e_rq_param * param , u16 q_counter )
0 commit comments