[dpdk-dev] [PATCH v1 09/15] malloc: fix the issue of SOCKET_ID_ANY

2015-01-27 Thread Liang, Cunming
> -Original Message- > From: Stephen Hemminger [mailto:stephen at networkplumber.org] > Sent: Sunday, January 25, 2015 4:05 PM > To: Liang, Cunming > Cc: dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH v1 09/15] malloc: fix the issue of > SOCKET_ID_ANY > > O

[dpdk-dev] [PATCH v1 09/15] malloc: fix the issue of SOCKET_ID_ANY

2015-01-26 Thread Stephen Hemminger
On Thu, 22 Jan 2015 16:16:32 +0800 Cunming Liang wrote: > - return rte_socket_id(); > + unsigned socket_id = rte_socket_id(); > + > + if (socket_id == (unsigned)SOCKET_ID_ANY) I prefer not casting -1 to unsigned it will cause warnings. It is better to make socket_id an integer and th

[dpdk-dev] [PATCH v1 09/15] malloc: fix the issue of SOCKET_ID_ANY

2015-01-25 Thread Stephen Hemminger
On Thu, 22 Jan 2015 16:16:32 +0800 Cunming Liang wrote: > - return rte_socket_id(); > + unsigned socket_id = rte_socket_id(); > + > + if (socket_id == (unsigned)SOCKET_ID_ANY) I prefer not casting -1 to unsigned it will cause warnings. It is better to make socket_id an integer and th

[dpdk-dev] [PATCH v1 09/15] malloc: fix the issue of SOCKET_ID_ANY

2015-01-22 Thread Cunming Liang
Add check for rte_socket_id(), avoid get unexpected return like (-1). Signed-off-by: Cunming Liang --- lib/librte_malloc/malloc_heap.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/librte_malloc/malloc_heap.h b/lib/librte_malloc/malloc_heap.h index b4aec45..a47136