DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] examples/vhost: update makefile to match meson build system
@ 2022-06-07 11:48 Herakliusz Lipiec
  2022-06-07 11:48 ` [PATCH 2/3] doc: update vhost sample app docs Herakliusz Lipiec
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-07 11:48 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

Meson build system creates a vhost binary but Makefile
and docs reference same as vhost-switch. Updating makefile
to match meson.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
---
 examples/vhost/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index 975a5dfe40..ea64f02bb0 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -2,7 +2,7 @@
 # Copyright(c) 2010-2014 Intel Corporation
 
 # binary name
-APP = vhost-switch
+APP = dpdk-vhost
 
 # all source are stored in SRCS-y
 SRCS-y := main.c virtio_net.c
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 2/3] doc: update vhost sample app docs
  2022-06-07 11:48 [PATCH 1/3] examples/vhost: update makefile to match meson build system Herakliusz Lipiec
@ 2022-06-07 11:48 ` Herakliusz Lipiec
  2022-06-20  1:56   ` Xia, Chenbo
  2022-06-07 11:48 ` [PATCH 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-07 11:48 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

Vhost sample app documentation describes parameters that are not in the
code and ommits parameters that exist. Also switching the order of
sections on running vhost and VM, since the --client parameter in the
sample line requires a socket to be created by VM. Removing uio
references and updating with vfio-pci. Finally aligining app
name to the binary output by the meson build system.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
---
 doc/guides/sample_app_ug/vhost.rst | 73 ++++++++++++++++--------------
 1 file changed, 38 insertions(+), 35 deletions(-)

diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst
index a6ce4bc8ac..298fa90a83 100644
--- a/doc/guides/sample_app_ug/vhost.rst
+++ b/doc/guides/sample_app_ug/vhost.rst
@@ -17,10 +17,10 @@ Testing steps
 -------------
 
 This section shows the steps how to test a typical PVP case with this
-vhost-switch sample, whereas packets are received from the physical NIC
+dpdk-vhost sample, whereas packets are received from the physical NIC
 port first and enqueued to the VM's Rx queue. Through the guest testpmd's
 default forwarding mode (io forward), those packets will be put into
-the Tx queue. The vhost-switch example, in turn, gets the packets and
+the Tx queue. The dpdk-vhost example, in turn, gets the packets and
 puts back to the same physical NIC port.
 
 Build
@@ -33,18 +33,6 @@ The application is located in the ``vhost`` sub-directory.
 .. note::
    In this example, you need build DPDK both on the host and inside guest.
 
-Start the vswitch example
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. code-block:: console
-
-        ./dpdk-vhost-switch -l 0-3 -n 4 --socket-mem 1024  \
-             -- --socket-file /tmp/sock0 --client \
-             ...
-
-Check the `Parameters`_ section for the explanations on what do those
-parameters mean.
-
 .. _vhost_app_run_vm:
 
 Start the VM
@@ -66,6 +54,19 @@ Start the VM
     some specific features, a higher version might be need. Such as
     QEMU 2.7 (or above) for the reconnect feature.
 
+
+Start the vswitch example
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: console
+
+        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
+             -- --socket-file /tmp/sock0 --client \
+             ...
+
+Check the `Parameters`_ section for the explanations on what do those
+parameters mean.
+
 .. _vhost_app_run_dpdk_inside_guest:
 
 Run testpmd inside guest
@@ -77,8 +78,8 @@ could be done by:
 
 .. code-block:: console
 
-   modprobe uio_pci_generic
-   dpdk/usertools/dpdk-devbind.py -b uio_pci_generic 0000:00:04.0
+   modprobe vfio-pci
+   dpdk/usertools/dpdk-devbind.py -b vfio-pci 0000:00:04.0
 
 Then start testpmd for packet forwarding testing.
 
@@ -87,13 +88,16 @@ Then start testpmd for packet forwarding testing.
     ./<build_dir>/app/dpdk-testpmd -l 0-1 -- -i
     > start tx_first
 
+For more information about vIOMMU and NO-IOMMU and VFIO please refer to
+:doc:`/../linux_gsg/linux_drivers` section of the DPDK Getting started guide.
+
 Inject packets
 --------------
 
-While a virtio-net is connected to vhost-switch, a VLAN tag starts with
+While a virtio-net is connected to dpdk-vhost, a VLAN tag starts with
 1000 is assigned to it. So make sure configure your packet generator
 with the right MAC and VLAN tag, you should be able to see following
-log from the vhost-switch console. It means you get it work::
+log from the dpdk-vhost console. It means you get it work::
 
     VHOST_DATA: (0) mac 52:54:00:00:00:14 and vlan 1000 registered
 
@@ -146,26 +150,10 @@ The rx-retry-delay option specifies the timeout (in micro seconds) between
 retries on an RX burst, it takes effect only when rx retry is enabled. The
 default value is 15.
 
-**--dequeue-zero-copy**
-Dequeue zero copy will be enabled when this option is given. it is worth to
-note that if NIC is bound to driver with iommu enabled, dequeue zero copy
-cannot work at VM2NIC mode (vm2vm=0) due to currently we don't setup iommu
-dma mapping for guest memory.
-
-**--vlan-strip 0|1**
-VLAN strip option is removed, because different NICs have different behaviors
-when disabling VLAN strip. Such feature, which heavily depends on hardware,
-should be removed from this example to reduce confusion. Now, VLAN strip is
-enabled and cannot be disabled.
-
 **--builtin-net-driver**
 A very simple vhost-user net driver which demonstrates how to use the generic
 vhost APIs will be used when this option is given. It is disabled by default.
 
-**--dma-type**
-This parameter is used to specify DMA type for async vhost-user net driver which
-demonstrates how to use the async vhost APIs. It's used in combination with dmas.
-
 **--dmas**
 This parameter is used to specify the assigned DMA device of a vhost device.
 Async vhost-user net driver will be used if --dmas is set. For example
@@ -173,6 +161,20 @@ Async vhost-user net driver will be used if --dmas is set. For example
 device 0 enqueue operation and use DMA channel 00:04.1 for vhost device 1
 enqueue operation.
 
+**--total-num-mbufs 0-N**
+This parameter sets the number of mbufs to be allocated in mbuf pools,
+the default value is 147456. This is can be used if launch of a port fails
+due to shortage of mbufs.
+
+**--tso 0|1**
+Disables/enables TCP segment offload.
+
+**--tx-csum 0|1**
+Disables/enables TX checksum offload.
+
+**-p mask**
+Number of ports to use.
+
 Common Issues
 -------------
 
@@ -201,7 +203,8 @@ Common Issues
 
   mbuf pool size is dependent on the MAX_QUEUES configuration, if NIC's
   max queue number is larger than 128, device start will fail due to
-  insufficient mbuf.
+  insufficient mbuf. This can be adjusted using ``--total-num-mbufs``
+  parameter.
 
 * Option "builtin-net-driver" is incompatible with QEMU
 
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 3/3] examples/vhost: update vhost usage message
  2022-06-07 11:48 [PATCH 1/3] examples/vhost: update makefile to match meson build system Herakliusz Lipiec
  2022-06-07 11:48 ` [PATCH 2/3] doc: update vhost sample app docs Herakliusz Lipiec
@ 2022-06-07 11:48 ` Herakliusz Lipiec
  2022-06-20  1:59   ` Xia, Chenbo
  2022-06-10 12:05 ` [PATCH 1/3] examples/vhost: update makefile to match meson build system Bruce Richardson
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-07 11:48 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

updating vhost usage message to be aligned with the documentation.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
---
 examples/vhost/main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index c4d46de1c5..bb1aadffa9 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -601,7 +601,6 @@ us_vhost_usage(const char *prgname)
 	"		--vm2vm [0|1|2]\n"
 	"		--rx_retry [0|1] --mergeable [0|1] --stats [0-N]\n"
 	"		--socket-file <path>\n"
-	"		--nb-devices ND\n"
 	"		-p PORTMASK: Set mask for ports to be used by application\n"
 	"		--vm2vm [0|1|2]: disable/software(default)/hardware vm2vm comms\n"
 	"		--rx-retry [0|1]: disable/enable(default) retries on Rx. Enable retry if destination queue is full\n"
@@ -610,11 +609,12 @@ us_vhost_usage(const char *prgname)
 	"		--mergeable [0|1]: disable(default)/enable RX mergeable buffers\n"
 	"		--stats [0-N]: 0: Disable stats, N: Time in seconds to print stats\n"
 	"		--socket-file: The path of the socket file.\n"
-	"		--tx-csum [0|1] disable/enable TX checksum offload.\n"
-	"		--tso [0|1] disable/enable TCP segment offload.\n"
-	"		--client register a vhost-user socket as client mode.\n"
-	"		--dmas register dma channel for specific vhost device.\n"
-	"		--total-num-mbufs [0-N] set the number of mbufs to be allocated in mbuf pools, the default value is 147456.\n",
+	"		--tx-csum [0|1]: disable/enable TX checksum offload.\n"
+	"		--tso [0|1]: disable/enable TCP segment offload.\n"
+	"		--client: register a vhost-user socket as client mode.\n"
+	"		--dmas: register dma channel for specific vhost device.\n"
+	"		--total-num-mbufs [0-N]: set the number of mbufs to be allocated in mbuf pools, the default value is 147456.\n"
+	"		--builtin-net-driver: enable simple vhost-user net driver\n",
 	       prgname);
 }
 
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/3] examples/vhost: update makefile to match meson build system
  2022-06-07 11:48 [PATCH 1/3] examples/vhost: update makefile to match meson build system Herakliusz Lipiec
  2022-06-07 11:48 ` [PATCH 2/3] doc: update vhost sample app docs Herakliusz Lipiec
  2022-06-07 11:48 ` [PATCH 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
@ 2022-06-10 12:05 ` Bruce Richardson
  2022-06-21 12:11 ` Herakliusz Lipiec
  2022-06-21 12:13 ` [PATCH v2 " Herakliusz Lipiec
  4 siblings, 0 replies; 19+ messages in thread
From: Bruce Richardson @ 2022-06-10 12:05 UTC (permalink / raw)
  To: Herakliusz Lipiec; +Cc: maxime.coquelin, chenbo.xia, dev

On Tue, Jun 07, 2022 at 12:48:54PM +0100, Herakliusz Lipiec wrote:
> Meson build system creates a vhost binary but Makefile
> and docs reference same as vhost-switch. Updating makefile
> to match meson.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> ---
>  examples/vhost/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
> index 975a5dfe40..ea64f02bb0 100644
> --- a/examples/vhost/Makefile
> +++ b/examples/vhost/Makefile
> @@ -2,7 +2,7 @@
>  # Copyright(c) 2010-2014 Intel Corporation
>  
>  # binary name
> -APP = vhost-switch
> +APP = dpdk-vhost
>  
>  # all source are stored in SRCS-y
>  SRCS-y := main.c virtio_net.c
> -- 

While I see the docs are updated in the next patch, I think it would be
good to have the doc binary renames included here for completeness.

With this addition:
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 2/3] doc: update vhost sample app docs
  2022-06-07 11:48 ` [PATCH 2/3] doc: update vhost sample app docs Herakliusz Lipiec
@ 2022-06-20  1:56   ` Xia, Chenbo
  0 siblings, 0 replies; 19+ messages in thread
From: Xia, Chenbo @ 2022-06-20  1:56 UTC (permalink / raw)
  To: Lipiec, Herakliusz, maxime.coquelin, Richardson, Bruce; +Cc: dev

Hi Herakliusz,

Thanks for the clean-up! Comments inline.

> -----Original Message-----
> From: Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Sent: Tuesday, June 7, 2022 7:49 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>;
> Richardson, Bruce <bruce.richardson@intel.com>
> Cc: dev@dpdk.org; Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Subject: [PATCH 2/3] doc: update vhost sample app docs
> 
> Vhost sample app documentation describes parameters that are not in the
> code and ommits parameters that exist. Also switching the order of

Omits?

> sections on running vhost and VM, since the --client parameter in the
> sample line requires a socket to be created by VM. Removing uio
> references and updating with vfio-pci. Finally aligining app

Aligning?

> name to the binary output by the meson build system.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> ---
>  doc/guides/sample_app_ug/vhost.rst | 73 ++++++++++++++++--------------
>  1 file changed, 38 insertions(+), 35 deletions(-)
> 
> diff --git a/doc/guides/sample_app_ug/vhost.rst
> b/doc/guides/sample_app_ug/vhost.rst
> index a6ce4bc8ac..298fa90a83 100644
> --- a/doc/guides/sample_app_ug/vhost.rst
> +++ b/doc/guides/sample_app_ug/vhost.rst
> @@ -17,10 +17,10 @@ Testing steps
>  -------------
> 
>  This section shows the steps how to test a typical PVP case with this
> -vhost-switch sample, whereas packets are received from the physical NIC
> +dpdk-vhost sample, whereas packets are received from the physical NIC
>  port first and enqueued to the VM's Rx queue. Through the guest testpmd's
>  default forwarding mode (io forward), those packets will be put into
> -the Tx queue. The vhost-switch example, in turn, gets the packets and
> +the Tx queue. The dpdk-vhost example, in turn, gets the packets and
>  puts back to the same physical NIC port.
> 
>  Build
> @@ -33,18 +33,6 @@ The application is located in the ``vhost`` sub-
> directory.
>  .. note::
>     In this example, you need build DPDK both on the host and inside guest.
> 
> -Start the vswitch example
> -~~~~~~~~~~~~~~~~~~~~~~~~~
> -
> -.. code-block:: console
> -
> -        ./dpdk-vhost-switch -l 0-3 -n 4 --socket-mem 1024  \
> -             -- --socket-file /tmp/sock0 --client \
> -             ...
> -
> -Check the `Parameters`_ section for the explanations on what do those
> -parameters mean.
> -
>  .. _vhost_app_run_vm:
> 
>  Start the VM
> @@ -66,6 +54,19 @@ Start the VM
>      some specific features, a higher version might be need. Such as
>      QEMU 2.7 (or above) for the reconnect feature.
> 
> +
> +Start the vswitch example
> +~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +.. code-block:: console
> +
> +        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
> +             -- --socket-file /tmp/sock0 --client \
> +             ...
> +
> +Check the `Parameters`_ section for the explanations on what do those
> +parameters mean.
> +
>  .. _vhost_app_run_dpdk_inside_guest:
> 
>  Run testpmd inside guest
> @@ -77,8 +78,8 @@ could be done by:
> 
>  .. code-block:: console
> 
> -   modprobe uio_pci_generic
> -   dpdk/usertools/dpdk-devbind.py -b uio_pci_generic 0000:00:04.0
> +   modprobe vfio-pci
> +   dpdk/usertools/dpdk-devbind.py -b vfio-pci 0000:00:04.0
> 
>  Then start testpmd for packet forwarding testing.
> 
> @@ -87,13 +88,16 @@ Then start testpmd for packet forwarding testing.
>      ./<build_dir>/app/dpdk-testpmd -l 0-1 -- -i
>      > start tx_first
> 
> +For more information about vIOMMU and NO-IOMMU and VFIO please refer to
> +:doc:`/../linux_gsg/linux_drivers` section of the DPDK Getting started
> guide.
> +

Good note. This also makes me realize the no-iommu section there does not
work for latest kernel now. May need a patch later. 

>  Inject packets
>  --------------
> 
> -While a virtio-net is connected to vhost-switch, a VLAN tag starts with
> +While a virtio-net is connected to dpdk-vhost, a VLAN tag starts with
>  1000 is assigned to it. So make sure configure your packet generator
>  with the right MAC and VLAN tag, you should be able to see following
> -log from the vhost-switch console. It means you get it work::
> +log from the dpdk-vhost console. It means you get it work::
> 
>      VHOST_DATA: (0) mac 52:54:00:00:00:14 and vlan 1000 registered
> 
> @@ -146,26 +150,10 @@ The rx-retry-delay option specifies the timeout (in
> micro seconds) between
>  retries on an RX burst, it takes effect only when rx retry is enabled.
> The
>  default value is 15.
> 
> -**--dequeue-zero-copy**
> -Dequeue zero copy will be enabled when this option is given. it is worth
> to
> -note that if NIC is bound to driver with iommu enabled, dequeue zero copy
> -cannot work at VM2NIC mode (vm2vm=0) due to currently we don't setup
> iommu
> -dma mapping for guest memory.
> -
> -**--vlan-strip 0|1**
> -VLAN strip option is removed, because different NICs have different
> behaviors
> -when disabling VLAN strip. Such feature, which heavily depends on
> hardware,
> -should be removed from this example to reduce confusion. Now, VLAN strip
> is
> -enabled and cannot be disabled.
> -
>  **--builtin-net-driver**
>  A very simple vhost-user net driver which demonstrates how to use the
> generic
>  vhost APIs will be used when this option is given. It is disabled by
> default.
> 
> -**--dma-type**
> -This parameter is used to specify DMA type for async vhost-user net
> driver which
> -demonstrates how to use the async vhost APIs. It's used in combination
> with dmas.
> -
>  **--dmas**
>  This parameter is used to specify the assigned DMA device of a vhost
> device.
>  Async vhost-user net driver will be used if --dmas is set. For example
> @@ -173,6 +161,20 @@ Async vhost-user net driver will be used if --dmas is
> set. For example
>  device 0 enqueue operation and use DMA channel 00:04.1 for vhost device 1
>  enqueue operation.
> 
> +**--total-num-mbufs 0-N**
> +This parameter sets the number of mbufs to be allocated in mbuf pools,
> +the default value is 147456. This is can be used if launch of a port
> fails
> +due to shortage of mbufs.
> +
> +**--tso 0|1**
> +Disables/enables TCP segment offload.
> +
> +**--tx-csum 0|1**
> +Disables/enables TX checksum offload.
> +
> +**-p mask**
> +Number of ports to use.

This should be described as 'Port mask which specifies the ports to be used'

Thanks,
Chenbo

> +
>  Common Issues
>  -------------
> 
> @@ -201,7 +203,8 @@ Common Issues
> 
>    mbuf pool size is dependent on the MAX_QUEUES configuration, if NIC's
>    max queue number is larger than 128, device start will fail due to
> -  insufficient mbuf.
> +  insufficient mbuf. This can be adjusted using ``--total-num-mbufs``
> +  parameter.
> 
>  * Option "builtin-net-driver" is incompatible with QEMU
> 
> --
> 2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 3/3] examples/vhost: update vhost usage message
  2022-06-07 11:48 ` [PATCH 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
@ 2022-06-20  1:59   ` Xia, Chenbo
  0 siblings, 0 replies; 19+ messages in thread
From: Xia, Chenbo @ 2022-06-20  1:59 UTC (permalink / raw)
  To: Lipiec, Herakliusz, maxime.coquelin, Richardson, Bruce; +Cc: dev

> -----Original Message-----
> From: Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Sent: Tuesday, June 7, 2022 7:49 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>;
> Richardson, Bruce <bruce.richardson@intel.com>
> Cc: dev@dpdk.org; Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Subject: [PATCH 3/3] examples/vhost: update vhost usage message
> 
> updating vhost usage message to be aligned with the documentation.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> ---
>  examples/vhost/main.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index c4d46de1c5..bb1aadffa9 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -601,7 +601,6 @@ us_vhost_usage(const char *prgname)
>  	"		--vm2vm [0|1|2]\n"
>  	"		--rx_retry [0|1] --mergeable [0|1] --stats [0-N]\n"
>  	"		--socket-file <path>\n"
> -	"		--nb-devices ND\n"
>  	"		-p PORTMASK: Set mask for ports to be used by
> application\n"
>  	"		--vm2vm [0|1|2]: disable/software(default)/hardware
> vm2vm comms\n"
>  	"		--rx-retry [0|1]: disable/enable(default) retries on Rx.
> Enable retry if destination queue is full\n"
> @@ -610,11 +609,12 @@ us_vhost_usage(const char *prgname)
>  	"		--mergeable [0|1]: disable(default)/enable RX mergeable
> buffers\n"
>  	"		--stats [0-N]: 0: Disable stats, N: Time in seconds to
> print stats\n"
>  	"		--socket-file: The path of the socket file.\n"
> -	"		--tx-csum [0|1] disable/enable TX checksum offload.\n"
> -	"		--tso [0|1] disable/enable TCP segment offload.\n"
> -	"		--client register a vhost-user socket as client mode.\n"
> -	"		--dmas register dma channel for specific vhost
> device.\n"
> -	"		--total-num-mbufs [0-N] set the number of mbufs to be
> allocated in mbuf pools, the default value is 147456.\n",
> +	"		--tx-csum [0|1]: disable/enable TX checksum offload.\n"
> +	"		--tso [0|1]: disable/enable TCP segment offload.\n"
> +	"		--client: register a vhost-user socket as client
> mode.\n"
> +	"		--dmas: register dma channel for specific vhost
> device.\n"
> +	"		--total-num-mbufs [0-N]: set the number of mbufs to be
> allocated in mbuf pools, the default value is 147456.\n"
> +	"		--builtin-net-driver: enable simple vhost-user net
> driver\n",
>  	       prgname);
>  }
> 
> --
> 2.36.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/3] examples/vhost: update makefile to match meson build system
  2022-06-07 11:48 [PATCH 1/3] examples/vhost: update makefile to match meson build system Herakliusz Lipiec
                   ` (2 preceding siblings ...)
  2022-06-10 12:05 ` [PATCH 1/3] examples/vhost: update makefile to match meson build system Bruce Richardson
@ 2022-06-21 12:11 ` Herakliusz Lipiec
  2022-06-21 12:13 ` [PATCH v2 " Herakliusz Lipiec
  4 siblings, 0 replies; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-21 12:11 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

Meson build system creates a vhost binary but Makefile
and docs reference same as vhost-switch. Updating makefile
to match meson and the docs accordingly.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2:
 * Moving relevant doc updates here from second patch as per
   Bruces suggestion.
---
 doc/guides/sample_app_ug/vhost.rst | 10 +++++-----
 examples/vhost/Makefile            |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst
index a6ce4bc8ac..3c3cfdcd2d 100644
--- a/doc/guides/sample_app_ug/vhost.rst
+++ b/doc/guides/sample_app_ug/vhost.rst
@@ -17,10 +17,10 @@ Testing steps
 -------------
 
 This section shows the steps how to test a typical PVP case with this
-vhost-switch sample, whereas packets are received from the physical NIC
+dpdk-vhost sample, whereas packets are received from the physical NIC
 port first and enqueued to the VM's Rx queue. Through the guest testpmd's
 default forwarding mode (io forward), those packets will be put into
-the Tx queue. The vhost-switch example, in turn, gets the packets and
+the Tx queue. The dpdk-vhost example, in turn, gets the packets and
 puts back to the same physical NIC port.
 
 Build
@@ -38,7 +38,7 @@ Start the vswitch example
 
 .. code-block:: console
 
-        ./dpdk-vhost-switch -l 0-3 -n 4 --socket-mem 1024  \
+        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
              -- --socket-file /tmp/sock0 --client \
              ...
 
@@ -90,10 +90,10 @@ Then start testpmd for packet forwarding testing.
 Inject packets
 --------------
 
-While a virtio-net is connected to vhost-switch, a VLAN tag starts with
+While a virtio-net is connected to dpdk-vhost, a VLAN tag starts with
 1000 is assigned to it. So make sure configure your packet generator
 with the right MAC and VLAN tag, you should be able to see following
-log from the vhost-switch console. It means you get it work::
+log from the dpdk-vhost console. It means you get it work::
 
     VHOST_DATA: (0) mac 52:54:00:00:00:14 and vlan 1000 registered
 
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index 975a5dfe40..ea64f02bb0 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -2,7 +2,7 @@
 # Copyright(c) 2010-2014 Intel Corporation
 
 # binary name
-APP = vhost-switch
+APP = dpdk-vhost
 
 # all source are stored in SRCS-y
 SRCS-y := main.c virtio_net.c
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2 1/3] examples/vhost: update makefile to match meson build system
  2022-06-07 11:48 [PATCH 1/3] examples/vhost: update makefile to match meson build system Herakliusz Lipiec
                   ` (3 preceding siblings ...)
  2022-06-21 12:11 ` Herakliusz Lipiec
@ 2022-06-21 12:13 ` Herakliusz Lipiec
  2022-06-21 12:13   ` [PATCH v2 2/3] doc: update vhost sample app docs Herakliusz Lipiec
                     ` (3 more replies)
  4 siblings, 4 replies; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-21 12:13 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

Meson build system creates a vhost binary but Makefile
and docs reference same as vhost-switch. Updating makefile
to match meson and the docs accordingly.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2:
 * Moving relevant doc updates here from second patch as per
   Bruces suggestion.
---
 doc/guides/sample_app_ug/vhost.rst | 10 +++++-----
 examples/vhost/Makefile            |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst
index a6ce4bc8ac..3c3cfdcd2d 100644
--- a/doc/guides/sample_app_ug/vhost.rst
+++ b/doc/guides/sample_app_ug/vhost.rst
@@ -17,10 +17,10 @@ Testing steps
 -------------
 
 This section shows the steps how to test a typical PVP case with this
-vhost-switch sample, whereas packets are received from the physical NIC
+dpdk-vhost sample, whereas packets are received from the physical NIC
 port first and enqueued to the VM's Rx queue. Through the guest testpmd's
 default forwarding mode (io forward), those packets will be put into
-the Tx queue. The vhost-switch example, in turn, gets the packets and
+the Tx queue. The dpdk-vhost example, in turn, gets the packets and
 puts back to the same physical NIC port.
 
 Build
@@ -38,7 +38,7 @@ Start the vswitch example
 
 .. code-block:: console
 
-        ./dpdk-vhost-switch -l 0-3 -n 4 --socket-mem 1024  \
+        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
              -- --socket-file /tmp/sock0 --client \
              ...
 
@@ -90,10 +90,10 @@ Then start testpmd for packet forwarding testing.
 Inject packets
 --------------
 
-While a virtio-net is connected to vhost-switch, a VLAN tag starts with
+While a virtio-net is connected to dpdk-vhost, a VLAN tag starts with
 1000 is assigned to it. So make sure configure your packet generator
 with the right MAC and VLAN tag, you should be able to see following
-log from the vhost-switch console. It means you get it work::
+log from the dpdk-vhost console. It means you get it work::
 
     VHOST_DATA: (0) mac 52:54:00:00:00:14 and vlan 1000 registered
 
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index 975a5dfe40..ea64f02bb0 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -2,7 +2,7 @@
 # Copyright(c) 2010-2014 Intel Corporation
 
 # binary name
-APP = vhost-switch
+APP = dpdk-vhost
 
 # all source are stored in SRCS-y
 SRCS-y := main.c virtio_net.c
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2 2/3] doc: update vhost sample app docs
  2022-06-21 12:13 ` [PATCH v2 " Herakliusz Lipiec
@ 2022-06-21 12:13   ` Herakliusz Lipiec
  2022-06-21 12:13   ` [PATCH v2 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-21 12:13 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

Vhost sample app documentation describes parameters that are not in the
code and omits parameters that exist. Also switching the order of
sections on running vhost and VM, since the --client parameter in the
sample line requires a socket to be created by VM. Removing uio
references and updating with vfio-pci.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
---
V2:
 * Rewording portmask description as suggested by Chenbo.
---
 doc/guides/sample_app_ug/vhost.rst | 67 ++++++++++++++++--------------
 1 file changed, 35 insertions(+), 32 deletions(-)

diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst
index 3c3cfdcd2d..8e7646b805 100644
--- a/doc/guides/sample_app_ug/vhost.rst
+++ b/doc/guides/sample_app_ug/vhost.rst
@@ -33,19 +33,7 @@ The application is located in the ``vhost`` sub-directory.
 .. note::
    In this example, you need build DPDK both on the host and inside guest.
 
-Start the vswitch example
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. code-block:: console
-
-        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
-             -- --socket-file /tmp/sock0 --client \
-             ...
-
-Check the `Parameters`_ section for the explanations on what do those
-parameters mean.
-
-.. _vhost_app_run_vm:
+. _vhost_app_run_vm:
 
 Start the VM
 ~~~~~~~~~~~~
@@ -66,6 +54,19 @@ Start the VM
     some specific features, a higher version might be need. Such as
     QEMU 2.7 (or above) for the reconnect feature.
 
+
+Start the vswitch example
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: console
+
+        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
+             -- --socket-file /tmp/sock0 --client \
+             ...
+
+Check the `Parameters`_ section for the explanations on what do those
+parameters mean.
+
 .. _vhost_app_run_dpdk_inside_guest:
 
 Run testpmd inside guest
@@ -77,8 +78,8 @@ could be done by:
 
 .. code-block:: console
 
-   modprobe uio_pci_generic
-   dpdk/usertools/dpdk-devbind.py -b uio_pci_generic 0000:00:04.0
+   modprobe vfio-pci
+   dpdk/usertools/dpdk-devbind.py -b vfio-pci 0000:00:04.0
 
 Then start testpmd for packet forwarding testing.
 
@@ -87,6 +88,9 @@ Then start testpmd for packet forwarding testing.
     ./<build_dir>/app/dpdk-testpmd -l 0-1 -- -i
     > start tx_first
 
+For more information about vIOMMU and NO-IOMMU and VFIO please refer to
+:doc:`/../linux_gsg/linux_drivers` section of the DPDK Getting started guide.
+
 Inject packets
 --------------
 
@@ -146,26 +150,10 @@ The rx-retry-delay option specifies the timeout (in micro seconds) between
 retries on an RX burst, it takes effect only when rx retry is enabled. The
 default value is 15.
 
-**--dequeue-zero-copy**
-Dequeue zero copy will be enabled when this option is given. it is worth to
-note that if NIC is bound to driver with iommu enabled, dequeue zero copy
-cannot work at VM2NIC mode (vm2vm=0) due to currently we don't setup iommu
-dma mapping for guest memory.
-
-**--vlan-strip 0|1**
-VLAN strip option is removed, because different NICs have different behaviors
-when disabling VLAN strip. Such feature, which heavily depends on hardware,
-should be removed from this example to reduce confusion. Now, VLAN strip is
-enabled and cannot be disabled.
-
 **--builtin-net-driver**
 A very simple vhost-user net driver which demonstrates how to use the generic
 vhost APIs will be used when this option is given. It is disabled by default.
 
-**--dma-type**
-This parameter is used to specify DMA type for async vhost-user net driver which
-demonstrates how to use the async vhost APIs. It's used in combination with dmas.
-
 **--dmas**
 This parameter is used to specify the assigned DMA device of a vhost device.
 Async vhost-user net driver will be used if --dmas is set. For example
@@ -173,6 +161,20 @@ Async vhost-user net driver will be used if --dmas is set. For example
 device 0 enqueue operation and use DMA channel 00:04.1 for vhost device 1
 enqueue operation.
 
+**--total-num-mbufs 0-N**
+This parameter sets the number of mbufs to be allocated in mbuf pools,
+the default value is 147456. This is can be used if launch of a port fails
+due to shortage of mbufs.
+
+**--tso 0|1**
+Disables/enables TCP segment offload.
+
+**--tx-csum 0|1**
+Disables/enables TX checksum offload.
+
+**-p mask**
+Port mask which specifies the ports to be used
+
 Common Issues
 -------------
 
@@ -201,7 +203,8 @@ Common Issues
 
   mbuf pool size is dependent on the MAX_QUEUES configuration, if NIC's
   max queue number is larger than 128, device start will fail due to
-  insufficient mbuf.
+  insufficient mbuf. This can be adjusted using ``--total-num-mbufs``
+  parameter.
 
 * Option "builtin-net-driver" is incompatible with QEMU
 
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2 3/3] examples/vhost: update vhost usage message
  2022-06-21 12:13 ` [PATCH v2 " Herakliusz Lipiec
  2022-06-21 12:13   ` [PATCH v2 2/3] doc: update vhost sample app docs Herakliusz Lipiec
@ 2022-06-21 12:13   ` Herakliusz Lipiec
  2022-06-21 13:12   ` [PATCH v2 1/3] examples/vhost: update makefile to match meson build system Xia, Chenbo
  2022-06-21 15:20   ` [PATCH v3 " Herakliusz Lipiec
  3 siblings, 0 replies; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-21 12:13 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

updating vhost usage message to be aligned with the documentation.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 examples/vhost/main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index c4d46de1c5..bb1aadffa9 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -601,7 +601,6 @@ us_vhost_usage(const char *prgname)
 	"		--vm2vm [0|1|2]\n"
 	"		--rx_retry [0|1] --mergeable [0|1] --stats [0-N]\n"
 	"		--socket-file <path>\n"
-	"		--nb-devices ND\n"
 	"		-p PORTMASK: Set mask for ports to be used by application\n"
 	"		--vm2vm [0|1|2]: disable/software(default)/hardware vm2vm comms\n"
 	"		--rx-retry [0|1]: disable/enable(default) retries on Rx. Enable retry if destination queue is full\n"
@@ -610,11 +609,12 @@ us_vhost_usage(const char *prgname)
 	"		--mergeable [0|1]: disable(default)/enable RX mergeable buffers\n"
 	"		--stats [0-N]: 0: Disable stats, N: Time in seconds to print stats\n"
 	"		--socket-file: The path of the socket file.\n"
-	"		--tx-csum [0|1] disable/enable TX checksum offload.\n"
-	"		--tso [0|1] disable/enable TCP segment offload.\n"
-	"		--client register a vhost-user socket as client mode.\n"
-	"		--dmas register dma channel for specific vhost device.\n"
-	"		--total-num-mbufs [0-N] set the number of mbufs to be allocated in mbuf pools, the default value is 147456.\n",
+	"		--tx-csum [0|1]: disable/enable TX checksum offload.\n"
+	"		--tso [0|1]: disable/enable TCP segment offload.\n"
+	"		--client: register a vhost-user socket as client mode.\n"
+	"		--dmas: register dma channel for specific vhost device.\n"
+	"		--total-num-mbufs [0-N]: set the number of mbufs to be allocated in mbuf pools, the default value is 147456.\n"
+	"		--builtin-net-driver: enable simple vhost-user net driver\n",
 	       prgname);
 }
 
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH v2 1/3] examples/vhost: update makefile to match meson build system
  2022-06-21 12:13 ` [PATCH v2 " Herakliusz Lipiec
  2022-06-21 12:13   ` [PATCH v2 2/3] doc: update vhost sample app docs Herakliusz Lipiec
  2022-06-21 12:13   ` [PATCH v2 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
@ 2022-06-21 13:12   ` Xia, Chenbo
  2022-06-21 15:20   ` [PATCH v3 " Herakliusz Lipiec
  3 siblings, 0 replies; 19+ messages in thread
From: Xia, Chenbo @ 2022-06-21 13:12 UTC (permalink / raw)
  To: Lipiec, Herakliusz, maxime.coquelin, Richardson, Bruce; +Cc: dev

Hi Herakliusz,

> -----Original Message-----
> From: Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Sent: Tuesday, June 21, 2022 8:13 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>;
> Richardson, Bruce <bruce.richardson@intel.com>
> Cc: dev@dpdk.org; Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Subject: [PATCH v2 1/3] examples/vhost: update makefile to match meson
> build system
> 
> Meson build system creates a vhost binary but Makefile
> and docs reference same as vhost-switch. Updating makefile
> to match meson and the docs accordingly.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> V2:
>  * Moving relevant doc updates here from second patch as per
>    Bruces suggestion.
> ---
>  doc/guides/sample_app_ug/vhost.rst | 10 +++++-----
>  examples/vhost/Makefile            |  2 +-
>  2 files changed, 6 insertions(+), 6 deletions(-)

This patchset seems to have apply failure, please have a check.

Thanks,
Chenbo

> 
> diff --git a/doc/guides/sample_app_ug/vhost.rst
> b/doc/guides/sample_app_ug/vhost.rst
> index a6ce4bc8ac..3c3cfdcd2d 100644
> --- a/doc/guides/sample_app_ug/vhost.rst
> +++ b/doc/guides/sample_app_ug/vhost.rst
> @@ -17,10 +17,10 @@ Testing steps
>  -------------
> 
>  This section shows the steps how to test a typical PVP case with this
> -vhost-switch sample, whereas packets are received from the physical NIC
> +dpdk-vhost sample, whereas packets are received from the physical NIC
>  port first and enqueued to the VM's Rx queue. Through the guest testpmd's
>  default forwarding mode (io forward), those packets will be put into
> -the Tx queue. The vhost-switch example, in turn, gets the packets and
> +the Tx queue. The dpdk-vhost example, in turn, gets the packets and
>  puts back to the same physical NIC port.
> 
>  Build
> @@ -38,7 +38,7 @@ Start the vswitch example
> 
>  .. code-block:: console
> 
> -        ./dpdk-vhost-switch -l 0-3 -n 4 --socket-mem 1024  \
> +        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
>               -- --socket-file /tmp/sock0 --client \
>               ...
> 
> @@ -90,10 +90,10 @@ Then start testpmd for packet forwarding testing.
>  Inject packets
>  --------------
> 
> -While a virtio-net is connected to vhost-switch, a VLAN tag starts with
> +While a virtio-net is connected to dpdk-vhost, a VLAN tag starts with
>  1000 is assigned to it. So make sure configure your packet generator
>  with the right MAC and VLAN tag, you should be able to see following
> -log from the vhost-switch console. It means you get it work::
> +log from the dpdk-vhost console. It means you get it work::
> 
>      VHOST_DATA: (0) mac 52:54:00:00:00:14 and vlan 1000 registered
> 
> diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
> index 975a5dfe40..ea64f02bb0 100644
> --- a/examples/vhost/Makefile
> +++ b/examples/vhost/Makefile
> @@ -2,7 +2,7 @@
>  # Copyright(c) 2010-2014 Intel Corporation
> 
>  # binary name
> -APP = vhost-switch
> +APP = dpdk-vhost
> 
>  # all source are stored in SRCS-y
>  SRCS-y := main.c virtio_net.c
> --
> 2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3 1/3] examples/vhost: update makefile to match meson build system
  2022-06-21 12:13 ` [PATCH v2 " Herakliusz Lipiec
                     ` (2 preceding siblings ...)
  2022-06-21 13:12   ` [PATCH v2 1/3] examples/vhost: update makefile to match meson build system Xia, Chenbo
@ 2022-06-21 15:20   ` Herakliusz Lipiec
  2022-06-21 15:20     ` [PATCH v3 2/3] doc: update vhost sample app docs Herakliusz Lipiec
                       ` (3 more replies)
  3 siblings, 4 replies; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-21 15:20 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

Meson build system creates a vhost binary but Makefile
and docs reference same as vhost-switch. Updating makefile
to match meson and the docs accordingly.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2:
 * Moving relevant doc updates here from second patch as per
   Bruces suggestion.
---
 doc/guides/sample_app_ug/vhost.rst | 10 +++++-----
 examples/vhost/Makefile            |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst
index 09db965e70..e034115ce9 100644
--- a/doc/guides/sample_app_ug/vhost.rst
+++ b/doc/guides/sample_app_ug/vhost.rst
@@ -17,10 +17,10 @@ Testing steps
 -------------
 
 This section shows the steps how to test a typical PVP case with this
-vhost-switch sample, whereas packets are received from the physical NIC
+dpdk-vhost sample, whereas packets are received from the physical NIC
 port first and enqueued to the VM's Rx queue. Through the guest testpmd's
 default forwarding mode (io forward), those packets will be put into
-the Tx queue. The vhost-switch example, in turn, gets the packets and
+the Tx queue. The dpdk-vhost example, in turn, gets the packets and
 puts back to the same physical NIC port.
 
 Build
@@ -38,7 +38,7 @@ Start the vswitch example
 
 .. code-block:: console
 
-        ./dpdk-vhost-switch -l 0-3 -n 4 --socket-mem 1024  \
+        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
              -- --socket-file /tmp/sock0 --client \
              ...
 
@@ -90,10 +90,10 @@ Then start testpmd for packet forwarding testing.
 Inject packets
 --------------
 
-While a virtio-net is connected to vhost-switch, a VLAN tag starts with
+While a virtio-net is connected to dpdk-vhost, a VLAN tag starts with
 1000 is assigned to it. So make sure configure your packet generator
 with the right MAC and VLAN tag, you should be able to see following
-log from the vhost-switch console. It means you get it work::
+log from the dpdk-vhost console. It means you get it work::
 
     VHOST_DATA: (0) mac 52:54:00:00:00:14 and vlan 1000 registered
 
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index 975a5dfe40..ea64f02bb0 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -2,7 +2,7 @@
 # Copyright(c) 2010-2014 Intel Corporation
 
 # binary name
-APP = vhost-switch
+APP = dpdk-vhost
 
 # all source are stored in SRCS-y
 SRCS-y := main.c virtio_net.c
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3 2/3] doc: update vhost sample app docs
  2022-06-21 15:20   ` [PATCH v3 " Herakliusz Lipiec
@ 2022-06-21 15:20     ` Herakliusz Lipiec
  2022-07-01 13:10       ` Xia, Chenbo
  2022-07-01 13:53       ` Maxime Coquelin
  2022-06-21 15:20     ` [PATCH v3 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
                       ` (2 subsequent siblings)
  3 siblings, 2 replies; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-21 15:20 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

Vhost sample app documentation describes parameters that are not in the
code and omits parameters that exist. Also switching the order of
sections on running vhost and VM, since the --client parameter in the
sample line requires a socket to be created by VM. Removing uio
references and updating with vfio-pci.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
---
V3:
  * fix apply issues
V2:
  * Rewording portmask description as suggested by Chenbo.
---
 doc/guides/sample_app_ug/vhost.rst | 67 ++++++++++++++++--------------
 1 file changed, 35 insertions(+), 32 deletions(-)

diff --git a/doc/guides/sample_app_ug/vhost.rst b/doc/guides/sample_app_ug/vhost.rst
index e034115ce9..982e19214d 100644
--- a/doc/guides/sample_app_ug/vhost.rst
+++ b/doc/guides/sample_app_ug/vhost.rst
@@ -33,19 +33,7 @@ The application is located in the ``vhost`` sub-directory.
 .. note::
    In this example, you need build DPDK both on the host and inside guest.
 
-Start the vswitch example
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. code-block:: console
-
-        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
-             -- --socket-file /tmp/sock0 --client \
-             ...
-
-Check the `Parameters`_ section for the explanations on what do those
-parameters mean.
-
-.. _vhost_app_run_vm:
+. _vhost_app_run_vm:
 
 Start the VM
 ~~~~~~~~~~~~
@@ -66,6 +54,19 @@ Start the VM
     some specific features, a higher version might be need. Such as
     QEMU 2.7 (or above) for the reconnect feature.
 
+
+Start the vswitch example
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: console
+
+        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
+             -- --socket-file /tmp/sock0 --client \
+             ...
+
+Check the `Parameters`_ section for the explanations on what do those
+parameters mean.
+
 .. _vhost_app_run_dpdk_inside_guest:
 
 Run testpmd inside guest
@@ -77,8 +78,8 @@ could be done by:
 
 .. code-block:: console
 
-   modprobe uio_pci_generic
-   dpdk/usertools/dpdk-devbind.py -b uio_pci_generic 0000:00:04.0
+   modprobe vfio-pci
+   dpdk/usertools/dpdk-devbind.py -b vfio-pci 0000:00:04.0
 
 Then start testpmd for packet forwarding testing.
 
@@ -87,6 +88,9 @@ Then start testpmd for packet forwarding testing.
     ./<build_dir>/app/dpdk-testpmd -l 0-1 -- -i
     > start tx_first
 
+For more information about vIOMMU and NO-IOMMU and VFIO please refer to
+:doc:`/../linux_gsg/linux_drivers` section of the DPDK Getting started guide.
+
 Inject packets
 --------------
 
@@ -146,26 +150,10 @@ The rx-retry-delay option specifies the timeout (in micro seconds) between
 retries on an RX burst, it takes effect only when rx retry is enabled. The
 default value is 15.
 
-**--dequeue-zero-copy**
-Dequeue zero copy will be enabled when this option is given. it is worth to
-note that if NIC is bound to driver with iommu enabled, dequeue zero copy
-cannot work at VM2NIC mode (vm2vm=0) due to currently we don't setup iommu
-dma mapping for guest memory.
-
-**--vlan-strip 0|1**
-VLAN strip option is removed, because different NICs have different behaviors
-when disabling VLAN strip. Such feature, which heavily depends on hardware,
-should be removed from this example to reduce confusion. Now, VLAN strip is
-enabled and cannot be disabled.
-
 **--builtin-net-driver**
 A very simple vhost-user net driver which demonstrates how to use the generic
 vhost APIs will be used when this option is given. It is disabled by default.
 
-**--dma-type**
-This parameter is used to specify DMA type for async vhost-user net driver which
-demonstrates how to use the async vhost APIs. It's used in combination with dmas.
-
 **--dmas**
 This parameter is used to specify the assigned DMA device of a vhost device.
 Async vhost-user net driver will be used if --dmas is set. For example
@@ -176,6 +164,20 @@ operation. The index of the device corresponds to the socket file in order,
 that means vhost device 0 is created through the first socket file, vhost
 device 1 is created through the second socket file, and so on.
 
+**--total-num-mbufs 0-N**
+This parameter sets the number of mbufs to be allocated in mbuf pools,
+the default value is 147456. This is can be used if launch of a port fails
+due to shortage of mbufs.
+
+**--tso 0|1**
+Disables/enables TCP segment offload.
+
+**--tx-csum 0|1**
+Disables/enables TX checksum offload.
+
+**-p mask**
+Port mask which specifies the ports to be used
+
 Common Issues
 -------------
 
@@ -204,7 +206,8 @@ Common Issues
 
   mbuf pool size is dependent on the MAX_QUEUES configuration, if NIC's
   max queue number is larger than 128, device start will fail due to
-  insufficient mbuf.
+  insufficient mbuf. This can be adjusted using ``--total-num-mbufs``
+  parameter.
 
 * Option "builtin-net-driver" is incompatible with QEMU
 
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3 3/3] examples/vhost: update vhost usage message
  2022-06-21 15:20   ` [PATCH v3 " Herakliusz Lipiec
  2022-06-21 15:20     ` [PATCH v3 2/3] doc: update vhost sample app docs Herakliusz Lipiec
@ 2022-06-21 15:20     ` Herakliusz Lipiec
  2022-07-01 13:53       ` Maxime Coquelin
  2022-07-01 13:40     ` [PATCH v3 1/3] examples/vhost: update makefile to match meson build system Maxime Coquelin
  2022-07-01 13:53     ` Maxime Coquelin
  3 siblings, 1 reply; 19+ messages in thread
From: Herakliusz Lipiec @ 2022-06-21 15:20 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, bruce.richardson; +Cc: dev, Herakliusz Lipiec

updating vhost usage message to be aligned with the documentation.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 examples/vhost/main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index e7fee5aa1b..e3ea7aaddc 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -636,7 +636,6 @@ us_vhost_usage(const char *prgname)
 	"		--vm2vm [0|1|2]\n"
 	"		--rx_retry [0|1] --mergeable [0|1] --stats [0-N]\n"
 	"		--socket-file <path>\n"
-	"		--nb-devices ND\n"
 	"		-p PORTMASK: Set mask for ports to be used by application\n"
 	"		--vm2vm [0|1|2]: disable/software(default)/hardware vm2vm comms\n"
 	"		--rx-retry [0|1]: disable/enable(default) retries on Rx. Enable retry if destination queue is full\n"
@@ -645,11 +644,12 @@ us_vhost_usage(const char *prgname)
 	"		--mergeable [0|1]: disable(default)/enable RX mergeable buffers\n"
 	"		--stats [0-N]: 0: Disable stats, N: Time in seconds to print stats\n"
 	"		--socket-file: The path of the socket file.\n"
-	"		--tx-csum [0|1] disable/enable TX checksum offload.\n"
-	"		--tso [0|1] disable/enable TCP segment offload.\n"
-	"		--client register a vhost-user socket as client mode.\n"
-	"		--dmas register dma channel for specific vhost device.\n"
-	"		--total-num-mbufs [0-N] set the number of mbufs to be allocated in mbuf pools, the default value is 147456.\n",
+	"		--tx-csum [0|1]: disable/enable TX checksum offload.\n"
+	"		--tso [0|1]: disable/enable TCP segment offload.\n"
+	"		--client: register a vhost-user socket as client mode.\n"
+	"		--dmas: register dma channel for specific vhost device.\n"
+	"		--total-num-mbufs [0-N]: set the number of mbufs to be allocated in mbuf pools, the default value is 147456.\n"
+	"		--builtin-net-driver: enable simple vhost-user net driver\n",
 	       prgname);
 }
 
-- 
2.36.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH v3 2/3] doc: update vhost sample app docs
  2022-06-21 15:20     ` [PATCH v3 2/3] doc: update vhost sample app docs Herakliusz Lipiec
@ 2022-07-01 13:10       ` Xia, Chenbo
  2022-07-01 13:53       ` Maxime Coquelin
  1 sibling, 0 replies; 19+ messages in thread
From: Xia, Chenbo @ 2022-07-01 13:10 UTC (permalink / raw)
  To: Lipiec, Herakliusz, maxime.coquelin, Richardson, Bruce; +Cc: dev

> -----Original Message-----
> From: Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Sent: Tuesday, June 21, 2022 11:21 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>;
> Richardson, Bruce <bruce.richardson@intel.com>
> Cc: dev@dpdk.org; Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Subject: [PATCH v3 2/3] doc: update vhost sample app docs
> 
> Vhost sample app documentation describes parameters that are not in the
> code and omits parameters that exist. Also switching the order of
> sections on running vhost and VM, since the --client parameter in the
> sample line requires a socket to be created by VM. Removing uio
> references and updating with vfio-pci.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> ---
> V3:
>   * fix apply issues
> V2:
>   * Rewording portmask description as suggested by Chenbo.
> ---
>  doc/guides/sample_app_ug/vhost.rst | 67 ++++++++++++++++--------------
>  1 file changed, 35 insertions(+), 32 deletions(-)
> 
> diff --git a/doc/guides/sample_app_ug/vhost.rst
> b/doc/guides/sample_app_ug/vhost.rst
> index e034115ce9..982e19214d 100644
> --- a/doc/guides/sample_app_ug/vhost.rst
> +++ b/doc/guides/sample_app_ug/vhost.rst
> @@ -33,19 +33,7 @@ The application is located in the ``vhost`` sub-
> directory.
>  .. note::
>     In this example, you need build DPDK both on the host and inside guest.
> 
> -Start the vswitch example
> -~~~~~~~~~~~~~~~~~~~~~~~~~
> -
> -.. code-block:: console
> -
> -        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
> -             -- --socket-file /tmp/sock0 --client \
> -             ...
> -
> -Check the `Parameters`_ section for the explanations on what do those
> -parameters mean.
> -
> -.. _vhost_app_run_vm:
> +. _vhost_app_run_vm:
> 
>  Start the VM
>  ~~~~~~~~~~~~
> @@ -66,6 +54,19 @@ Start the VM
>      some specific features, a higher version might be need. Such as
>      QEMU 2.7 (or above) for the reconnect feature.
> 
> +
> +Start the vswitch example
> +~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +.. code-block:: console
> +
> +        ./dpdk-vhost -l 0-3 -n 4 --socket-mem 1024  \
> +             -- --socket-file /tmp/sock0 --client \
> +             ...
> +
> +Check the `Parameters`_ section for the explanations on what do those
> +parameters mean.
> +
>  .. _vhost_app_run_dpdk_inside_guest:
> 
>  Run testpmd inside guest
> @@ -77,8 +78,8 @@ could be done by:
> 
>  .. code-block:: console
> 
> -   modprobe uio_pci_generic
> -   dpdk/usertools/dpdk-devbind.py -b uio_pci_generic 0000:00:04.0
> +   modprobe vfio-pci
> +   dpdk/usertools/dpdk-devbind.py -b vfio-pci 0000:00:04.0
> 
>  Then start testpmd for packet forwarding testing.
> 
> @@ -87,6 +88,9 @@ Then start testpmd for packet forwarding testing.
>      ./<build_dir>/app/dpdk-testpmd -l 0-1 -- -i
>      > start tx_first
> 
> +For more information about vIOMMU and NO-IOMMU and VFIO please refer to
> +:doc:`/../linux_gsg/linux_drivers` section of the DPDK Getting started
> guide.
> +
>  Inject packets
>  --------------
> 
> @@ -146,26 +150,10 @@ The rx-retry-delay option specifies the timeout (in
> micro seconds) between
>  retries on an RX burst, it takes effect only when rx retry is enabled.
> The
>  default value is 15.
> 
> -**--dequeue-zero-copy**
> -Dequeue zero copy will be enabled when this option is given. it is worth
> to
> -note that if NIC is bound to driver with iommu enabled, dequeue zero copy
> -cannot work at VM2NIC mode (vm2vm=0) due to currently we don't setup
> iommu
> -dma mapping for guest memory.
> -
> -**--vlan-strip 0|1**
> -VLAN strip option is removed, because different NICs have different
> behaviors
> -when disabling VLAN strip. Such feature, which heavily depends on
> hardware,
> -should be removed from this example to reduce confusion. Now, VLAN strip
> is
> -enabled and cannot be disabled.
> -
>  **--builtin-net-driver**
>  A very simple vhost-user net driver which demonstrates how to use the
> generic
>  vhost APIs will be used when this option is given. It is disabled by
> default.
> 
> -**--dma-type**
> -This parameter is used to specify DMA type for async vhost-user net
> driver which
> -demonstrates how to use the async vhost APIs. It's used in combination
> with dmas.
> -
>  **--dmas**
>  This parameter is used to specify the assigned DMA device of a vhost
> device.
>  Async vhost-user net driver will be used if --dmas is set. For example
> @@ -176,6 +164,20 @@ operation. The index of the device corresponds to the
> socket file in order,
>  that means vhost device 0 is created through the first socket file, vhost
>  device 1 is created through the second socket file, and so on.
> 
> +**--total-num-mbufs 0-N**
> +This parameter sets the number of mbufs to be allocated in mbuf pools,
> +the default value is 147456. This is can be used if launch of a port
> fails
> +due to shortage of mbufs.
> +
> +**--tso 0|1**
> +Disables/enables TCP segment offload.
> +
> +**--tx-csum 0|1**
> +Disables/enables TX checksum offload.
> +
> +**-p mask**
> +Port mask which specifies the ports to be used
> +
>  Common Issues
>  -------------
> 
> @@ -204,7 +206,8 @@ Common Issues
> 
>    mbuf pool size is dependent on the MAX_QUEUES configuration, if NIC's
>    max queue number is larger than 128, device start will fail due to
> -  insufficient mbuf.
> +  insufficient mbuf. This can be adjusted using ``--total-num-mbufs``
> +  parameter.
> 
>  * Option "builtin-net-driver" is incompatible with QEMU
> 
> --
> 2.36.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 1/3] examples/vhost: update makefile to match meson build system
  2022-06-21 15:20   ` [PATCH v3 " Herakliusz Lipiec
  2022-06-21 15:20     ` [PATCH v3 2/3] doc: update vhost sample app docs Herakliusz Lipiec
  2022-06-21 15:20     ` [PATCH v3 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
@ 2022-07-01 13:40     ` Maxime Coquelin
  2022-07-01 13:53     ` Maxime Coquelin
  3 siblings, 0 replies; 19+ messages in thread
From: Maxime Coquelin @ 2022-07-01 13:40 UTC (permalink / raw)
  To: Herakliusz Lipiec, chenbo.xia, bruce.richardson; +Cc: dev



On 6/21/22 17:20, Herakliusz Lipiec wrote:
> Meson build system creates a vhost binary but Makefile
> and docs reference same as vhost-switch. Updating makefile
> to match meson and the docs accordingly.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> V2:
>   * Moving relevant doc updates here from second patch as per
>     Bruces suggestion.
> ---
>   doc/guides/sample_app_ug/vhost.rst | 10 +++++-----
>   examples/vhost/Makefile            |  2 +-
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 1/3] examples/vhost: update makefile to match meson build system
  2022-06-21 15:20   ` [PATCH v3 " Herakliusz Lipiec
                       ` (2 preceding siblings ...)
  2022-07-01 13:40     ` [PATCH v3 1/3] examples/vhost: update makefile to match meson build system Maxime Coquelin
@ 2022-07-01 13:53     ` Maxime Coquelin
  3 siblings, 0 replies; 19+ messages in thread
From: Maxime Coquelin @ 2022-07-01 13:53 UTC (permalink / raw)
  To: Herakliusz Lipiec, chenbo.xia, bruce.richardson; +Cc: dev



On 6/21/22 17:20, Herakliusz Lipiec wrote:
> Meson build system creates a vhost binary but Makefile
> and docs reference same as vhost-switch. Updating makefile
> to match meson and the docs accordingly.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> V2:
>   * Moving relevant doc updates here from second patch as per
>     Bruces suggestion.
> ---
>   doc/guides/sample_app_ug/vhost.rst | 10 +++++-----
>   examples/vhost/Makefile            |  2 +-
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 


Applied to dpdk-next-virtio/main.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 2/3] doc: update vhost sample app docs
  2022-06-21 15:20     ` [PATCH v3 2/3] doc: update vhost sample app docs Herakliusz Lipiec
  2022-07-01 13:10       ` Xia, Chenbo
@ 2022-07-01 13:53       ` Maxime Coquelin
  1 sibling, 0 replies; 19+ messages in thread
From: Maxime Coquelin @ 2022-07-01 13:53 UTC (permalink / raw)
  To: Herakliusz Lipiec, chenbo.xia, bruce.richardson; +Cc: dev



On 6/21/22 17:20, Herakliusz Lipiec wrote:
> Vhost sample app documentation describes parameters that are not in the
> code and omits parameters that exist. Also switching the order of
> sections on running vhost and VM, since the --client parameter in the
> sample line requires a socket to be created by VM. Removing uio
> references and updating with vfio-pci.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> ---
> V3:
>    * fix apply issues
> V2:
>    * Rewording portmask description as suggested by Chenbo.
> ---
>   doc/guides/sample_app_ug/vhost.rst | 67 ++++++++++++++++--------------
>   1 file changed, 35 insertions(+), 32 deletions(-)
> 


Applied to dpdk-next-virtio/main.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 3/3] examples/vhost: update vhost usage message
  2022-06-21 15:20     ` [PATCH v3 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
@ 2022-07-01 13:53       ` Maxime Coquelin
  0 siblings, 0 replies; 19+ messages in thread
From: Maxime Coquelin @ 2022-07-01 13:53 UTC (permalink / raw)
  To: Herakliusz Lipiec, chenbo.xia, bruce.richardson; +Cc: dev



On 6/21/22 17:20, Herakliusz Lipiec wrote:
> updating vhost usage message to be aligned with the documentation.
> 
> Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>   examples/vhost/main.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 


Applied to dpdk-next-virtio/main.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-07-01 13:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07 11:48 [PATCH 1/3] examples/vhost: update makefile to match meson build system Herakliusz Lipiec
2022-06-07 11:48 ` [PATCH 2/3] doc: update vhost sample app docs Herakliusz Lipiec
2022-06-20  1:56   ` Xia, Chenbo
2022-06-07 11:48 ` [PATCH 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
2022-06-20  1:59   ` Xia, Chenbo
2022-06-10 12:05 ` [PATCH 1/3] examples/vhost: update makefile to match meson build system Bruce Richardson
2022-06-21 12:11 ` Herakliusz Lipiec
2022-06-21 12:13 ` [PATCH v2 " Herakliusz Lipiec
2022-06-21 12:13   ` [PATCH v2 2/3] doc: update vhost sample app docs Herakliusz Lipiec
2022-06-21 12:13   ` [PATCH v2 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
2022-06-21 13:12   ` [PATCH v2 1/3] examples/vhost: update makefile to match meson build system Xia, Chenbo
2022-06-21 15:20   ` [PATCH v3 " Herakliusz Lipiec
2022-06-21 15:20     ` [PATCH v3 2/3] doc: update vhost sample app docs Herakliusz Lipiec
2022-07-01 13:10       ` Xia, Chenbo
2022-07-01 13:53       ` Maxime Coquelin
2022-06-21 15:20     ` [PATCH v3 3/3] examples/vhost: update vhost usage message Herakliusz Lipiec
2022-07-01 13:53       ` Maxime Coquelin
2022-07-01 13:40     ` [PATCH v3 1/3] examples/vhost: update makefile to match meson build system Maxime Coquelin
2022-07-01 13:53     ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).