From patchwork Tue Jun 7 11:48:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herakliusz Lipiec X-Patchwork-Id: 112466 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 04B94A0544; Tue, 7 Jun 2022 13:44:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D22C41611; Tue, 7 Jun 2022 13:44:46 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 41A8141153 for ; Tue, 7 Jun 2022 13:44:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654602285; x=1686138285; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OqEuCYU9F5zA73f7u2Xd3xSplPbv03hOFvIHo59hKRA=; b=gWFZgwNKXcvbz4UglTeiPIhZGqTTTb2v435wuSHooenBfjIxebdbWslJ NkEblwWx7ik8eQghKh+et3UuM9CH9AH/jnwd2/WA3dsbxaxVRXk2YTg2B 23QmrMoGFlR7rki9JT9caBJ2MwQ7IGtl+hN/LhtB0A2xchxmA8F/G8fQB oCcIb/5VK1LkB8VS7FaEyzTHiCAh/adAk/MiYaTT53d/XWFO8hXX2629k fjmvhmocj15zAvt27lEeljNTtM9yaFuDhaKZ6ZipUnMOkZl95slC0Ii21 /Wbb0fzAa73vCHeq+oEO13OY/z2IPEoHfApvdpktZtDA+fxfnOLumcyjd g==; X-IronPort-AV: E=McAfee;i="6400,9594,10370"; a="275493646" X-IronPort-AV: E=Sophos;i="5.91,283,1647327600"; d="scan'208";a="275493646" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2022 04:44:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,283,1647327600"; d="scan'208";a="609181310" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.223.138]) by orsmga008.jf.intel.com with ESMTP; 07 Jun 2022 04:44:43 -0700 From: Herakliusz Lipiec To: maxime.coquelin@redhat.com, chenbo.xia@intel.com, bruce.richardson@intel.com Cc: dev@dpdk.org, Herakliusz Lipiec Subject: [PATCH 2/3] doc: update vhost sample app docs Date: Tue, 7 Jun 2022 12:48:55 +0100 Message-Id: <20220607114856.1085803-2-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607114856.1085803-1-herakliusz.lipiec@intel.com> References: <20220607114856.1085803-1-herakliusz.lipiec@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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. .//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