[dpdk-dev] [PATCH] net/mlx5: change calculating inline room for Tx

Yongseok Koh yskoh at mellanox.com
Fri Apr 14 18:52:25 CEST 2017


On Fri, Apr 14, 2017 at 08:51:39AM +0200, Nélio Laranjeiro wrote:
> Hi Yongseok,
> 
> On Thu, Apr 13, 2017 at 10:46:51AM -0700, Yongseok Koh wrote:
> > Current implementation is error-prone if the max inline size
> > (txq->max_inilne) is decoupled from txq->inline_en and becomes zero. If it
> > becomes zero, HW can crash due to WQ overflow.
> 
> By reading this log, it seems more to be a fix, no?
It doesn't fix any existing bug in the code but to protect from potential
disaster by adding new features in the future. Also, there's a customer who
wants to change txq->max_inilne in runtime.

> 
> > Signed-off-by: Yongseok Koh <yskoh at mellanox.com>
> > Acked-by: Shahaf Shuler <shahafs at mellanox.com>
> > ---
> >  drivers/net/mlx5/mlx5_rxtx.c | 12 +++++++-----
> >  1 file changed, 7 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
> > index 2e208bf96..6254228a9 100644
> > --- a/drivers/net/mlx5/mlx5_rxtx.c
> > +++ b/drivers/net/mlx5/mlx5_rxtx.c
> > @@ -499,6 +499,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
> >  	unsigned int j = 0;
> >  	unsigned int k = 0;
> >  	unsigned int max;
> > +	unsigned int max_inline = txq->max_inline;
> 
> Cannot it be declared as const too?  Seems it is only read in the whole
> Tx burst function, as it a chance to be update in the middle?
This is used just for calculation not for conditional expression. So, I didn't
think this makes difference.

Thanks
Yongseok


More information about the dev mailing list