From patchwork Tue Jun 21 15:20:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herakliusz Lipiec X-Patchwork-Id: 113186 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 74176A0545; Tue, 21 Jun 2022 17:16:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56F4F4281B; Tue, 21 Jun 2022 17:16:10 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 7CD2340151 for ; Tue, 21 Jun 2022 17:16:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655824569; x=1687360569; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Gr1XpefqphJJwK4Ps1oy7bZ3dQQykuILKXAF9ubQXr4=; b=fxGnfGztgULc581Hi0hmFMlbhOIBIcqBp0aZ7YxVdR1ZxTPfM2NxheO5 8tvrPYluJx6IDY/1BcREv/oDKlOJSLaXOoO/nuOG5/Gh5LwIjE1RoJDwG RnaAbxiqbMDO79qppbmIPTWpA9pF5Vn3S26XfINvKs07WKJ6xGV7ewYkZ di58R1Vvfbdgj1okoY82evvfr5n8g/Us/36sJh4zKlMwW2Q3yoo4r5bw8 861xhrfBjbIBOy7YeUqjWf1T9VPtROKPoxL5hTIpHb0BIvTGxjl8PAeyo WAG+hsyzRE/jBz+Hh/O4WMxuKKwhzxj5II8LW2whOJUFsK7B2l/cgZbWP Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="259963734" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="259963734" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 08:16:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="585314442" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.223.138]) by orsmga007.jf.intel.com with ESMTP; 21 Jun 2022 08:16:03 -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 v3 1/3] examples/vhost: update makefile to match meson build system Date: Tue, 21 Jun 2022 16:20:31 +0100 Message-Id: <20220621152033.1214568-1-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621121315.1173180-1-herakliusz.lipiec@intel.com> References: <20220621121315.1173180-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 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 Acked-by: Bruce Richardson Reviewed-by: Maxime Coquelin --- 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 From patchwork Tue Jun 21 15:20:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herakliusz Lipiec X-Patchwork-Id: 113187 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 61F4DA0545; Tue, 21 Jun 2022 17:16:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B70D42823; Tue, 21 Jun 2022 17:16:15 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 1F11540151 for ; Tue, 21 Jun 2022 17:16:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655824570; x=1687360570; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TWtZOjvgfdulp9FLeSu7vHyOF/ZMotbrbV/kw3Jq4fI=; b=C8vdBlXH6O7HdZ7NAP5ih+8tzErmWYmfre+uz9iOkybdZ83vYxyCpJqd ao9BO5pYTnhgkelDpnlYEFrsbt4BVo9s6I3rbLhnAqzcmhhBawTVeqZDL 6maxuxP3B98H30JLXd8zVRGN15u2ugzRV95zMg6ivTNc3elVPbv2EirTj SfXgny0LfmEmXc8A0bIFb6qwVcsjdKgF1DxUkDDKuGlRl9z9U+1eowh04 tHsMlYPeuDMgeTvAHgmlKzaGNB65UA7qgQqmI14dSONz/VgD7LWPF6ktw VjawuQ7JWto+esL6PhScerENS+ztoM7x7jvWwXrO3ozUPnjLZk3vIbpn0 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="259963746" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="259963746" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 08:16:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="585314473" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.223.138]) by orsmga007.jf.intel.com with ESMTP; 21 Jun 2022 08:16:06 -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 v3 2/3] doc: update vhost sample app docs Date: Tue, 21 Jun 2022 16:20:32 +0100 Message-Id: <20220621152033.1214568-2-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621152033.1214568-1-herakliusz.lipiec@intel.com> References: <20220621121315.1173180-1-herakliusz.lipiec@intel.com> <20220621152033.1214568-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 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 Reviewed-by: Chenbo Xia --- 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. .//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 From patchwork Tue Jun 21 15:20:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herakliusz Lipiec X-Patchwork-Id: 113188 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 15D8BA0545; Tue, 21 Jun 2022 17:16:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B06B42847; Tue, 21 Jun 2022 17:16:16 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 1CC8442823 for ; Tue, 21 Jun 2022 17:16:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655824572; x=1687360572; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qFnY+7C4sNN329soIo/OfUBqaz2FBjp3J6/by4K89PE=; b=FfB55M0v0aLNetNd86wMy2dxtkrG3v6zuuMKYOQK3HT6D1lEhGUA9KMX k02Y3vNazMrlD7sSbMozTFf3nzecT20bcGlX3kshoeVygQ0CdWAretiHn r0XAtVq4HmqtDK891lsPCg/E27KAFXYTCm/P5eoiJtpnHhYRFz7X1NoAz aB6/Id0F474bYAodYYkb8VUz5c5xbr2onVg+mNN4PwNxpHRvPIFj+5Ax2 ECriQ46Y+Z10OxEI0P6djFEoukX3l2ibJURoOZn7yCw0Sw3gz245cQOjP Dt+S3Lzmh58dGZG+7K3/shmUh8kp7cdLLfTCMH1eSg6daw3DwgD0evMrY w==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="259963764" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="259963764" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 08:16:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="585314485" Received: from silpixa00399499.ir.intel.com (HELO silpixa00399499.ger.corp.intel.com) ([10.237.223.138]) by orsmga007.jf.intel.com with ESMTP; 21 Jun 2022 08:16:10 -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 v3 3/3] examples/vhost: update vhost usage message Date: Tue, 21 Jun 2022 16:20:33 +0100 Message-Id: <20220621152033.1214568-3-herakliusz.lipiec@intel.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621152033.1214568-1-herakliusz.lipiec@intel.com> References: <20220621121315.1173180-1-herakliusz.lipiec@intel.com> <20220621152033.1214568-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 updating vhost usage message to be aligned with the documentation. Signed-off-by: Herakliusz Lipiec Reviewed-by: Chenbo Xia --- 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 \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); }