File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
drivers/net/ethernet/mellanox/mlx5/core Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -3533,7 +3533,9 @@ int esw_offloads_enable(struct mlx5_eswitch *esw)
3533
3533
int err ;
3534
3534
3535
3535
mutex_init (& esw -> offloads .termtbl_mutex );
3536
- mlx5_rdma_enable_roce (esw -> dev );
3536
+ err = mlx5_rdma_enable_roce (esw -> dev );
3537
+ if (err )
3538
+ goto err_roce ;
3537
3539
3538
3540
err = mlx5_esw_host_number_init (esw );
3539
3541
if (err )
@@ -3594,6 +3596,7 @@ int esw_offloads_enable(struct mlx5_eswitch *esw)
3594
3596
esw_offloads_metadata_uninit (esw );
3595
3597
err_metadata :
3596
3598
mlx5_rdma_disable_roce (esw -> dev );
3599
+ err_roce :
3597
3600
mutex_destroy (& esw -> offloads .termtbl_mutex );
3598
3601
return err ;
3599
3602
}
Original file line number Diff line number Diff line change @@ -140,17 +140,17 @@ void mlx5_rdma_disable_roce(struct mlx5_core_dev *dev)
140
140
mlx5_nic_vport_disable_roce (dev );
141
141
}
142
142
143
- void mlx5_rdma_enable_roce (struct mlx5_core_dev * dev )
143
+ int mlx5_rdma_enable_roce (struct mlx5_core_dev * dev )
144
144
{
145
145
int err ;
146
146
147
147
if (!MLX5_CAP_GEN (dev , roce ))
148
- return ;
148
+ return 0 ;
149
149
150
150
err = mlx5_nic_vport_enable_roce (dev );
151
151
if (err ) {
152
152
mlx5_core_err (dev , "Failed to enable RoCE: %d\n" , err );
153
- return ;
153
+ return err ;
154
154
}
155
155
156
156
err = mlx5_rdma_add_roce_addr (dev );
@@ -165,10 +165,11 @@ void mlx5_rdma_enable_roce(struct mlx5_core_dev *dev)
165
165
goto del_roce_addr ;
166
166
}
167
167
168
- return ;
168
+ return err ;
169
169
170
170
del_roce_addr :
171
171
mlx5_rdma_del_roce_addr (dev );
172
172
disable_roce :
173
173
mlx5_nic_vport_disable_roce (dev );
174
+ return err ;
174
175
}
Original file line number Diff line number Diff line change 8
8
9
9
#ifdef CONFIG_MLX5_ESWITCH
10
10
11
- void mlx5_rdma_enable_roce (struct mlx5_core_dev * dev );
11
+ int mlx5_rdma_enable_roce (struct mlx5_core_dev * dev );
12
12
void mlx5_rdma_disable_roce (struct mlx5_core_dev * dev );
13
13
14
14
#else /* CONFIG_MLX5_ESWITCH */
15
15
16
- static inline void mlx5_rdma_enable_roce (struct mlx5_core_dev * dev ) {}
16
+ static inline int mlx5_rdma_enable_roce (struct mlx5_core_dev * dev ) { return 0 ; }
17
17
static inline void mlx5_rdma_disable_roce (struct mlx5_core_dev * dev ) {}
18
18
19
19
#endif /* CONFIG_MLX5_ESWITCH */
You can’t perform that action at this time.
0 commit comments