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 7BE70A00C2 for ; Mon, 16 May 2022 15:26:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7526942830; Mon, 16 May 2022 15:26:53 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 2503340A7D; Mon, 16 May 2022 15:26:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652707611; x=1684243611; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Juw6/yhvmHSWkS+UKG0DRH0H8gWYjiZDw9uooaidNEg=; b=g+VSB9zD3loUhEe1EAw/yb9NhvjVvj7YhjntVzH4ZVYnqIKWWyHB4jag u3jyHZ32ymorFsCrZZlDnutFwKwQ3ofvqELnhP9ZdYovpbeZz9zA4TC1t US+MVFRbFA752+NelXIzQirr/eHHN0qFf3/zuUEnw8MLc8fc1+4Z1251G pgBHcdq+tmF7wCahB2FgdJoUX25Yse7zzy5qTPEJr3n7t2Z+UAoypWC6F GYj23+yyJafbQKRbuBdBclqVjot4ukenvKXNTkJoaLpXSFtJIK1+peGwV FdQLH4ZrSngNhE0uFKT/LvcJb2XLidSjJAv392eAiLrMgIssCfRb/YTnY g==; X-IronPort-AV: E=McAfee;i="6400,9594,10348"; a="331454589" X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="331454589" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2022 06:26:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="522444856" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 16 May 2022 06:26:46 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 16 May 2022 06:26:45 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 16 May 2022 06:26:45 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 16 May 2022 06:26:45 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 16 May 2022 06:26:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mqShBKNt4LnlA4kp8ydfDMbXEXRFOPDlzNvUmb1MAWQuEcnJwrSYIA2xPxLzeaqOdlJaIsLIB8YItcxgy4UASWpGAlB+YN+9F6u6jP5sxUZdhmwXN75eO8IhN22Mt4qUx6EWhnnfNfHvy+B0JSugG1brqu0klJKAvzwndE4AM8sd2lv1J6ZthNexvRaxKNA4NHeOcLBhiWBiAn/IkXrv/qBN6E7XbIVAlsdNekAl26V9ka+1T1+Om+dq/zlxLfMAIC71mnq/GUb9s3KS+b9ud3oo1BEYxors7IHIl46kBgAbEoXI8WABYkmy1CMuksd0ODGH8DWiMmB0MmmR93W6LQ== 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=ixG91xJ3yj40XaWzK2rKo+i80QuvVxpoGDBk8yFDkQs=; b=PdEwMEtHRET9c2d7wLobgAelGKwmp9ZKXu0J+PECaat1lT9s4HZuEJ4O7f6R+OzEH2gXXrRKWgKWgsj7klDfrWNNUF1SSnRHl+RHhrJ0lvdvEAUeN56y50A+jadTOsZr1YWslMkTzE4PiYjBy25XL+e+0szvpuUFL2dFYE3QZhGLU9RhAADUkj+et0Aklpmzbf3icZiCSCVMBE2GIfhJx2gslwSZtKjOkB0n8VAojF/1FOJTZjCQpm04D13D5b15g1GPqWXIuRtPkugOZCPRGXu3ohu0XS42TTWE3eiaFamD1YOf+H/7KcIXEYoqWu6i/xE41vRFo7cFsZBFY+y6Dw== 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 DM5PR11MB1515.namprd11.prod.outlook.com (2603:10b6:4:11::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.18; Mon, 16 May 2022 13:26:43 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54e1:e802:17c8:93f]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54e1:e802:17c8:93f%7]) with mapi id 15.20.5250.018; Mon, 16 May 2022 13:26:43 +0000 From: "Xia, Chenbo" To: Maxime Coquelin , "dev@dpdk.org" , "jasowang@redhat.com" , "david.marchand@redhat.com" , "olivier.matz@6wind.com" CC: "stable@dpdk.org" Subject: RE: [PATCH 3/6] net/vhost: enable compliant offloading mode Thread-Topic: [PATCH 3/6] net/vhost: enable compliant offloading mode Thread-Index: AQHYYGrKkLgPAa4ijkikdyYhPjI7ia0hj+Fw Date: Mon, 16 May 2022 13:26:43 +0000 Message-ID: References: <20220505102729.821075-1-maxime.coquelin@redhat.com> <20220505102729.821075-4-maxime.coquelin@redhat.com> In-Reply-To: <20220505102729.821075-4-maxime.coquelin@redhat.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: b3ff147a-d50b-4513-7eb5-08da373fb80f x-ms-traffictypediagnostic: DM5PR11MB1515:EE_ 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: o4v99XECjHRPerI7yyRSEvA8Zq3+a25VuNPfoOzsb2pyoxIYsIaIR/13tVHKjxPRKEFsrqsprocd1IUTMWAbVBosQ9LLLbPoFFCAaLki1xNvF47uxO+YZnG99+FquX4oJzyKxLKPIKQlUPtvPY1tcP/lKobjjHQhVSklielKUP6ZMiyfq+uxp7lvSAU2KoCmg6ktPJ/Iwr03cbVVVT6dBsGgI3dwzhm0rTrSz3WIIEti7rKn5jc6udoCas+0H2MJ+PED42U3PihwRHXz8jIUFiK4k2UMC3lPslHfrRrZJCp3ixad8PdUQYkkhFbAqOt7Lf8wVQvKWXkNxDQrm3g+Q8wbNwXgCZJ2zz7mZqvD12WBcziWzKC3UH327LeK0yMMt1POdzFdx3lzldeOMWIr463EYycvyLrCIXd0ZciJ6BhitwWFrNNbntl9+iiqcJ1V7XKXCPlyDLSo8WRegMlqlykcJO/akLIKt6JuFu18tMqVajkmT8+Waxz+aruA20qz7emhNJ3pT6L6FL9rJhfOlopMJuk72odpZnKGsIYcn4MjyMppzQOEMnGTnRbCBUmQLSCji5KcAoAsLskHP+ltQV7HxtRoKFtvElsGw7ZouavY8bJ5IMAKPIoY7IRXuipwxftcOWSXwEfgJhgXuBsDJhV2iSpqPnqTJIop1rtff4DILXgZ1oRhO8wkO7vLjtEOLgtI9TKZTmVMKNqaC4ggqg== 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)(110136005)(33656002)(66556008)(66476007)(66946007)(52536014)(508600001)(86362001)(83380400001)(4326008)(316002)(64756008)(55016003)(8676002)(82960400001)(38100700002)(38070700005)(6506007)(66446008)(76116006)(53546011)(122000001)(2906002)(186003)(71200400001)(5660300002)(26005)(8936002)(7696005)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7H+QuqD7yDzgVEpNlsuxPAGYBuFPfMoM2gXKV8GgNwGrh4dyfk7z3IKok+Th?= =?us-ascii?Q?KJRLiFtC/G6O356ySioyXJKAKMhEKKfV+o2F8ZMTwgPlFQx1JWm2CX8DfOaX?= =?us-ascii?Q?MAMZWwCX5P871oJF/5OTyMrFnMfB2fdw/zQiJr2U3O3QR4uecVecrxgLIpGx?= =?us-ascii?Q?/4VtSCbBf9XFy1+lPTTaU+YigaZ1498eG/k0Wsb/x3rp/XIN4IyfPPbP6AdZ?= =?us-ascii?Q?M3V8yxO160EotusoaVhUU37cE3DlvRK8HVnSH3LEd+L7zA8ZvV5F8MXuyMXA?= =?us-ascii?Q?69xqdbsSd7l5OJ+fEJFWuD5q6TIN9DbvEXupbLm+yfrjdrhSZCZAdJo6e22k?= =?us-ascii?Q?9wJ/MeuKsVFf1uMM2VtAQlnfuaZ7k0n++Limgal+bvEmnUuBnREY2YKtJc0q?= =?us-ascii?Q?kFBKHlockIh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JsSzNX4?= =?us-ascii?Q?Ja+at7jmxkdLDp0Bp4BVQ/7rX4lFCoeIOqk/5KPUmLfXtMoz/jPkG4bpZ+AX?= =?us-ascii?Q?u7EWvoAqYOBIIr/Svmtht0nMnut9ef7IuUfoIC9GWIpfF5lbi20Phl0UxtsG?= =?us-ascii?Q?MVW5Z4fkUHGfH/ndq7aYLuk8HKx8anvycqPXiFEt74m15lujUgkNNau47JL9?= =?us-ascii?Q?C3jQmQBZTdv37r5bH2ufaTursGyBJpKgDM0clL/HUSLpnXwqXKRSICylsT4d?= =?us-ascii?Q?0fjO8klS1i1op5rq4SO05oO8rq3SycbsMKVj3fBcEE6RdcAmejrjlFB7TnJb?= =?us-ascii?Q?fQUxVl1hHEQt5tz2qTjjCEBJ8ew5oPxgUrxmB0psVXlCTsF2IVxU11DWtcqt?= =?us-ascii?Q?d4aWgKgw+JrOKagTsi23ygdiV44KU2HunTJuyQst0hbL7SQOg0Wa51sGZtYR?= =?us-ascii?Q?b/WJaAb3/Q=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: b3ff147a-d50b-4513-7eb5-08da373fb80f X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2022 13:26:43.6368 (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: nBNUP9Kf4RG6940omwnobMBZroLo59YIGMFSdjJ57VTUUeECPK/5egFhJ0aUK1jYinvokK8ezEcebYWUBmY9mA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB1515 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi Maxime, > -----Original Message----- > From: Maxime Coquelin > Sent: Thursday, May 5, 2022 6:27 PM > To: dev@dpdk.org; jasowang@redhat.com; Xia, Chenbo = ; > david.marchand@redhat.com; olivier.matz@6wind.com > Cc: stable@dpdk.org; Maxime Coquelin > Subject: [PATCH 3/6] net/vhost: enable compliant offloading mode >=20 > This patch enables the compliant offloading flags mode by > default, which prevents the Rx path to set Tx offload flags, > which is illegal. A new legacy-ol-flags devarg is introduced > to enable the legacy behaviour. >=20 > Signed-off-by: Maxime Coquelin > --- > doc/guides/nics/vhost.rst | 6 ++++++ > drivers/net/vhost/rte_eth_vhost.c | 19 ++++++++++++++++--- > 2 files changed, 22 insertions(+), 3 deletions(-) >=20 > diff --git a/doc/guides/nics/vhost.rst b/doc/guides/nics/vhost.rst > index ee802ec4a8..d7c0e2ade8 100644 > --- a/doc/guides/nics/vhost.rst > +++ b/doc/guides/nics/vhost.rst > @@ -64,6 +64,12 @@ The user can specify below arguments in `--vdev` optio= n. > It is used to enable external buffer support in vhost library. > (Default: 0 (disabled)) >=20 > +#. ``legacy-ol-flags``: > + > + It is used to restore legacy behavior for offloading that was not > + compliant with offloading API. > + (Default: 0 (disabled)) > + > Vhost PMD event handling > ------------------------ >=20 > diff --git a/drivers/net/vhost/rte_eth_vhost.c > b/drivers/net/vhost/rte_eth_vhost.c > index 070f0e6dfd..0a2e8d9b29 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -31,9 +31,10 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM}; > #define ETH_VHOST_CLIENT_ARG "client" > #define ETH_VHOST_IOMMU_SUPPORT "iommu-support" > #define ETH_VHOST_POSTCOPY_SUPPORT "postcopy-support" > -#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso" > -#define ETH_VHOST_LINEAR_BUF "linear-buffer" > -#define ETH_VHOST_EXT_BUF "ext-buffer" > +#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso" > +#define ETH_VHOST_LINEAR_BUF "linear-buffer" > +#define ETH_VHOST_EXT_BUF "ext-buffer" > +#define ETH_VHOST_LEGACY_OL_FLAGS "legacy-ol-flags" > #define VHOST_MAX_PKT_BURST 32 >=20 > static const char *valid_arguments[] =3D { > @@ -1563,6 +1564,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev) > int tso =3D 0; > int linear_buf =3D 0; > int ext_buf =3D 0; > + int legacy_ol_flags =3D 0; > struct rte_eth_dev *eth_dev; > const char *name =3D rte_vdev_device_name(dev); >=20 > @@ -1672,6 +1674,17 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev) > flags |=3D RTE_VHOST_USER_EXTBUF_SUPPORT; > } >=20 > + if (rte_kvargs_count(kvlist, ETH_VHOST_LEGACY_OL_FLAGS) =3D=3D 1) { > + ret =3D rte_kvargs_process(kvlist, > + ETH_VHOST_LEGACY_OL_FLAGS, > + &open_int, &legacy_ol_flags); > + if (ret < 0) > + goto out_free; > + } > + > + if (legacy_ol_flags =3D=3D 0) > + flags |=3D RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS; Putting this check into above '{}' like other option does, will look better= . Thanks, Chenbo > + > if (dev->device.numa_node =3D=3D SOCKET_ID_ANY) > dev->device.numa_node =3D rte_socket_id(); >=20 > -- > 2.35.1