diff mbox series

common/mlx5: fix output buffer size calculation

Message ID 20c35b607a623f615338a84c4af5b80c1d95b39b.1613664690.git.dekelp@nvidia.com (mailing list archive)
State Accepted
Delegated to: Raslan Darawsheh
Headers show
Series common/mlx5: fix output buffer size calculation | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/travis-robot fail travis build: failed
ci/github-robot success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Dekel Peled Feb. 18, 2021, 4:18 p.m. UTC
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 <dekelp@nvidia.com>
Acked-by: Slava Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Raslan Darawsheh Feb. 21, 2021, 11:52 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Thursday, February 18, 2021 6:18 PM
> To: Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] common/mlx5: fix output buffer size calculation
> 
> 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 <dekelp@nvidia.com>
> Acked-by: Slava Ovsiienko <viacheslavo@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
diff mbox series

Patch

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);