net/mlx5: Update pagealloc.c new cmd interface
authorLeon Romanovsky <leonro@mellanox.com>
Thu, 9 Apr 2020 14:02:07 +0000 (17:02 +0300)
committerLeon Romanovsky <leonro@mellanox.com>
Thu, 23 Apr 2020 18:42:13 +0000 (21:42 +0300)
Do mass update of pagealloc.c to reuse newly introduced
mlx5_cmd_exec_in*() interfaces.

Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

index a395975..3d6f617 100644 (file)
@@ -135,8 +135,8 @@ static struct fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr)
 static int mlx5_cmd_query_pages(struct mlx5_core_dev *dev, u16 *func_id,
                                s32 *npages, int boot)
 {
-       u32 out[MLX5_ST_SZ_DW(query_pages_out)] = {0};
-       u32 in[MLX5_ST_SZ_DW(query_pages_in)]   = {0};
+       u32 out[MLX5_ST_SZ_DW(query_pages_out)] = {};
+       u32 in[MLX5_ST_SZ_DW(query_pages_in)] = {};
        int err;
 
        MLX5_SET(query_pages_in, in, opcode, MLX5_CMD_OP_QUERY_PAGES);
@@ -145,7 +145,7 @@ static int mlx5_cmd_query_pages(struct mlx5_core_dev *dev, u16 *func_id,
                 MLX5_QUERY_PAGES_IN_OP_MOD_INIT_PAGES);
        MLX5_SET(query_pages_in, in, embedded_cpu_function, mlx5_core_is_ecpf(dev));
 
-       err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
+       err = mlx5_cmd_exec_inout(dev, query_pages, in, out);
        if (err)
                return err;
 
@@ -256,8 +256,7 @@ err_mapping:
 static void page_notify_fail(struct mlx5_core_dev *dev, u16 func_id,
                             bool ec_function)
 {
-       u32 out[MLX5_ST_SZ_DW(manage_pages_out)] = {0};
-       u32 in[MLX5_ST_SZ_DW(manage_pages_in)]   = {0};
+       u32 in[MLX5_ST_SZ_DW(manage_pages_in)] = {};
        int err;
 
        MLX5_SET(manage_pages_in, in, opcode, MLX5_CMD_OP_MANAGE_PAGES);
@@ -265,7 +264,7 @@ static void page_notify_fail(struct mlx5_core_dev *dev, u16 func_id,
        MLX5_SET(manage_pages_in, in, function_id, func_id);
        MLX5_SET(manage_pages_in, in, embedded_cpu_function, ec_function);
 
-       err = mlx5_cmd_exec(dev, in, sizeof(in), out, sizeof(out));
+       err = mlx5_cmd_exec_in(dev, manage_pages, in);
        if (err)
                mlx5_core_warn(dev, "page notify failed func_id(%d) err(%d)\n",
                               func_id, err);
@@ -373,7 +372,7 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u32 func_id, int npages,
                         int *nclaimed, bool ec_function)
 {
        int outlen = MLX5_ST_SZ_BYTES(manage_pages_out);
-       u32 in[MLX5_ST_SZ_DW(manage_pages_in)] = {0};
+       u32 in[MLX5_ST_SZ_DW(manage_pages_in)] = {};
        int num_claimed;
        u32 *out;
        int err;