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

Function test_extmem_basic

dpdk/app/test/test_external_mem.c:514–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514static int
515test_extmem_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,
516 int n_pages)
517{
518 /* register memory */
519 if (rte_extmem_register(addr, len, iova, n_pages, pgsz) != 0) {
520 printf("%s():%i: Failed to register memory\n",
521 __func__, __LINE__);
522 goto fail;
523 }
524
525 /* check if memory is accessible from EAL */
526 if (check_mem(addr, iova, pgsz, n_pages) < 0)
527 goto fail;
528
529 if (rte_extmem_unregister(addr, len) != 0) {
530 printf("%s():%i: Removing memory from heap failed\n",
531 __func__, __LINE__);
532 goto fail;
533 }
534
535 return 0;
536fail:
537 /* even if something failed, attempt to clean up */
538 rte_extmem_unregister(addr, len);
539
540 return -1;
541}
542
543/* we need to test attach/detach in secondary processes. */
544static int

Callers 1

test_external_memFunction · 0.85

Calls 4

rte_extmem_registerFunction · 0.85
rte_extmem_unregisterFunction · 0.85
check_memFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected