+
+ /* check realloc_socket part */
+ int32_t socket_count = 0, socket_allocated, socket;
+ int ret = -1;
+ size_t size = 1024;
+
+ ptr1 = NULL;
+ for (socket = 0; socket < RTE_MAX_NUMA_NODES; socket++) {
+ if (is_mem_on_socket(socket)) {
+ int j = 2;
+
+ socket_count++;
+ while (j--) {
+ /* j == 1 -> resizing */
+ ptr2 = rte_realloc_socket(ptr1, size,
+ RTE_CACHE_LINE_SIZE,
+ socket);
+ if (ptr2 == NULL) {
+ printf("NULL pointer returned from rte_realloc_socket\n");
+ goto end;
+ }
+
+ ptr1 = ptr2;
+ socket_allocated = addr_to_socket(ptr2);
+ if (socket_allocated != socket) {
+ printf("Requested socket (%d) doesn't mach allocated one (%d)\n",
+ socket, socket_allocated);
+ goto end;
+ }
+ size += RTE_CACHE_LINE_SIZE;
+ }
+ }
+ }
+
+ /* Print warnign if only a single socket, but don't fail the test */
+ if (socket_count < 2)
+ printf("WARNING: realloc_socket test needs memory on multiple sockets!\n");
+
+ ret = 0;
+end:
+ rte_free(ptr1);
+
+ return ret;