Show DPDK EAL cmdline args in 'show version verbose'

Change-Id: I88a8038a36e7e5060f354cd66a2532ef8c996b67
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/vnet/vnet/devices/dpdk/dpdk.h b/vnet/vnet/devices/dpdk/dpdk.h
index 2dab4ef..2a9d825 100644
--- a/vnet/vnet/devices/dpdk/dpdk.h
+++ b/vnet/vnet/devices/dpdk/dpdk.h
@@ -322,6 +322,7 @@
 
   /* Config stuff */
   u8 ** eal_init_args;
+  u8 * eal_init_args_str;
   u8 * eth_if_blacklist;
   u8 * eth_if_whitelist;
   u8 * uio_driver_name;
diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c
index 28a661f..db0b838 100644
--- a/vnet/vnet/devices/dpdk/init.c
+++ b/vnet/vnet/devices/dpdk/init.c
@@ -1436,6 +1436,11 @@
 
   vm = dm->vlib_main;
 
+  /* make copy of args as rte_eal_init tends to mess up with arg array */
+  for (i = 1; i < vec_len(dm->eal_init_args); i++)
+    dm->eal_init_args_str = format(dm->eal_init_args_str, "%s ",
+                                   dm->eal_init_args[i]);
+
   ret = rte_eal_init(vec_len(dm->eal_init_args), (char **) dm->eal_init_args);
 
   /* lazy umount hugepages */
diff --git a/vpp/app/version.c b/vpp/app/version.c
index afd1e4a..1c1f7a6 100644
--- a/vpp/app/version.c
+++ b/vpp/app/version.c
@@ -17,6 +17,8 @@
 
 #if DPDK > 0
 #include <rte_version.h>
+#include <vnet/vnet.h>
+#include <vnet/devices/dpdk/dpdk.h>
 #endif /* DPDK */
 
 static char * vpe_version_string = 
@@ -47,13 +49,16 @@
 		 vlib_cli_command_t * cmd)
 {
   vlib_cli_output (vm, "%s", vpe_version_string);
-  if (unformat (input, "verbose")){
-     vlib_cli_output (vm, "%s", vpe_dir_string);
-     vlib_cli_output (vm, "%s", vpe_compiler);
+  if (unformat (input, "verbose"))
+    {
+      vlib_cli_output (vm, "%s", vpe_dir_string);
+      vlib_cli_output (vm, "%s", vpe_compiler);
 #if DPDK > 0
-     vlib_cli_output (vm, "DPDK version is %s", rte_version());
+      vlib_cli_output (vm, "DPDK version is %s", rte_version());
+      vlib_cli_output (vm, "DPDK EAL init arguments: %v",
+                       dpdk_main.eal_init_args_str);
 #endif
-  }
+    }
   return 0;
 }