forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/mellanox/mlx5/core/pd.c
....@@ -33,17 +33,16 @@
3333 #include <linux/kernel.h>
3434 #include <linux/module.h>
3535 #include <linux/mlx5/driver.h>
36
-#include <linux/mlx5/cmd.h>
3736 #include "mlx5_core.h"
3837
3938 int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn)
4039 {
41
- u32 out[MLX5_ST_SZ_DW(alloc_pd_out)] = {0};
42
- u32 in[MLX5_ST_SZ_DW(alloc_pd_in)] = {0};
40
+ u32 out[MLX5_ST_SZ_DW(alloc_pd_out)] = {};
41
+ u32 in[MLX5_ST_SZ_DW(alloc_pd_in)] = {};
4342 int err;
4443
4544 MLX5_SET(alloc_pd_in, in, opcode, MLX5_CMD_OP_ALLOC_PD);
46
- err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
45
+ err = mlx5_cmd_exec_inout(dev, alloc_pd, in, out);
4746 if (!err)
4847 *pdn = MLX5_GET(alloc_pd_out, out, pd);
4948 return err;
....@@ -52,11 +51,10 @@
5251
5352 int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn)
5453 {
55
- u32 out[MLX5_ST_SZ_DW(dealloc_pd_out)] = {0};
56
- u32 in[MLX5_ST_SZ_DW(dealloc_pd_in)] = {0};
54
+ u32 in[MLX5_ST_SZ_DW(dealloc_pd_in)] = {};
5755
5856 MLX5_SET(dealloc_pd_in, in, opcode, MLX5_CMD_OP_DEALLOC_PD);
5957 MLX5_SET(dealloc_pd_in, in, pd, pdn);
60
- return mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
58
+ return mlx5_cmd_exec_in(dev, dealloc_pd, in);
6159 }
6260 EXPORT_SYMBOL(mlx5_core_dealloc_pd);