memzone: check NUMA id when reserving a zone
authorTonghao Zhang <nic@opencloud.tech>
Fri, 12 May 2017 06:03:43 +0000 (23:03 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 5 Jun 2017 16:23:34 +0000 (18:23 +0200)
commit5cf3814d9bc7a7e6c4aeadbe446f0a8cfbf9244b
tree9c05ab0eb13ef48912084e038e952ab43be569b4
parent67064d67959a75c5122aab63651f6aab3da4175c
memzone: check NUMA id when reserving a zone

If the socket_id is invalid (e.g. -2, -3), the
memzone_reserve_aligned_thread_unsafe should return the
EINVAL and not ENOMEM. To avoid it, we should check the
socket_id before calling malloc_heap_alloc.

Signed-off-by: Tonghao Zhang <nic@opencloud.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/common/eal_common_memzone.c