Skip to content

Commit

Permalink
common/mlx5: fix DevX read output buffer size
Browse files Browse the repository at this point in the history
[ upstream commit dd9e9d5 ]

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: bb7ef9a ("common/mlx5: add register access DevX routine")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
  • Loading branch information
Dekel Peled authored and steevenlee committed May 6, 2021
1 parent 23b584d commit 8d2066d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/common/mlx5/mlx5_devx_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8d2066d

Please sign in to comment.