[dpdk-dev] [PATCH] net/mlx4: verify Tx max sges

Shahaf Shuler shahafs at mellanox.com
Wed Jan 10 16:19:03 CET 2018


Friday, January 5, 2018 6:53 PM, Adrien Mazarguil:
> > Signed-off-by: Moti Haimovsky <motih at mellanox.com>
> 
> Except for a really minor nit below:
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>

Applied to next-net-mlx with the suggested fix. Thanks 

> 
> > ---
> >  drivers/net/mlx4/mlx4.c     | 1 +
> >  drivers/net/mlx4/mlx4_prm.h | 5 ++++-
> >  2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index
> > 4bc4a6f..61c5bf4 100644
> > --- a/drivers/net/mlx4/mlx4.c
> > +++ b/drivers/net/mlx4/mlx4.c
> > @@ -505,6 +505,7 @@ struct mlx4_conf {
> >  		rte_errno = ENODEV;
> >  		goto error;
> >  	}
> > +	assert(device_attr.max_sge >= MLX4_MAX_SGE);
> >  	for (i = 0; i < device_attr.phys_port_cnt; i++) {
> >  		uint32_t port = i + 1; /* ports are indexed from one */
> >  		struct ibv_context *ctx = NULL;
> > diff --git a/drivers/net/mlx4/mlx4_prm.h b/drivers/net/mlx4/mlx4_prm.h
> > index 217ea50..b382d59 100644
> > --- a/drivers/net/mlx4/mlx4_prm.h
> > +++ b/drivers/net/mlx4/mlx4_prm.h
> > @@ -53,7 +53,10 @@
> >  #define MLX4_TXBB_SIZE (1 << MLX4_TXBB_SHIFT)
> >
> >  /* Typical TSO descriptor with 16 gather entries is 352 bytes. */
> > -#define MLX4_MAX_WQE_SIZE 512
> > +#define MLX4_MAX_SGE 32
> > +#define MLX4_MAX_WQE_SIZE \
> > +	(MLX4_MAX_SGE * sizeof(struct mlx4_wqe_data_seg) + \
> > +	sizeof(struct mlx4_wqe_ctrl_seg))
> 
> One extra indent space is needed before sizeof to align with parenthesis
> contents.
> 
> --
> Adrien Mazarguil
> 6WIND


More information about the dev mailing list