Add option to link DPDK dynamically
[vpp.git] / vpp / vnet / main.c
index 03139c0..4659440 100644 (file)
 
 #include <api/vpe_msg_enum.h>
 
+#if DPDK
+#include <vnet/devices/dpdk/dpdk.h>
+#endif
+
 /** \mainpage Virtual Packet Edge Documentation
  * \section intro_sec Introduction
  * 
@@ -197,7 +201,11 @@ defaulted:
     if (clib_mem_init (0, main_heap_size)) {
         vm->init_functions_called = hash_create (0, /* value bytes */ 0);
         vpe_main_init(vm);
-#if ! DPDK
+#if DPDK
+#if !DPDK_SHARED_LIB
+       dpdk_pmd_constructor_init();
+#endif
+#else
         unix_physmem_init(vm, 0 /* fail_if_physical_memory_not_present */);
 #endif
         vlib_set_get_handoff_structure_cb (&vnet_get_handoff_structure);