From: Dekel Peled Date: Thu, 18 Feb 2021 16:18:05 +0000 (+0200) Subject: common/mlx5: fix DevX read output buffer size X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=dd9e9d5491858bee49914c4fa574cc8e15640905;p=dpdk.git common/mlx5: fix DevX read output buffer size Previous patch included a glue function call, with wrong size calculation for an output buffer. This patch fixes the issue, using the correct size calculation. Fixes: bb7ef9a96281 ("common/mlx5: add register access DevX routine") Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index cc70c794e7..0185d57036 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -53,8 +53,8 @@ mlx5_devx_cmd_register_read(void *ctx, uint16_t reg_id, uint32_t arg, MLX5_SET(access_register_in, in, register_id, reg_id); MLX5_SET(access_register_in, in, argument, arg); rc = mlx5_glue->devx_general_cmd(ctx, in, sizeof(in), out, - MLX5_ST_SZ_DW(access_register_out) * - sizeof(uint32_t) + dw_cnt); + MLX5_ST_SZ_BYTES(access_register_out) + + sizeof(uint32_t) * dw_cnt); if (rc) goto error; status = MLX5_GET(access_register_out, out, status);