X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Focteontx2%2Fotx2_dev.c;h=6a84df234418b1f9be137a3616c485bc1a4bce35;hb=c8238116ece889fe356c54930bca791091ab1938;hp=d61c712fafa72f4b49974187fee5a0401d8160dc;hpb=f1ae60d696cb92d6529f37630e1f08defa4a80e3;p=dpdk.git diff --git a/drivers/common/octeontx2/otx2_dev.c b/drivers/common/octeontx2/otx2_dev.c index d61c712faf..6a84df2344 100644 --- a/drivers/common/octeontx2/otx2_dev.c +++ b/drivers/common/octeontx2/otx2_dev.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "otx2_dev.h" #include "otx2_mbox.h" @@ -34,10 +35,11 @@ mbox_mem_map(off_t off, size_t size) if (mem_fd < 0) goto error; - va = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, off); + va = rte_mem_map(NULL, size, RTE_PROT_READ | RTE_PROT_WRITE, + RTE_MAP_SHARED, mem_fd, off); close(mem_fd); - if (va == MAP_FAILED) + if (va == NULL) otx2_err("Failed to mmap sz=0x%zx, fd=%d, off=%jd", size, mem_fd, (intmax_t)off); error: @@ -48,7 +50,7 @@ static void mbox_mem_unmap(void *va, size_t size) { if (va) - munmap(va, size); + rte_mem_unmap(va, size); } static int