MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sync_memory

Function sync_memory

dpdk/lib/eal/common/eal_common_memory.c:979–1006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

977}
978
979static int
980sync_memory(void *va_addr, size_t len, bool attach)
981{
982 struct rte_memseg_list *msl;
983 int ret = 0;
984
985 if (va_addr == NULL || len == 0) {
986 rte_errno = EINVAL;
987 return -1;
988 }
989 rte_mcfg_mem_write_lock();
990
991 /* find our segment */
992 msl = malloc_heap_find_external_seg(va_addr, len);
993 if (msl == NULL) {
994 rte_errno = ENOENT;
995 ret = -1;
996 goto unlock;
997 }
998 if (attach)
999 ret = rte_fbarray_attach(&msl->memseg_arr);
1000 else
1001 ret = rte_fbarray_detach(&msl->memseg_arr);
1002
1003unlock:
1004 rte_mcfg_mem_write_unlock();
1005 return ret;
1006}
1007
1008int
1009rte_extmem_attach(void *va_addr, size_t len)

Callers 2

rte_extmem_attachFunction · 0.70
rte_extmem_detachFunction · 0.70

Calls 5

rte_mcfg_mem_write_lockFunction · 0.85
rte_fbarray_attachFunction · 0.85
rte_fbarray_detachFunction · 0.85

Tested by

no test coverage detected