[dpdk-dev] [PATCH] app/testpmd: fix physic port socket initialization

Phil Yang (Arm Technology China) Phil.Yang at arm.com
Wed Oct 17 03:41:01 CEST 2018


> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Ananyev, Konstantin
> Sent: Tuesday, October 16, 2018 6:40 PM
> To: dev <dev-bounces at dpdk.org>; dev at dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit at intel.com>; nd <nd at arm.com>
> Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix physic port socket initialization
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org]
> > Sent: Tuesday, October 16, 2018 11:15 AM
> > To: dev at dpdk.org
> > Cc: Yigit, Ferruh <ferruh.yigit at intel.com>; nd at arm.com
> > Subject: [dpdk-dev] [PATCH] app/testpmd: fix physic port socket
> > initialization
> >
> > Once the lcore list setting excluded the socket which physic device
> > attached, it will cause failure. Meanwhile, it will disable Testpmd
> > cross NUMA scenario.
> >
> > Fixes: dbfb8ec ("app/testpmd: optimize mbuf pool allocation")
> >
> > Signed-off-by: Phil Yang <phil.yang at arm.com>
> > Reviewed-by: Gavin Hu <Gavin.Hu at arm.com>
> > ---
> >  app/test-pmd/testpmd.c | 14 +++++++++++++-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > 5dbbf78..4739ddb 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -565,9 +565,21 @@ set_default_fwd_ports_config(void)
> >  	portid_t pt_id;
> >  	int i = 0;
> >
> > -	RTE_ETH_FOREACH_DEV(pt_id)
> > +	RTE_ETH_FOREACH_DEV(pt_id) {
> >  		fwd_ports_ids[i++] = pt_id;
> >
> > +		/* Update sockets info according to the attached device */
> > +		int socket_id = rte_eth_dev_socket_id(pt_id);
> > +		if (socket_id >= 0 && new_socket_id(pt_id)) {
> 
> Should be: ' new_socket_id(socket_id)', I think.
> Konstantin

Exactly.
Thanks Konstantin. It has been fixed in V2.

> 
> > +			if (num_sockets >= RTE_MAX_NUMA_NODES) {
> > +				rte_exit(EXIT_FAILURE,
> > +					 "Total sockets greater than %u\n",
> > +					 RTE_MAX_NUMA_NODES);
> > +			}
> > +			socket_ids[num_sockets++] = socket_id;
> > +		}
> > +	}
> > +
> >  	nb_cfg_ports = nb_ports;
> >  	nb_fwd_ports = nb_ports;
> >  }
> > --
> > 2.7.4



More information about the dev mailing list