return st.st_size;
}
-static inline uint32_t
-bsf64(uint64_t v)
-{
- return (uint32_t)__builtin_ctzll(v);
-}
-
static inline uint32_t
log2_u64(uint64_t v)
{
if (v == 0)
return 0;
v = rte_align64pow2(v);
- return bsf64(v);
+ return rte_bsf64(v);
}
static int
{
struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+ /* single file segments mode doesn't support individual segment fd's */
+ if (internal_config.single_file_segments)
+ return -ENOTSUP;
+
/* if list is not allocated, allocate it */
if (fd_list[list_idx].len == 0) {
int len = mcfg->memsegs[list_idx].memseg_arr.len;
return 0;
}
+int
+eal_memalloc_set_seg_list_fd(int list_idx, int fd)
+{
+ struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+
+ /* non-single file segment mode doesn't support segment list fd's */
+ if (!internal_config.single_file_segments)
+ return -ENOTSUP;
+
+ /* if list is not allocated, allocate it */
+ if (fd_list[list_idx].len == 0) {
+ int len = mcfg->memsegs[list_idx].memseg_arr.len;
+
+ if (alloc_list(list_idx, len) < 0)
+ return -ENOMEM;
+ }
+
+ fd_list[list_idx].memseg_list_fd = fd;
+
+ return 0;
+}
+
int
eal_memalloc_get_seg_fd(int list_idx, int seg_idx)
{