summaryrefslogtreecommitdiffstats
path: root/src/vnf/virtio-user-ping/virtio-user.patch
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2017-08-01 11:11:01 -0700
committerGuo Ruijing <ruijing.guo@intel.com>2017-08-01 11:12:11 -0700
commitf9154df2f80bfb343b58016ad81cff5ae0b44cd3 (patch)
tree855aabc5bc097320643fedb798626ce565e0156f /src/vnf/virtio-user-ping/virtio-user.patch
parentdc766e69c0c08c55b6df2384bbcfd1e712f03160 (diff)
Add ping vnf using vhost-user & virtio-user
Change-Id: If1138e90dd5ebf3c4748dc9cc998c93bb037c4c7 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'src/vnf/virtio-user-ping/virtio-user.patch')
-rw-r--r--src/vnf/virtio-user-ping/virtio-user.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/vnf/virtio-user-ping/virtio-user.patch b/src/vnf/virtio-user-ping/virtio-user.patch
new file mode 100644
index 0000000..2504785
--- /dev/null
+++ b/src/vnf/virtio-user-ping/virtio-user.patch
@@ -0,0 +1,49 @@
+diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
+index 68c55f3..1acafcc 100755
+--- a/src/plugins/dpdk/device/init.c
++++ b/src/plugins/dpdk/device/init.c
+@@ -827,6 +827,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
+ u8 huge_dir = 0;
+ u8 file_prefix = 0;
+ u8 *socket_mem = 0;
++ u8 *virtio_user = 0;
+
+ conf->device_config_index_by_pci_addr = hash_create (0, sizeof (uword));
+ log_level = RTE_LOG_NOTICE;
+@@ -852,6 +853,17 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
+ else if (unformat (input, "no-multi-seg"))
+ conf->no_multi_seg = 1;
+
++
++ /* hardcode here for quick poc */
++ else if (unformat (input, "virtio-user %s", &virtio_user))
++ {
++ vec_add1 (conf->eal_init_args, (u8*)"-m 1024");
++ vec_add1 (conf->eal_init_args, (u8*)"--no-pci");
++ vec_add1 (conf->eal_init_args, (u8*)"--single-file");
++ tmp = format (0, "--vdev=virtio_user0,path=%s", virtio_user);
++ vec_add1 (conf->eal_init_args, (u8*)tmp);
++ }
++
+ else if (unformat (input, "dev default %U", unformat_vlib_cli_sub_input,
+ &sub_input))
+ {
+@@ -1168,18 +1180,6 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
+
+ #undef _
+
+- /* set master-lcore */
+- tmp = format (0, "--master-lcore%c", 0);
+- vec_add1 (conf->eal_init_args, tmp);
+- tmp = format (0, "%u%c", tm->main_lcore, 0);
+- vec_add1 (conf->eal_init_args, tmp);
+-
+- /* set socket-mem */
+- tmp = format (0, "--socket-mem%c", 0);
+- vec_add1 (conf->eal_init_args, tmp);
+- tmp = format (0, "%s%c", socket_mem, 0);
+- vec_add1 (conf->eal_init_args, tmp);
+-
+ /* NULL terminate the "argv" vector, in case of stupidity */
+ vec_add1 (conf->eal_init_args, 0);
+ _vec_len (conf->eal_init_args) -= 1;