X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vpp%2Fvnet%2Fmain.c;h=2540083982b1524b3b3968c18db16c50310fd3f1;hb=1c80e831b728ab378949714d5059a0b5b1822a0a;hp=04ee6b7607c5060e3836cc6e3627eb0840fe0f91;hpb=01be6a0cb1d16fbad9a7d33449489b3a86a78521;p=vpp.git diff --git a/vpp/vnet/main.c b/vpp/vnet/main.c index 04ee6b7607c..2540083982b 100644 --- a/vpp/vnet/main.c +++ b/vpp/vnet/main.c @@ -12,6 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#include #include #include #include @@ -19,13 +21,9 @@ #include -/** \mainpage Virtual Packet Edge Documentation - * \section intro_sec Introduction - * - * VPE is a specific vector packet processing application, - * designed to steer packets to/from tenant virtual machines. - * - */ +#if DPDK +#include +#endif static void vpe_main_init (vlib_main_t * vm) @@ -66,30 +64,31 @@ int main (int argc, char * argv[]) #if __x86_64__ const char * msg = "ERROR: This binary requires CPU with %s extensions.\n"; #define _(a,b) \ - if (!__builtin_cpu_supports(a)) \ + if (!clib_cpu_supports_ ## a ()) \ { \ fprintf(stderr, msg, b); \ exit(1); \ } #if __AVX2__ - _("avx2", "AVX2") + _(avx2, "AVX2") #endif #if __AVX__ - _("avx", "AVX") + _(avx, "AVX") #endif #if __SSE4_2__ - _("sse4.2", "SSE4.2") + _(sse42, "SSE4.2") #endif #if __SSE4_1__ - _("sse4.1", "SSE4.1") + _(sse41, "SSE4.1") #endif #if __SSSE3__ - _("ssse3", "SSSE3") + _(ssse3, "SSSE3") #endif #if __SSE3__ - _("sse3", "SSE3") + _(sse3, "SSE3") #endif +#undef _ #endif /* @@ -195,6 +194,13 @@ 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_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); return vlib_unix_main (argc, argv); } else {