[dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread

Xueming(Steven) Li xuemingl at mellanox.com
Tue Jul 28 10:06:33 CEST 2020



> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Tuesday, July 28, 2020 3:53 PM
> To: Matan Azrad <matan at mellanox.com>
> Cc: Xueming(Steven) Li <xuemingl at mellanox.com>; dev <dev at dpdk.org>; Asaf
> Penso <asafp at mellanox.com>
> Subject: Re: [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost
> thread
> 
> On Tue, Jul 28, 2020 at 9:30 AM Matan Azrad <matan at mellanox.com> wrote:
> > > > > rte_lcore_to_cpu_id(-1) is supposed to return the current lcore id.
> > > > > As explained in the commitlog of 67ae5936c4fc36, for a non-EAL
> > > > > thread (which has no associated lcore by default) calling this
> > > > > function means lcore_config[-1].core_id.
> > > >
> > > > Deosn't lcore mean core?
> > >
> > > No.
> >
> > So, it may be that we have more than one lcore working on a specific cpu_id?
> > Can you extend here?
> 
> A control thread is a non-EAL thread.

Is the default thread a control thread? After eal init, rte_lcore_to_cpu_id(-1) returns 0.

In function rte_ctrl_thread_create(), the new thread is set cpu affinity with control cpu set,
bind it same core of default control thread.

> A non-EAL thread has no lcore associated (unless you call the newly added
> rte_thread_register API).
> 
> Not sure why you need the physical core identifier in the driver.
> 
> It is possible that non-EAL threads run on one physical core if you start your
> application with the right cpuset.
> But without checking, you can't make such an assumption.
> 
> 
> >
> > >
> > > > So, if the private thread run on a core that opened by EAL,
> > > > Shouldn't the API return the lcore of the private thread core?
> > >
> > > vhost-events is a control thread.
> > > Was it working just by chance and returning 0 before?
> >
> > Probably yes.
> 
> (gdb) info symbol &lcore_config[-1].core_id vfio_cfgs + 444820 in section .bss
> of
> /home/dmarchan/git/pub/dpdk.org/build/app/../lib/librte_eal.so.20.0
> 
> Please, update the commitlog.
> Thanks.
> 
> 
> --
> David Marchand



More information about the dev mailing list