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 DD68EA0542; Fri, 2 Sep 2022 05:29:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9F9940693; Fri, 2 Sep 2022 05:29:33 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 96C4840684 for ; Fri, 2 Sep 2022 05:29:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662089371; x=1693625371; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Vg/Y3AvpTBp/fS/BBXIr7UehQFf8DCu5J3l+AoxWBlo=; b=loF5Tj45tRpAJaECFRQq5IqnTL9BAU7XdGsgpM9S5V916iEC7LuTaKH/ kAGfYBvxayQ+IurO1wGzMW2l1DrWb/VTu4URtitEAeLo/afFNU/mczCwM Yzd1Fx/uSjZepHkqcClHM0rpdCoZGNY+MF3DHIjlDLX6vTcmn+vNJdxKb c9/znJjhpXfcrIjiKIH45ffxDurs9BxqxtqFzM2aiT3mLPBtgT2mTI7aP NVaosfiF1d7y77iYtPGI/ARA7CyxGnInWOo1Bib/mgg0DHo3PV9/rOJ5w 88U8fxByj5aHK/kl96bpepa0xJebxYnHGhgJJXF8yimO5PqncpvT7+eVY w==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="359843100" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="359843100" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 20:29:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="738726924" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga004.jf.intel.com with ESMTP; 01 Sep 2022 20:29:30 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2375.31; Thu, 1 Sep 2022 20:29:30 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 1 Sep 2022 20:29:29 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 1 Sep 2022 20:29:29 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 1 Sep 2022 20:29:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fxicjnaTSEdE2l3SyiEa73M+JmTJy1KzxrLUKOAWKnupPkTxHfPTTyKTCAzafxU0IgGPgsauser4a62TnuCAYPPj2EVsIOEkDU4S2HgUoZrwSkFLdLPegcQrRr//np2qeAQyA+KVG1QjMfmgniZmV2tXQ1GqMhR7B7ZtADfomifwcSYcjPCM8xH50IXPpIrDYPdJel1TyPLAkg9AcDUZBAxZZPlZfjux0UJbwMfJmsuoA6RvjiWTqdCI8zeF6GUKhNcOyzwsyRYakJR9FOKminCc683pmGj9hThfe3WSwppLkIoDT1dUdw/7XcrrVxIA1WduBygBw5oSw0B+pjPT/w== 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=RvpXe/rv/KSTvOtGf/AAiEISUfgw3SPBXltmC+u53H4=; b=D1lOkUR8bzS2oVnHxDKzd7iMkljgDyXEcEayWoid9LbNaFCaEk6TmVuZOlkcdyLDGwaTuWxeb+jwLuBI5mt+z6B0aBkx3p3EZ1XSXF+aHJT6UbBIC5QUbQ15SN6sAXczidW/eiiUTwrRqmwKYI4VXw9nVy78IPWxUKlho1KU95HeSqqXLdZGYwkiZhHwKer+Q/kN57CXQFOKi9xeGhIHthddU4h73cH4/kxSI/AcFJTa5FihSqFYq2oRuMX2kNGLCi/4+wcmMkk0s+WE4mIBqQs8tFq7moPRFvboAF/k63dFdEubFjOr5YQsgYh3mNzekPvwUqtczTKXi8ezkA84pg== 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 MWHPR11MB1886.namprd11.prod.outlook.com (2603:10b6:300:110::9) by PH7PR11MB6771.namprd11.prod.outlook.com (2603:10b6:510:1b5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.16; Fri, 2 Sep 2022 03:29:27 +0000 Received: from MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::58f6:397c:5f5a:216f]) by MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::58f6:397c:5f5a:216f%4]) with mapi id 15.20.5588.012; Fri, 2 Sep 2022 03:29:27 +0000 From: "Yang, Qiming" To: "Liu, KevinX" , "dev@dpdk.org" CC: "Zhang, Yuying" , "Xing, Beilei" , "Yang, SteveX" , "Liu, KevinX" Subject: RE: [PATCH] net/i40e: fix incorrect VLAN stripping for QinQ Thread-Topic: [PATCH] net/i40e: fix incorrect VLAN stripping for QinQ Thread-Index: AQHYvafAbJc+RvC0WkeUy4JCyDZEoa3Le6GA Date: Fri, 2 Sep 2022 03:29:27 +0000 Message-ID: References: <20220901100549.2333654-1-kevinx.liu@intel.com> In-Reply-To: <20220901100549.2333654-1-kevinx.liu@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action 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: 5222e016-2fba-4242-7dcb-08da8c935710 x-ms-traffictypediagnostic: PH7PR11MB6771:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ME8kGtUFBvH5Hpsw+v35Q2mDCB8hBe+UjGEzXK3QKEka/nFfnMQuC1SdBOFhBNiTxbp0/mJlSD9OS4AjEcKMGR/7jK9yKRYjoHeZFN22PlxguTA5bzpJ2+/Uq2rPtYfWSFriS0dkywn4bQzoSqPKRwFxnaDKbJJJhTIk/h8yivaHhw+5011lBkob0y0xEWIESKDH8U4HITpZ3R3rcGFDtYSJHaIB4zoJ/pEycJeiQiIOU7VlAWxYbmuX8M+3ZDzdmlO9FAzWjMxX+IfLZhsUMSQO/1QjX9v4CElmv/QAJbUu9Z7A8fqFSkLnTRV7nD0G4BEROljacbPuUX5CtxpzzrKgAPvShdee3IQwihjzXokvp0bITFvjen0iBQTxlDZH+2V9/LGXGQqi47FqEytaFJ4j5T4PbaH4u0MtyQuhLlW1CqD9jDErqxjQtKybtE4N6JLVXOj6yE1bV8jO/cRhP3qDN6KI3Dr86h5bB4arwERTzrBRhuGkiSamvWKsTdhV07hh/ZNFJfnREXQ1VGBDS6CjMhWFrGDHg2cw1Uw49tEKvXrkixNvZbvgGxd1M0oG7TJLItnMvnTpUU0PsxEhObkq9uIo7bFC7Zw+JYM78xBCQ7h2BKCI4ndPszY8KqV98MLaQ9zQdgw0wbHoi9uxXa6lR9g+Npl/xurcREHPluiKWawf6jolwpBY0EEdyhgNYF26gCaA3SE/vTQvFdYNEAhmDHPRDrxlYUEhtqgK1lGn6pDtYIK/O649dckOSvxoye4Vn8dtBEoGYoFJQOBhK9s+R1uQw+AEQoOdVaz4+AA= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1886.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(376002)(366004)(136003)(39860400002)(396003)(82960400001)(122000001)(38070700005)(86362001)(186003)(83380400001)(52536014)(38100700002)(30864003)(5660300002)(8676002)(76116006)(4326008)(66556008)(66476007)(64756008)(66946007)(55016003)(66446008)(2906002)(53546011)(41300700001)(110136005)(107886003)(6506007)(478600001)(54906003)(33656002)(7696005)(8936002)(71200400001)(9686003)(26005)(316002)(168613001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nI/rUwoB8kHu/PsfYAs/OOOIO8aDA4o6Jc72rXjlNL3JdNnb1FWQwWkl7V/y?= =?us-ascii?Q?HRfHdkDEUWDLrHTpL7/21MFEw+Se8imCg2CcflVWZBU+Mf1Bh0NZx4nmLhar?= =?us-ascii?Q?ixur73O339C55SLYuFjZ1bn0Cizv3ZkSK4v92AkIRH9keKHTG1A7dynBSLQF?= =?us-ascii?Q?rx9/2iyoY+V1PerLA36sqimK0rQ2Aa+jwcNplMZtRS8zWI2GqBKY+e/zEe5T?= =?us-ascii?Q?LAu3F01ztIGq7KI1Ekqbff8859ZmJEPVl4Rn5vzy5OMhwHDGwNZ0KS1J/6yi?= =?us-ascii?Q?udADLW051RJc68zUCSNqE2PdJIHsMoOhlssX+YixnGkM3q4yvOx5dFIfkjQy?= =?us-ascii?Q?vRSJsUCo7KlFHlhnl7aHqH8hniKhuCEQIaEQTXYsruQeIb7Au7AqLMEn6y3V?= =?us-ascii?Q?5EznZZCbWiD+tHDNXkJniwSzMkhobCqajQwTWV9WA5T2vJ2MYJXMX917Xhh9?= =?us-ascii?Q?ejk4+XzUyH4a1T19rooCgkLufgIsceOYWvZbkYFeC/SLcBO0AiRsppL9s6rv?= =?us-ascii?Q?e501fKaWnbkFL9ydioT35HDb5xQ8Nr4ho2VkeyFCdiBmhri7b6+OfKotqQ/g?= =?us-ascii?Q?E1URCMDKz8wwBVyKQhBp4fyfJLuccSmPy1aV/Rkqgpy74pLMBZy36RicEhOB?= =?us-ascii?Q?z4j2glAPFQpg8uZqz2usdyHVYvNgQuOd8JJiVy0GVtdRqGx3qjUNrOJMNz/2?= =?us-ascii?Q?RIfr2JdiAdqJBe1hA3SOTTDgI+z6aWfr4pXSuseeHEOzqK85V4IEVVBqdmhJ?= =?us-ascii?Q?uMkMg8Hp72k5TmoqJKlY0vbnTDmmuRsB+nAeXwB2ldfTM2u6bK2C6MacJJfy?= =?us-ascii?Q?j64cv1Evs9Iip1BEaTPhJCGywQMI154xkpk+PEST9+KmU4hzsxXcUXu3psof?= =?us-ascii?Q?48Ek1iwwoRNVupvpDxTPMxgK0yIqRWEX8kQz0nE6BwrQD5+0sZDL2JgZy7Z4?= =?us-ascii?Q?WIaLqrr8b+A5K9gskDuYDJ45fgwzpYt2ToYpRBH9xHCz73M4cXqo+7pVjZQZ?= =?us-ascii?Q?xHnYiSXA4MRFAxpq4UDaV3zW576NuTDwpYTiQdhyXr1o7tVx54ri9NSXgpVP?= =?us-ascii?Q?8Yi5GywHJ6UaNlbmXGOSnp77cctHWT8MLcO4uM8n7o6nFfcrSr9D+A1yIGNx?= =?us-ascii?Q?/GmgMN0nClOCaCTyOWwpScvUVNWgBVBwalgCTp7WGYw/27JA/5S3qxazUmAn?= =?us-ascii?Q?CaIx/9tlbDOowHyFG1o6+2LrCm6FnWhwlGAJ7w6x3dA8wPvj/3DuP8kyHd5t?= =?us-ascii?Q?pcryNjgXZXrliG0AP/WOTVB+bKTROMvGqkXwevn1poD8X7BqJImf7LpSNjtv?= =?us-ascii?Q?9tCtor9L2uHU8Y5ktXN8AnWeytzwc9viORS/hu1psbUMFiEavXDrNDTlOR/t?= =?us-ascii?Q?HwqmFv3oDKTusplH0DyKsPdPNnU8gd9Ja99YKXpE0CPLyy0VSIuPgrZ+0SQi?= =?us-ascii?Q?EQ6SlqUT5WRagXcbOiKtXcHu3bAagK22qWvw/koic3QxB/DbFkeuYfVcSwYe?= =?us-ascii?Q?4h9OM05OzxUUyDsjdVsbEeqenT7A/2FDOkHfl4ISyVHDPV5I8c1/DIjiS8Zt?= =?us-ascii?Q?7WqAQGY734sB6nwSdbA5/EbcZCIvHkSu3p3pn481?= 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: MWHPR11MB1886.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5222e016-2fba-4242-7dcb-08da8c935710 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2022 03:29:27.4813 (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: nKNHeYb6akyvs2SOHruRSrTaLA+EfaXsb9x72fyioSNuj+L9C5P/l7ScUXwc2yn8WDdx1Oe8HtZBsxToD6HT2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6771 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 > -----Original Message----- > From: Kevin Liu > Sent: Thursday, September 1, 2022 6:06 PM > To: dev@dpdk.org > Cc: Zhang, Yuying ; Xing, Beilei > ; Yang, SteveX ; Liu, Kevin= X > > Subject: [PATCH] net/i40e: fix incorrect VLAN stripping for QinQ >=20 > QinQ enable, when enable strip function, it is wrong to strip inner VLAN = of > double VLAN package. The correct action is outer VLAN is stripped. So, ne= ed > to configure 'outer_vlan_flags' to update vsi. >=20 This commit message don't explain why we need to change the inner vlan stri= p to outer vlan. We should align with kernel driver's new behavior. And from my point of view, we have no need to add too many new functions fo= r this fix. Can you work out another simple design? > When enable QinQ strip function, need to set 'port_vlan_flags' to configu= re > inner VLAN strip. >=20 > Signed-off-by: Kevin Liu > --- > doc/guides/nics/i40e.rst | 2 - > drivers/net/i40e/i40e_ethdev.c | 170 +++++++++++++++++++++++++++++++-- > drivers/net/i40e/i40e_ethdev.h | 4 + > 3 files changed, 164 insertions(+), 12 deletions(-) >=20 > diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index > 15b796e67a..ffcb2a2220 100644 > --- a/doc/guides/nics/i40e.rst > +++ b/doc/guides/nics/i40e.rst > @@ -982,8 +982,6 @@ Vlan related Features miss when FW >=3D 8.4 If FW > version >=3D 8.4, there'll be some Vlan related issues: >=20 > #. TCI input set for QinQ is invalid. > -#. Fail to configure TPID for QinQ. > -#. Fail to strip outer Vlan. >=20 > Example of getting best performance with l3fwd example > ------------------------------------------------------ > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 27cfda6ff8..0c3009ebfa 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -52,6 +52,8 @@ > #define I40E_VSI_TSR_QINQ_STRIP 0x4010 > #define I40E_VSI_TSR(_i) (0x00050800 + ((_i) * 4)) >=20 > +#define I40E_OVLAN_EMOD_SHIFT(x) ((x) << > I40E_AQ_VSI_OVLAN_EMOD_SHIFT) > + > /* Maximun number of capability elements */ > #define I40E_MAX_CAP_ELE_NUM 128 >=20 > @@ -4011,10 +4013,15 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, > int mask) >=20 > if (mask & RTE_ETH_VLAN_STRIP_MASK) { > /* Enable or disable VLAN stripping */ > - if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) > - i40e_vsi_config_vlan_stripping(vsi, TRUE); > - else > + if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) > { > + if (rxmode->offloads & > RTE_ETH_RX_OFFLOAD_VLAN_EXTEND) > + i40e_vsi_config_vlan_stripping_v1(vsi, TRUE); > + else > + i40e_vsi_config_vlan_stripping(vsi, TRUE); > + } else { > i40e_vsi_config_vlan_stripping(vsi, FALSE); > + i40e_vsi_config_vlan_stripping_v1(vsi, FALSE); > + } > } >=20 > if (mask & RTE_ETH_VLAN_EXTEND_MASK) { @@ -4068,6 +4075,10 > @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask) > if (rxmode->offloads & > RTE_ETH_RX_OFFLOAD_VLAN_EXTEND) { > if (pf->fw8_3gt) { > i40e_vsi_config_qinq(vsi, TRUE); > + if (rxmode->offloads & > RTE_ETH_RX_OFFLOAD_VLAN_STRIP) { > + i40e_vsi_config_vlan_stripping(vsi, > FALSE); > + i40e_vsi_config_vlan_stripping_v1(vsi, > TRUE); > + } > } else { > i40e_vsi_config_double_vlan(vsi, TRUE); > /* Set global registers with default ethertype. > */ @@ -4077,10 +4088,15 @@ i40e_vlan_offload_set(struct rte_eth_dev > *dev, int mask) >=20 > RTE_ETHER_TYPE_VLAN); > } > } else { > - if (pf->fw8_3gt) > + if (pf->fw8_3gt) { > i40e_vsi_config_qinq(vsi, FALSE); > - else > + if (rxmode->offloads & > RTE_ETH_RX_OFFLOAD_VLAN_STRIP) { > + i40e_vsi_config_vlan_stripping_v1(vsi, > FALSE); > + i40e_vsi_config_vlan_stripping(vsi, > TRUE); > + } > + } else { > i40e_vsi_config_double_vlan(vsi, FALSE); > + } > } > /*restore mac/vlan filters of all ports*/ > for (j =3D 0; j < port_num; j++) { > @@ -4096,10 +4112,17 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, > int mask) >=20 > if (mask & RTE_ETH_QINQ_STRIP_MASK) { > /* Enable or disable outer VLAN stripping */ > - if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) > - i40e_vsi_config_outer_vlan_stripping(vsi, TRUE); > - else > - i40e_vsi_config_outer_vlan_stripping(vsi, FALSE); > + if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_QINQ_STRIP) > { > + if (pf->fw8_3gt) > + i40e_vsi_config_inner_vlan_stripping(vsi, > TRUE); > + else > + i40e_vsi_config_outer_vlan_stripping(vsi, > TRUE); > + } else { > + if (pf->fw8_3gt) > + i40e_vsi_config_inner_vlan_stripping(vsi, > FALSE); > + else > + i40e_vsi_config_outer_vlan_stripping(vsi, > FALSE); > + } > } >=20 > return 0; > @@ -5231,6 +5254,7 @@ int > i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi, > struct i40e_vsi_vlan_pvid_info *info) { > + struct i40e_pf *pf =3D I40E_VSI_TO_PF(vsi); > struct i40e_hw *hw; > struct i40e_vsi_context ctxt; > uint8_t vlan_flags =3D 0; > @@ -5241,6 +5265,9 @@ i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi, > return I40E_ERR_PARAM; > } >=20 > + if (pf->fw8_3gt) > + return i40e_vsi_vlan_ovid_set(vsi, info); > + > if (info->on) { > vsi->info.pvid =3D info->config.pvid; > /** > @@ -5880,8 +5907,16 @@ i40e_vsi_setup(struct i40e_pf *pf, > memset(&ctxt, 0, sizeof(ctxt)); > vsi->info.valid_sections |=3D > rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID); > - vsi->info.port_vlan_flags =3D I40E_AQ_VSI_PVLAN_MODE_ALL > | > + if (pf->fw8_3gt) { > + vsi->info.port_vlan_flags =3D > I40E_AQ_VSI_PVLAN_MODE_ALL | > + > I40E_AQ_VSI_PVLAN_EMOD_NOTHING; > + vsi->info.outer_vlan_flags =3D > I40E_AQ_VSI_OVLAN_MODE_ALL | > + > I40E_OVLAN_EMOD_SHIFT(I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL) > | > + > I40E_OVLAN_EMOD_SHIFT(I40E_AQ_VSI_OVLAN_CTRL_ENA); > + } else { > + vsi->info.port_vlan_flags =3D > I40E_AQ_VSI_PVLAN_MODE_ALL | >=20 > I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH; > + } > rte_memcpy(&ctxt.info, &vsi->info, > sizeof(struct i40e_aqc_vsi_properties_data)); > ret =3D i40e_vsi_config_tc_queue_mapping(vsi, &ctxt.info, @@ > -6175,6 +6210,121 @@ i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, > bool on) > return ret; > } >=20 > +int i40e_vsi_config_vlan_stripping_v1(struct i40e_vsi *vsi, bool on) { Why need to add a new function? Not fix it in exist one? > + struct i40e_hw *hw =3D I40E_VSI_TO_HW(vsi); > + struct i40e_vsi_context ctxt; > + uint8_t vlan_flags; > + int ret =3D I40E_SUCCESS; > + > + /* Check if it has been already on or off */ > + if (vsi->info.valid_sections & > + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID)) { > + if (on) { > + if ((vsi->info.outer_vlan_flags & > + I40E_AQ_VSI_OVLAN_EMOD_MASK) > =3D=3D 0) > + return 0; /* already on */ > + } else { > + if ((vsi->info.outer_vlan_flags & > + I40E_AQ_VSI_OVLAN_EMOD_MASK) =3D=3D > + I40E_AQ_VSI_OVLAN_EMOD_MASK) > + return 0; /* already off */ > + } > + } > + > + if (on) > + vlan_flags =3D I40E_AQ_VSI_OVLAN_MODE_ALL | > + > I40E_OVLAN_EMOD_SHIFT(I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL) > | > + > I40E_OVLAN_EMOD_SHIFT(I40E_AQ_VSI_OVLAN_CTRL_ENA); > + else > + vlan_flags =3D I40E_AQ_VSI_OVLAN_MODE_ALL | > + > I40E_OVLAN_EMOD_SHIFT(I40E_AQ_VSI_OVLAN_EMOD_NOTHING) > | > + > I40E_OVLAN_EMOD_SHIFT(I40E_AQ_VSI_OVLAN_CTRL_ENA); > + > + vsi->info.valid_sections =3D > + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID); > + vsi->info.outer_vlan_flags =3D vlan_flags; > + ctxt.seid =3D vsi->seid; > + rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); > + ret =3D i40e_aq_update_vsi_params(hw, &ctxt, NULL); > + if (ret) > + PMD_DRV_LOG(INFO, "Update VSI failed to %s outer vlan > stripping", > + on ? "enable" : "disable"); > + > + return ret; > +} > + > +int i40e_vsi_config_inner_vlan_stripping(struct i40e_vsi *vsi, bool on) > +{ > + struct i40e_hw *hw =3D I40E_VSI_TO_HW(vsi); > + struct i40e_vsi_context ctxt; > + uint8_t vlan_flags; > + int ret =3D I40E_SUCCESS; > + > + if (on) > + vlan_flags =3D I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH; > + else > + vlan_flags =3D I40E_AQ_VSI_PVLAN_EMOD_NOTHING; > + vsi->info.valid_sections =3D > + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID); > + vsi->info.port_vlan_flags &=3D ~(I40E_AQ_VSI_PVLAN_EMOD_MASK); > + vsi->info.port_vlan_flags |=3D vlan_flags; > + ctxt.seid =3D vsi->seid; > + rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); > + ret =3D i40e_aq_update_vsi_params(hw, &ctxt, NULL); > + if (ret) > + PMD_DRV_LOG(INFO, "Update VSI failed to %s inner > stripping", > + on ? "enable" : "disable"); > + > + return ret; > +} > + > +int > +i40e_vsi_vlan_ovid_set(struct i40e_vsi *vsi, > + struct i40e_vsi_vlan_pvid_info *info) { > + struct i40e_hw *hw; > + struct i40e_vsi_context ctxt; > + uint8_t vlan_flags =3D 0; > + int ret; > + > + if (vsi =3D=3D NULL || info =3D=3D NULL) { > + PMD_DRV_LOG(ERR, "invalid parameters"); > + return I40E_ERR_PARAM; > + } > + > + if (info->on) { > + vsi->info.outer_vlan =3D info->config.pvid; > + vlan_flags =3D I40E_AQ_VSI_OVLAN_MODE_UNTAGGED | > + I40E_AQ_VSI_OVLAN_INSERT_PVID | > + > I40E_OVLAN_EMOD_SHIFT(I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL) > | > + > I40E_OVLAN_EMOD_SHIFT(I40E_AQ_VSI_OVLAN_CTRL_ENA); > + } else { > + vsi->info.outer_vlan =3D 0; > + if (info->config.reject.tagged =3D=3D 0) > + vlan_flags |=3D I40E_AQ_VSI_OVLAN_MODE_TAGGED; > + > + if (info->config.reject.untagged =3D=3D 0) > + vlan_flags |=3D > I40E_AQ_VSI_OVLAN_MODE_UNTAGGED; > + } > + vsi->info.outer_vlan_flags |=3D vlan_flags; > + vsi->info.outer_vlan_flags &=3D ~(I40E_AQ_VSI_OVLAN_INSERT_PVID | > + I40E_AQ_VSI_OVLAN_MODE_MASK); > + vsi->info.valid_sections =3D > + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID); > + memset(&ctxt, 0, sizeof(ctxt)); > + rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); > + ctxt.seid =3D vsi->seid; > + > + hw =3D I40E_VSI_TO_HW(vsi); > + ret =3D i40e_aq_update_vsi_params(hw, &ctxt, NULL); > + if (ret !=3D I40E_SUCCESS) > + PMD_DRV_LOG(ERR, "Failed to update VSI params"); > + > + return ret; > +} > + > + > static int > i40e_dev_init_vlan(struct rte_eth_dev *dev) { diff --git > a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index > fe943a45ff..2f513fce52 100644 > --- a/drivers/net/i40e/i40e_ethdev.h > +++ b/drivers/net/i40e/i40e_ethdev.h > @@ -1316,6 +1316,10 @@ void i40e_vsi_disable_queues_intr(struct i40e_vsi > *vsi); int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi, > struct i40e_vsi_vlan_pvid_info *info); int > i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on); > +int i40e_vsi_config_vlan_stripping_v1(struct i40e_vsi *vsi, bool on); > +int i40e_vsi_config_inner_vlan_stripping(struct i40e_vsi *vsi, bool > +on); int i40e_vsi_vlan_ovid_set(struct i40e_vsi *vsi, > + struct i40e_vsi_vlan_pvid_info *info); > int i40e_vsi_config_vlan_filter(struct i40e_vsi *vsi, bool on); uint64_= t > i40e_config_hena(const struct i40e_adapter *adapter, uint64_t flags); > uint64_t i40e_parse_hena(const struct i40e_adapter *adapter, uint64_t > flags); > -- > 2.34.1