[dpdk-dev] [PATCH] net/mlx5: fix calculation of struct size in bytes

Ori Kam orika at mellanox.com
Mon Oct 8 15:57:49 CEST 2018



> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Dekel Peled
> Sent: Monday, October 8, 2018 4:35 PM
> To: Yongseok Koh <yskoh at mellanox.com>; Shahaf Shuler
> <shahafs at mellanox.com>
> Cc: dev at dpdk.org; Ori Kam <orika at mellanox.com>
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix calculation of struct size in bytes
> 
> Update definition of MLX5_ST_SZ_DB to calculate struct size correctly.
> 
> Fixes: 86a8d2b59f54 ("net/mlx5: add Direct Verbs prepare function")
> Cc: orika at mellanox.com
> 
> Signed-off-by: Dekel Peled <dekelp at mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_prm.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h
> index a905397..29742b1 100644
> --- a/drivers/net/mlx5/mlx5_prm.h
> +++ b/drivers/net/mlx5/mlx5_prm.h
> @@ -376,7 +376,7 @@ struct mlx5_modification_cmd {
>  				    (__mlx5_bit_off(typ, fld) & 0xf))
>  #define __mlx5_mask16(typ, fld) ((u16)((1ull << __mlx5_bit_sz(typ, fld)) - 1))
>  #define MLX5_ST_SZ_DW(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32)
> -#define MLX5_ST_SZ_DB(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 32)
> +#define MLX5_ST_SZ_DB(typ) (sizeof(struct mlx5_ifc_##typ##_bits) / 8)
>  #define MLX5_BYTE_OFF(typ, fld) (__mlx5_bit_off(typ, fld) / 8)
>  #define MLX5_ADDR_OF(typ, p, fld) ((char *)(p) + MLX5_BYTE_OFF(typ, fld))
> 
> --
> 1.7.1

Acked-by: Ori Kam <orika at mellanox.com>

Thanks,
Ori Kam


More information about the dev mailing list