| 1007 | } |
| 1008 | |
| 1009 | static int |
| 1010 | test_alloc_socket(void) |
| 1011 | { |
| 1012 | unsigned socket_count = 0; |
| 1013 | unsigned i; |
| 1014 | |
| 1015 | if (test_alloc_single_socket(SOCKET_ID_ANY) < 0) |
| 1016 | return -1; |
| 1017 | |
| 1018 | for (i = 0; i < RTE_MAX_NUMA_NODES; i++) { |
| 1019 | if (is_mem_on_socket(i)) { |
| 1020 | socket_count++; |
| 1021 | if (test_alloc_single_socket(i) < 0) { |
| 1022 | printf("Fail: rte_malloc_socket(..., %u) did not succeed\n", |
| 1023 | i); |
| 1024 | return -1; |
| 1025 | } |
| 1026 | } |
| 1027 | else { |
| 1028 | if (test_alloc_single_socket(i) == 0) { |
| 1029 | printf("Fail: rte_malloc_socket(..., %u) succeeded\n", |
| 1030 | i); |
| 1031 | return -1; |
| 1032 | } |
| 1033 | } |
| 1034 | } |
| 1035 | |
| 1036 | /* Print warning if only a single socket, but don't fail the test */ |
| 1037 | if (socket_count < 2) { |
| 1038 | printf("WARNING: alloc_socket test needs memory on multiple sockets!\n"); |
| 1039 | } |
| 1040 | |
| 1041 | return 0; |
| 1042 | } |
| 1043 | |
| 1044 | static int |
| 1045 | test_malloc(void) |
no test coverage detected