From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC60DA00C2; Mon, 30 May 2022 07:33:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DC0540A89; Mon, 30 May 2022 07:33:22 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 1761440A82 for ; Mon, 30 May 2022 07:33:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653888800; x=1685424800; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=j1rJvvDjI5BEZ3LJZt0wyvyrEKX7FLUqESL6oWPq828=; b=mmaMGiybcgCX43HyU5af2rw5UGIb4woykyF+MYMD2AB59pff/IaudYS5 99VcCoZGn8NYqOA38F3PJ/1pFi2wKIveU/2sPerug/R7/BYcETRASvCOA RyrRA/I53ds8WqlwD2/Ym5jTLr8YHifQyjxwK/dfn5YCbtJ8kkHpbWDey ebi9kVNhmJ9MPtt22lQQh9m6QussmyK783OxYsHdunjshw4ZOAY4KKizB 2TgXHJ7IKph+fj3X3KyzzXwaTJS189mwPygAKhhShqRrAFDhgIv2UZLdV CFhFfZdkWKPlfZSCeJmlM52Beo6JsdWQ9f8TaPGz7b9Gfe34tCM7CIFPU A==; X-IronPort-AV: E=McAfee;i="6400,9594,10362"; a="256961237" X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="256961237" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2022 22:33:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="903405644" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga005.fm.intel.com with ESMTP; 29 May 2022 22:33:18 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 29 May 2022 22:33:18 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 29 May 2022 22:33:17 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Sun, 29 May 2022 22:33:17 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Sun, 29 May 2022 22:33:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NLqSyL163j0cF6kOpLBoCnECBpldu5AXFBU3uSjU5MtRjNwlhfrg/zb5zyLAujIG8HvPiiy3KktTmtDRrZSpPL3OmlJ1G/FTZxiOQ95TY9IEHcsrArf3aRn5RXb0dFqECOlJ2u/KvOMXGoLbyJn/9U0qpwSnMLDGQ9J4Bfb5opMuQjji5A0lNeI3GqalG8TFjkJMN0Ok7I/Fk0ZJ7i5HFHqM3ZOpMeNLXwbwCFnC4QTCTQ1InbSSVoAmG9D0qehxopLvL0JMDR4oByFQKN+S13LDj/0vwey0CWMsyWe2SWctuNB8VuH8jmY0anY6ri+9d7ao4xq34RrCRDWTHtr1iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SlUuypnVEGy8tXZp9cxQowiVGlVNGFrgmsJy3Yn7AHg=; b=b+E9AtkaKpddDFQ7PrTUlqOW8YOEQdCBgX+l4FqOJ9/rd4JicjZwtclglKHqAQ0JU0xN8SmSyZ8ER+6sgaj1Sn4aIiRYvidr+BHMpFMyqu3fL89FRalIdli8rGSBpUSxrCtzFxJIz7GQFjf7vIG78MBgnMcln8YkF7YXBtxjrUFAFPHbDB3G7XpwhJJHK3cXhoTZEaYDtniAcMFSwEnv05btji68DuKLY1UaQCxNFzLx1NHo6hjxP9LjHuSuNioWUcedeLTzmNxKDRTTzJpWjBn3I8z329wCrNNebvH69x3yay8TYYjHofq0g4lYgZ4gEnJwO7orY+QN7DLtDwoqcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by DM6PR11MB4708.namprd11.prod.outlook.com (2603:10b6:5:28f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Mon, 30 May 2022 05:33:14 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::d4ff:ac50:621a:60e7]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::d4ff:ac50:621a:60e7%7]) with mapi id 15.20.5293.013; Mon, 30 May 2022 05:33:14 +0000 From: "Xia, Chenbo" To: "Richardson, Bruce" , "dev@dpdk.org" CC: Maxime Coquelin Subject: RE: [PATCH v2 1/2] doc/howto: rework section on virtio-user as exception path Thread-Topic: [PATCH v2 1/2] doc/howto: rework section on virtio-user as exception path Thread-Index: AQHYcef7rzU5m3NTzkScwnOTfBDuza02yeHw Date: Mon, 30 May 2022 05:33:14 +0000 Message-ID: References: <20220527162659.129022-1-bruce.richardson@intel.com> <20220527163643.130679-1-bruce.richardson@intel.com> In-Reply-To: <20220527163643.130679-1-bruce.richardson@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 90bd309b-f80e-4c84-54e9-08da41fde4a9 x-ms-traffictypediagnostic: DM6PR11MB4708:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: t3/pqojDVLW/CnQ0MeC2TwNHaK/ImTdJ2YG/xRrvclhe796FhKFhHV6Hf588r7idx2SZHqodJuMaIdN7fX/YHge8NAWlrkpCF8dkBEjNUXLZ3edm1dwmb5nqPvLZiD0KsHemborQiXXqR/VgEtiQTut+xnJWnfQquLlUf9c92QnWg8x1/iScpBX73Ysule4N5TrI0LhEOSsjM4HXsbJRd2RP/jHjAjDp+P4oZUGclK7Mqnp6TBrxUVpo59KySFV2xFps6vG4m3L0aFYmy/TCzhWozTZcCBwfKrKFxXI+6LjQGes5jFeBLZhteAR/Cw5nDkET323XYyL8CDntE7CQu2SLvxfaiLd2O5Fwcq4G3OI7Y8b6VBZOfmGBx1mMV0t2SUzeDZnXUAafELxcp5395EsNOwa39VIqRYrZZGJhFxU3XA92x4xa7QWae4x4U10gPIh60Bx3crQ9u7E246cXcbP4Q/dW/hIhqObQSOThIwfA6ocdagsGjijcx53vG4IUvxk1NA57sQvum6VpzN/IRBMpPzaFFNEXl4frB9Dm7p8ZWrBBY4JwUSRD2DyrELvWCKt57co29px3MVNoA2tUEtTI8LuS47DBrdmFFmV3/1yXyv00/ama2oe6N8XWdW7a1BlnvmPaJYE0InSG+uyl0uH97CtunptJZz8DhrvAi8gSrRoVEVs75Wr/xFv9RoWxiKNcujmkpiJZu0n+TFSlWt+CkBwkPj8vjoPcy+B2DPwTTmWGPmuWBkwVEQHupdfXtVreyKf5BUQhZREgKJ6ymZt5IggDz9w3le3R9jv1zJc= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(38070700005)(86362001)(316002)(186003)(2906002)(122000001)(33656002)(110136005)(53546011)(55016003)(26005)(9686003)(8676002)(66446008)(6506007)(7696005)(5660300002)(83380400001)(82960400001)(64756008)(30864003)(66946007)(4326008)(8936002)(76116006)(66556008)(71200400001)(52536014)(66476007)(38100700002)(508600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9eNMjcXBIdihEQAgcAjfUGsMZdZohhTuEaUu9boxJWNFZVoGSvnnI4MV50jl?= =?us-ascii?Q?1ISKYut9Lc3/dpDdEi8ZNg/SGPNmEbzPqlDOzAciqHCt8glSFkwhrsDen8Zz?= =?us-ascii?Q?LOaed5Y8pD5WsyGtAwtkvT56K9Cd9arxqEcTaxyMUZDHWz5rpG4lIP8PwQYn?= =?us-ascii?Q?Jb7R6XBgK2FQtSNvP0sSCa+0qOSTYcZyTqiNI6i2GeTBq8lVNbExoiL3j9L0?= =?us-ascii?Q?RzZexcpabUMTh07Yo+SyvFOo//Tyj7G/3OoVelBt4fkkAYh8hz4frtSB/TJ2?= =?us-ascii?Q?Tuh7WZXA1J0/Z49PFBfW5yTTRT3qXlny7TB4X3R7hXfU1pfsfKWq0TJa0mEK?= =?us-ascii?Q?HoSvovR/t3788kJTrwtWgEMynmNfyfmnGZJOSiftJAqXJZErcv8GFtUxVl8f?= =?us-ascii?Q?AkulyPeYP1h4YNYXHJ7GCe0OKV5t88nHe2ZDwBsXFzY+OzX/pa+kwH7pMnLp?= =?us-ascii?Q?pz23H3cSIlpyTzWQJQNR7B5ThqccJ4GD4zqLtPC40yiAqny+fAanjQXsCIyO?= =?us-ascii?Q?iWWROoyzNKJzGva8QpxrVHvVC7K4zUKCnikN1fRs8tR9vr9glqvh4zY8Rqse?= =?us-ascii?Q?wLT7DDTvHUTKN08HPEFOpHQEZNMmDOZc65PfIYL9uitbYs1+uc60OB758hTI?= =?us-ascii?Q?hTuxQAHGdYt2zhntTohBFGKRozDhHgN4Y922BiM46BW2njoM+m+UsaRJvzzk?= =?us-ascii?Q?7Zq1wiCE9/gi9jXrmHSU6krEeeOGHv7m1xMx0Jh1i2IxU0WLDTEhhkwp4UMP?= =?us-ascii?Q?I+lrDCUUAjtPTRyQtvim7C1V9t1COnjNt4QkQhoEXdWaUU2KDhYtbpCWxSmg?= =?us-ascii?Q?Y64f+1ARQQxBAHQfm5TSoqmiHUq/1R7I/fsP3Jx54CP9SQdFZduL43HJU2uc?= =?us-ascii?Q?x3Jn4clFB3yzLlyfhfxMWF+VPzV11Tw3wyNUGEoARMbJRSnACswd62fMuEof?= =?us-ascii?Q?3DcRzrQVfiOTlPvoE+MqFjhigsPEnuxHCkbQAQVskYGdb+V6w5l0hR6tryVx?= =?us-ascii?Q?+hVM3ClqHgX2nTEjIhsITLQo3l1uKp2Opuunp69QGtvKMW70nQeWaAEGW690?= =?us-ascii?Q?0hS6IlGcF6n03AASwj3aVb4SypSjLXALAs0ZKcniBS8wcDKzajFIUiWL3hai?= =?us-ascii?Q?auflKsfJyJe/gAj9eKFnmXDb4YGtQLDPwlvgx1+vLPZCKXY6lK5LjcpM5f0X?= =?us-ascii?Q?vK3Yo7e/D1G0c+AAwDmTGJxRdOQTQ/CvhZ5ED5W5zqSZ3OVTrQmX9zb9/wsa?= =?us-ascii?Q?dnjvTYajvqo+TtFgDvSpjvB39h8mIY7acKOv4vRjkt8zq8nFKt+Ai9SAPTvb?= =?us-ascii?Q?TPtYdaJNPgues/5Ts1zR3p4PRcKVSgNEcQSTroPWO0n/s5zggU73QyKhlAF8?= =?us-ascii?Q?6a0Ou9LtSaPSYDLRJ17a0DWpCX+GfZR3fSp8km+ByI4ejJfx9ooX+96RO9gf?= =?us-ascii?Q?TyNECKUzJzqT+q/AdBB/8ZEBaiYDNr/m5/x5Cc5TI08CXYoRyGE86S4L+dwv?= =?us-ascii?Q?OBkllFZpit3qGktryzSh4UwPcfpgrRzNNndLUiWNIZ1MYKC/+xUdXegH5FpD?= =?us-ascii?Q?o8bViHexCYm+6Lz8b2WHVTC3pkFfJl/AZ1iRIXrSuoVJDWJ6xLASvsvp/lyA?= =?us-ascii?Q?aSULx/m4EjdQaaoUxiXWDuEYBqWoLk/7h0lC/eV7nC+KTruYj9lRAOvkD12b?= =?us-ascii?Q?Drvm8b62vJlikblqvFt6GkA5dlQh5QIYcQnsUpVRDi7uWLKl0AzRi7bqyVeg?= =?us-ascii?Q?dOrD5AHiRg=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90bd309b-f80e-4c84-54e9-08da41fde4a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2022 05:33:14.4555 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SaJmLlplF8dMeNBfvsZ1ZnQQ56U0gPqgnjIYu5a+uXOgJ026DyywmBZBjQ5LxRz3n6ff3CIPXHhALeoMn/OZIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4708 X-OriginatorOrg: intel.com 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 Hi Bruce, > -----Original Message----- > From: Richardson, Bruce > Sent: Saturday, May 28, 2022 12:37 AM > To: dev@dpdk.org > Cc: Maxime Coquelin ; Xia, Chenbo > ; Richardson, Bruce > Subject: [PATCH v2 1/2] doc/howto: rework section on virtio-user as > exception path >=20 > This patch extensively reworks the howto guide on using virtio-user for > exception packets. Changes include: >=20 > * rename "exceptional path" to "exception path" > * remove references to uio and just reference vfio-pci > * simplify testpmd command-lines, giving a basic usage example first > before adding on detail about checksum or TSO parameters > * give a complete working example showing traffic flowing through the > whole system from a testpmd loopback using the created TAP netdev > * replace use of "ifconfig" with Linux standard "ip" command > * other general rewording. >=20 > Signed-off-by: Bruce Richardson >=20 > --- > v2: fix checkpatch warnings > --- > .../howto/virtio_user_as_exceptional_path.rst | 159 +++++++++++------- I agree with the renaming. And should we rename this file, and if possible,= the attached img too.=20 > 1 file changed, 100 insertions(+), 59 deletions(-) >=20 > diff --git a/doc/guides/howto/virtio_user_as_exceptional_path.rst > b/doc/guides/howto/virtio_user_as_exceptional_path.rst > index ec021af399..100376c32d 100644 > --- a/doc/guides/howto/virtio_user_as_exceptional_path.rst > +++ b/doc/guides/howto/virtio_user_as_exceptional_path.rst > @@ -3,116 +3,157 @@ >=20 > .. _virtio_user_as_exceptional_path: >=20 > -Virtio_user as Exceptional Path > -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > +Virtio_user as Exception Path > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >=20 > -The virtual device, virtio-user, was originally introduced with vhost- > user > -backend, as a high performance solution for IPC (Inter-Process > Communication) > +.. note:: > + > + This solution is only applicable to Linux systems. > + > +The virtual device, virtio-user, was originally introduced with the > vhost-user > +backend as a high performance solution for IPC (Inter-Process > Communication) > and user space container networking. >=20 > -Virtio_user with vhost-kernel backend is a solution for exceptional path= , > -such as KNI which exchanges packets with kernel networking stack. This > -solution is very promising in: > +Beyond this originally intended use, virtio-user can be used in > conjunction with the vhost-kernel > +backend as a solution for dealing with exception path packets which need > to be injected into the > +Linux kernel for processing there. > +In this regard, virtio-user and vhost in kernel space are an alternative > to DPDK KNI for > +transferring packets between a DPDK packet processing application and th= e > kernel stack. > + > +This solution has a number of advantages over alternatives such as KNI: >=20 > * Maintenance >=20 > All kernel modules needed by this solution, vhost and vhost-net > (kernel), > - are upstreamed and extensively used kernel module. > + are upstreamed and extensively used. >=20 > * Features >=20 > - vhost-net is born to be a networking solution, which has lots of > networking > - related features, like multi queue, tso, multi-seg mbuf, etc. > + vhost-net is designed to be a networking solution, and, as such, has > lots of networking > + related features, such as multi queue support, TSO, multi-segment > buffer support, etc. >=20 > * Performance >=20 > - similar to KNI, this solution would use one or more kthreads to > - send/receive packets to/from user space DPDK applications, which has > little > - impact on user space polling thread (except that it might enter into > kernel > - space to wake up those kthreads if necessary). > + similar to KNI, this solution would uses one or more kthreads to > + send/receive packets to/from user space DPDK applications, which > minimises the impact > + on the polling DPDK threads. >=20 > -The overview of an application using virtio-user as exceptional path is > shown > +The overview of an application using virtio-user as exception path is > shown > in :numref:`figure_virtio_user_as_exceptional_path`. >=20 > .. _figure_virtio_user_as_exceptional_path: >=20 > .. figure:: img/virtio_user_as_exceptional_path.* >=20 > - Overview of a DPDK app using virtio-user as exceptional path > + Overview of a DPDK app using virtio-user as exception path > + >=20 > +Example Usage With Testpmd > +--------------------------- >=20 > -Sample Usage > ------------- > +.. note:: > + > + These instruction assume that the vhost/vhost-net kernel modules are > available and have already > + been loaded into the running kernel. > + It also assumes that the DPDK virtio driver has not been disabled in > the DPDK build. >=20 > -As a prerequisite, the vhost/vhost-net kernel CONFIG should be chosen > before > -compiling the kernel and those kernel modules should be inserted. > +To run a simple test of virtio-user as exception path using testpmd: >=20 > -#. Compile DPDK and bind a physical NIC to igb_uio/uio_pci_generic/vfio= - > pci. > +#. Compile DPDK and bind a NIC to vfio-pci as documented > in :ref:`linux_gsg_linux_drivers`. >=20 > - This physical NIC is for communicating with outside. > + This physical NIC is for communicating with the outside world, > + and serves as a packet source in this example. >=20 > -#. Run testpmd. > +#. Run testpmd to forward packets from NIC to kernel, > + passing in a suitable list of logical cores to run on (``- > l``.parameter), This '.' should be a space? Overall, the changes LGTM. Thanks! Chenbo > + and optionally the PCI address of the physical NIC to use (``-a`` > parameter). > + The virtio-user device for interfacing to the kernel is specified vi= a > a ``-vdev`` argument, > + taking the parameters described below. >=20 > .. code-block:: console >=20 > - $(testpmd) -l 2-3 -n 4 \ > - --vdev=3Dvirtio_user0,path=3D/dev/vhost-net,queue_size=3D1024 \ > - -- -i --tx-offloads=3D0x0000002c --enable-lro \ > - --txd=3D1024 --rxd=3D1024 > + /path/to/dpdk-testpmd -l -a \ > + --vdev=3Dvirtio_user0,path=3D/dev/vhost- > net,queues=3D1,queue_size=3D1024 >=20 > - This command runs testpmd with two ports, one physical NIC to > communicate > - with outside, and one virtio-user to communicate with kernel. > + * ``path`` >=20 > -* ``--enable-lro`` > + The path to the kernel vhost-net device. >=20 > - This is used to negotiate VIRTIO_NET_F_GUEST_TSO4 and > - VIRTIO_NET_F_GUEST_TSO6 feature so that large packets from kernel ca= n > be > - transmitted to DPDK application and further TSOed by physical NIC. > + * ``queue_size`` >=20 > -* ``queue_size`` > + 256 by default. To avoid shortage of descriptors, we can increase > it to 1024. >=20 > - 256 by default. To avoid shortage of descriptors, we can increase it > to 1024. > + * ``queues`` >=20 > -* ``queues`` > + Number of virt-queues. Each queue will be served by a kthread. >=20 > - Number of multi-queues. Each queue will be served by a kthread. For > example: > +#. Once testpmd is running, a new network interface - called ``tap0`` by > default - > + will be present on the system. > + This should be configured with an IP address and then enabled for use= : >=20 > .. code-block:: console >=20 > - $(testpmd) -l 2-3 -n 4 \ > - --vdev=3Dvirtio_user0,path=3D/dev/vhost- > net,queues=3D2,queue_size=3D1024 \ > - -- -i --tx-offloads=3D0x0000002c --enable-lro \ > - --txq=3D2 --rxq=3D2 --txd=3D1024 --rxd=3D1024 > + ip addr add 192.168.1.1/24 dev tap0 > + ip link set dev tap0 up >=20 > -#. Enable Rx checksum offloads in testpmd: > +#. To observe packet forwarding through the kernel, > + a second testpmd instance can be run on the system, > + taking packets from the kernel using an ``af_packet`` socket on the > ``tap0`` interface. >=20 > - .. code-block:: console > + .. code-block:: console >=20 > - (testpmd) port stop 0 > - (testpmd) port config 0 rx_offload tcp_cksum on > - (testpmd) port config 0 rx_offload udp_cksum on > - (testpmd) port start 0 > + /path/to/dpdk-testpmd -l --vdev=3Dnet_af_packet0,iface=3D= tap0 > --in-memory --no-pci >=20 > -#. Start testpmd: > + When running this instance, > + we can use ``--in-memory`` flag to avoid hugepage naming conflicts > with the previous instance, > + and we also use ``--no-pci`` flag to only use the ``af_packet`` > interface for all traffic forwarding. >=20 > - .. code-block:: console > +#. Running traffic into the system through the NIC should see that > traffic returned back again, > + having been forwarded through both testpmd instances. > + This can be confirmed by checking the testpmd statistics on testpmd > exit. >=20 > - (testpmd) start > +For more advanced use of virtio-user with testpmd in this scenario, > +some other more advanced options may also be used. > +For example: >=20 > -#. Configure IP address and start tap: > +* ``--tx-offloads=3D0x02c`` > + > + This testpmd option enables TX offloads for UDP and TCP checksum on > transmit, > + as well as TCP TSO support. > + The list of the offload flag values can be seen in header > `rte_ethdev.h > + `_. > + > +* ``--enable-lro`` > + > + This testpmd option is used to negotiate VIRTIO_NET_F_GUEST_TSO4 and > + VIRTIO_NET_F_GUEST_TSO6 feature so that large packets from the kerne= l > can be > + transmitted to the DPDK application and further TSOed by physical NI= C. > + If unsupported by the physical NIC, errors may be reported by testpm= d > with this option. > + > + > +* Enabling Rx checksum offloads for physical port: > + > + Within testpmd, you can enable and disable offloads on a per-port > basis, > + rather than enabling them for both ports. > + For the physical NIC, it may be desirable to enable checksum offload > on packet RX. > + This may be done as below, if testpmd is run with ``-i`` flag for > interactive mode. >=20 > .. code-block:: console >=20 > - ifconfig tap0 1.1.1.1/24 up > + testpmd> port stop 0 > + testpmd> port config 0 rx_offload tcp_cksum on > + testpmd> port config 0 rx_offload udp_cksum on > + testpmd> port start 0 >=20 > -.. note:: > +* Multiple queue support >=20 > - The tap device will be named tap0, tap1, etc, by kernel. > + Better performance may be achieved by using multiple queues, > + so that multiple kernel threads are handling the traffic on the > kernel side. > + For example, to use 2 queues on both NIC and virtio ports, > + while also enabling TX offloads and LRO support: >=20 > -Then, all traffic from physical NIC can be forwarded into kernel stack, > and all > -traffic on the tap0 can be sent out from physical NIC. > + .. code-block:: console >=20 > -Limitations > ------------ > + /path/to/dpdk-testpmd --vdev=3Dvirtio_user0,path=3D/dev/vhost- > net,queues=3D2,queue_size=3D1024 -- \ > + -i --tx-offloads=3D0x002c --enable-lro --txq=3D2 --rxq=3D2 -= - > txd=3D1024 --rxd=3D1024 >=20 > -This solution is only available on Linux systems. > -- > 2.34.1