aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/dpdk')
-rwxr-xr-xsrc/plugins/dpdk/api/dpdk_api.c1
-rwxr-xr-xsrc/plugins/dpdk/device/init.c17
-rw-r--r--src/plugins/dpdk/hqos/hqos.c1
3 files changed, 12 insertions, 7 deletions
diff --git a/src/plugins/dpdk/api/dpdk_api.c b/src/plugins/dpdk/api/dpdk_api.c
index 08afdd700ef..97c4bc75721 100755
--- a/src/plugins/dpdk/api/dpdk_api.c
+++ b/src/plugins/dpdk/api/dpdk_api.c
@@ -20,7 +20,6 @@
#include <vnet/ethernet/ethernet.h>
#include <dpdk/device/dpdk.h>
-#include <vlib/unix/physmem.h>
#include <vlib/pci/pci.h>
#include <stdio.h>
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index a795ba0e88e..e23542f7554 100755
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -17,10 +17,10 @@
#include <vppinfra/error.h>
#include <vppinfra/format.h>
#include <vppinfra/bitmap.h>
+#include <vlib/unix/unix.h>
#include <vnet/ethernet/ethernet.h>
#include <dpdk/device/dpdk.h>
-#include <vlib/unix/physmem.h>
#include <vlib/pci/pci.h>
#include <stdio.h>
@@ -1026,21 +1026,28 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
clib_bitmap_foreach (c, tm->cpu_socket_bitmap, (
{
int pages_avail, page_size, mem;
+ clib_error_t *e = 0;
vec_validate(mem_by_socket, c);
mem = mem_by_socket[c];
page_size = 1024;
- pages_avail = vlib_sysfs_get_free_hugepages(c, page_size * 1024);
+ e = vlib_sysfs_get_free_hugepages(c, page_size * 1024, &pages_avail);
- if (pages_avail < 0 || page_size * pages_avail < mem)
+ if (e != 0 || pages_avail < 0 || page_size * pages_avail < mem)
use_1g = 0;
+ if (e)
+ clib_error_free (e);
+
page_size = 2;
- pages_avail = vlib_sysfs_get_free_hugepages(c, page_size * 1024);
+ e = vlib_sysfs_get_free_hugepages(c, page_size * 1024, &pages_avail);
- if (pages_avail < 0 || page_size * pages_avail < mem)
+ if (e != 0 || pages_avail < 0 || page_size * pages_avail < mem)
use_2m = 0;
+
+ if (e)
+ clib_error_free (e);
}));
/* *INDENT-ON* */
diff --git a/src/plugins/dpdk/hqos/hqos.c b/src/plugins/dpdk/hqos/hqos.c
index 813eb91cf99..c9b85652863 100644
--- a/src/plugins/dpdk/hqos/hqos.c
+++ b/src/plugins/dpdk/hqos/hqos.c
@@ -29,7 +29,6 @@
#include <vnet/ethernet/ethernet.h>
#include <dpdk/device/dpdk.h>
-#include <vlib/unix/physmem.h>
#include <vlib/pci/pci.h>
#include <vlibmemory/api.h>
#include <vlibmemory/vl_memory_msg_enum.h> /* enumerate all vlib messages */