[dpdk-dev] [PATCH] eal/linux: fix negative value for undetermined numa_node

Matthew Hall mhall at mhcomputing.net
Mon Aug 3 07:04:41 CEST 2015


On Mon, Aug 03, 2015 at 09:46:54AM +0800, Liang, Cunming wrote:
> According to the API definition, if the socket could not be determined, a
> default of zero will take.
> The '-1' is returned when the port_id value is out of range.

Yes, but when I asked the exact same question and was told the documentation 
was wrong not the -1 return value.

> To your concern, "difference between no NUMA, something running on socket
> zero, and something with multiple sockets.".
> The latter two belongs to the same situation, that is the numa_node stores
> the NUMA id.
> So in fact the concern is about using '-1' or '0' when there's no NUMA
> detect.
> If we won't plan to redefine the API return value, the fix patch is
> reasonable.
> 
> Btw, if it returns '-1' when no NUMA is detected, what will you do, do
> condition check '-1' and then use node 0 instead ?
> In that way, you can't distinguish '-'1 is out of range port_id error or no
> NUMA detection error.

I asked that question also, and the answer I got was to use node 0 instead.

> If it is, why not follow the API definition.

Sure, if nobody objects like the last time I asked. But this will change the 
user behavior as I am looking for the -1 now.

> /Steve

Matthew.


More information about the dev mailing list