[dpdk-dev] [dpdk-stable] [PATCH v2 2/2] net/mlx5: fix allocation when no memory on device NUMA node

Olivier Matz olivier.matz at 6wind.com
Mon Jan 22 09:20:21 CET 2018


Hi Shahaf,

On Sun, Jan 21, 2018 at 06:58:09AM +0000, Shahaf Shuler wrote:
> Friday, January 19, 2018 6:25 PM, Olivier Matz:
> on the same numa node than the device, it is
> > preferable to fallback on another socket instead of failing.
> > 
> > Fixes: 1e3a39f72d5d ("net/mlx5: allocate verbs object into shared memory")
> > Cc: stable at dpdk.org
> > 
> > Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> > ---
> > 
> > This new version of the patch was provided by Nelio (thanks), I validated it
> > on my platform. I just did minimal changes to fix the checkpatch issues in the
> > comments of mlx5.h (/** instead of /*).
> 
> Per my understanding the below patch is to select the socket on which to create the Verbs object based on the ethdev configuration rather than the PCI numa node.
> While it introduce the infrastructure to do fallback to other socket id, it is not yet used. 
> I think the commit log should be modified to better explain this patch.

That's right, the commit log should be updated, it's still the commit log
of the v1, which does not match.

> > 
> >  drivers/net/mlx5/mlx5.c     | 14 ++++++++++++--
> >  drivers/net/mlx5/mlx5.h     | 20 ++++++++++++++++++++
> >  drivers/net/mlx5/mlx5_rxq.c |  4 ++++
> >  drivers/net/mlx5/mlx5_txq.c |  4 ++++
> >  4 files changed, 40 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index
> > 1c95f3520..7a04ccf98 100644
> > --- a/drivers/net/mlx5/mlx5.c
> > +++ b/drivers/net/mlx5/mlx5.c
> > @@ -139,10 +139,20 @@ mlx5_alloc_verbs_buf(size_t size, void *data)
> >  	struct priv *priv = data;
> >  	void *ret;
> >  	size_t alignment = sysconf(_SC_PAGESIZE);
> > +	unsigned int socket = SOCKET_ID_ANY;
> > 
> > +	if (priv->verbs_alloc_ctx.type ==
> > MLX5_VERSB_ALLOC_TYPE_TX_QUEUE) {

It looks we should also replace VERSB by VERBS :D

I will send a v3.


More information about the dev mailing list