* Depending on memory configuration on x86 arch, objects addresses are spread * between channels and ranks in RAM: the pool allocator will add * padding between objects. This function return the new size of the * object. */
| 87 | * object. |
| 88 | */ |
| 89 | static unsigned int |
| 90 | arch_mem_object_align(unsigned int obj_size) |
| 91 | { |
| 92 | unsigned nrank, nchan; |
| 93 | unsigned new_obj_size; |
| 94 | |
| 95 | /* get number of channels */ |
| 96 | nchan = rte_memory_get_nchannel(); |
| 97 | if (nchan == 0) |
| 98 | nchan = 4; |
| 99 | |
| 100 | nrank = rte_memory_get_nrank(); |
| 101 | if (nrank == 0) |
| 102 | nrank = 1; |
| 103 | |
| 104 | /* process new object size */ |
| 105 | new_obj_size = (obj_size + RTE_MEMPOOL_ALIGN_MASK) / RTE_MEMPOOL_ALIGN; |
| 106 | while (get_gcd(new_obj_size, nrank * nchan) != 1) |
| 107 | new_obj_size++; |
| 108 | return new_obj_size * RTE_MEMPOOL_ALIGN; |
| 109 | } |
| 110 | #else |
| 111 | static unsigned int |
| 112 | arch_mem_object_align(unsigned int obj_size) |
no test coverage detected