[dpdk-dev] [PATCH v3] eal/windows: fix invalid thread handle
Tasnim Bashar
tbashar at mellanox.com
Tue Jun 16 21:59:00 CEST 2020
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Tuesday, June 16, 2020 12:17 PM
> To: dmitry.kozliuk at gmail.com; Tasnim Bashar <tbashar at mellanox.com>
> Cc: dev at dpdk.org; harini.ramakrishnan at microsoft.com;
> pallavi.kadam at intel.com; ranjit.menon at intel.com; ocardona at microsoft.com;
> navasile at linux.microsoft.com; Tal Shnaiderman <talshn at mellanox.com>; Fady
> Bader <fady at mellanox.com>; Ophir Munk <ophirmu at mellanox.com>
> Subject: Re: [dpdk-dev] [PATCH v3] eal/windows: fix invalid thread handle
>
> 16/06/2020 20:53, Tasnim Bashar:
> > > From: Thomas Monjalon <thomas at monjalon.net>
> > > 02/06/2020 04:00, Tasnim Bashar:
> > > > Casting thread ID to handle is not accurate way to get thread handle.
> > > > Need to use OpenThread function to get thread handle from thread ID.
> > > >
> > > > pthread_setaffinity_np and pthread_getaffinity_np functions for
> > > > Windows are affected because of it.
> > > >
> > > > Signed-off-by: Tasnim Bashar <tbashar at mellanox.com>
> > > > ---
> > > > v3: WA to remove warning(-Wmaybe-uninitialized)
> > >
> > > The -Wmaybe-uninitialized warning was there before this patch.
> > > Shouldn't it be a separate patch before this one?
> >
> > The warning appeared only on this patch, so we don't need to separate
> > it
>
> I can see the warning on the main repo when cross-compiling with MinGW on
> Linux.
I didn't test with cross compilation. In that case we can separate the warning fix from this patch.
>
> [...]
> > > > + memset(cpuset, 0, sizeof(rte_cpuset_t));
> > >
> > > Shouldn't we use RTE_CPU_ZERO instead of memset?
> >
> > If we use CPU_ZERO or CPU_SET, we still get the same warning!
>
> That's strange. Does it mean CPU_ZERO is broken in
> lib/librte_eal/windows/include/sched.h ?
>
I don't see any issues in CPU_ZERO.
I thinks the issue with compiler interpretation.
I also notice if we check the cpuset is null or not, also removes the warning.
But the strange thing is, it removes the warning only if we check like this -> if(!cpuset)
If we check like this -> if(cpuset != NULL), we still get the warning
More information about the dev
mailing list