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 DFEB8A0544; Fri, 2 Sep 2022 08:19:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8558D40693; Fri, 2 Sep 2022 08:19:07 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 5A26A40684 for ; Fri, 2 Sep 2022 08:19:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662099545; x=1693635545; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=EPDVJ3Uo+raKMwUGcEGniJO0g/3fq53Ixgx2lk/hxFM=; b=fLM9/VXWmCFNoHxqmyEHXlqX6+l1XfSj46SBoCqmw6llinTsKyZHnAAe GjhIgJCp+p6KmPuJmTbcTYo0HdjwmZTjyCpk84LpqgXh+wOQ7PLlj3hT7 4H9vQio9kwORwNfc7cl+bgGJ9sErdEo0HCaTDrRWLlaxtnXe628X+w4tr Z+KOl52U11PoBZQp89rXGvGjXANueU0EtddhSc+0jFaDaU3DQo9JmhQMH n6KLRzHvZzt01A9r9o+ksJHyuStEwbitkpzA6wjmAvIZ6IlZ9zQJBc3Od TA2dqq57G35M86p1CP9fw63gu0fVcWVL/MCIwt1ahVUIjspsv6gZ+fItB g==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="278922096" X-IronPort-AV: E=Sophos;i="5.93,283,1654585200"; d="scan'208";a="278922096" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 23:19:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,283,1654585200"; d="scan'208";a="702029844" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by FMSMGA003.fm.intel.com with ESMTP; 01 Sep 2022 23:19:03 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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 23:19:02 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.2375.31 via Frontend Transport; Thu, 1 Sep 2022 23:19:02 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.46) 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 23:19:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PgxJEuVu7ODXL1YEMrlGC6odNtDjQClz1gtheeuv8k9aHLloOEA9uT/RnzH1HvFhcKGexGWVU2T6VI0YO36iQfZparYmw6cfJphPsdF7o7IwbzxMonEjHKV/wwTn04ljd2SjGOO8z5Puw4pE/VYBKT/VAOea9elhVc832rUuvI2u6VMsI7EvzO+NNem0rAJdd6JmiZZjWOEGSIh2tGc+q3LxfzY4BIsBnnDGqV90PVNBrBbJtFitBPlqDy24ao2fxYEaOgZPz2yQlKz7ZiHl2Qm//ahAgPbTy8NWkaZKrSxkyOWqooL6oxgQhQWpGSIX7njFgG8HmIADBIuVFXL/1w== 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=D6l+VjtPaqd+OW/qHBLdc9/7dU/+vPyKtitBBirD/BI=; b=N0G2IB8g+6j00XVLR49+WDud7vhWVjU2NpnTWayVgC6yFv7KWE4VEBUhesF2fYqMZSWxRjrkt9558MsTgOniXbMBTWmLSV7vTHXwQBxy0FVAULmVylKVtzjgTC8SkBzi006/+HKhV7Ku4hMIozy041c9jszObTd9N/tKp1NNtvzRr0b5iXxaF4JKzGlwPTVTsOoUnNZCKkLJZ6fHSvlhX9sVH166P3OyTLsGhvGfBcBcgcfDGG1SqxPa85TTpov7XLv+TiMQhuLLgcjxVheV9Mid/es4mEb/wRtrVwRd4IpUyqwuh0rgeasovOWXbjXKVpSeVmI2+QQNA7UtaZ8jCw== 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 DM6PR11MB3673.namprd11.prod.outlook.com (2603:10b6:5:145::26) by DM4PR11MB6117.namprd11.prod.outlook.com (2603:10b6:8:b3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Fri, 2 Sep 2022 06:18:55 +0000 Received: from DM6PR11MB3673.namprd11.prod.outlook.com ([fe80::451a:843b:9068:7b5]) by DM6PR11MB3673.namprd11.prod.outlook.com ([fe80::451a:843b:9068:7b5%4]) with mapi id 15.20.5566.021; Fri, 2 Sep 2022 06:18:54 +0000 From: "Liu, KevinX" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Zhang, Yuying" , "Xing, Beilei" , "Yang, SteveX" Subject: RE: [PATCH] net/i40e: fix incorrect VLAN stripping for QinQ Thread-Topic: [PATCH] net/i40e: fix incorrect VLAN stripping for QinQ Thread-Index: AQHYvaesjbB6APFtwE6NnsWiXFFMZq3LfRmAgAAq/kA= Date: Fri, 2 Sep 2022 06:18:54 +0000 Message-ID: References: <20220901100549.2333654-1-kevinx.liu@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 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: af819e93-ee08-4ad1-b1e9-08da8cab033d x-ms-traffictypediagnostic: DM4PR11MB6117:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Uil0f0KxhXkq8P/tkJ2v+jB+8DOvMif+3sPkEL6JbLHbgieu3vxJG0lmN/N07tiT7AX+vy3v7Ctd5deLc2tXIygxQQlMce9lU7YeRzAXJkSP4rOC5UvUMXOo6AhuB3Z7TyxVz2+nrJZQuhYzgf0Q9I93KOxi+2y5RhyXRbMbhM+CgP/76ayTKnkrmD9910ClTaVR0LWWXgscxY4JLWZaRuJpG5ud7eJK40/ItN9u7WF6Yon0m7iS4WAkbGgT8JQ1Q7/uk9pegPS/gnFDHAfeB7L5oIjz7R+V3o1jeSIy3AaZFElceAQzX83ngAo2KtwxLyh90OzJm3Gk2iQK74v961Z1Z9RSW9m2+Bt3a1eucOZHL95f7Us4P9Ub8UvxwEZ0d+59dps76qm7wLgZZW/YC+aQfX3/+rVFIuymFw3qILpa4QfTAq5Ubd2ZdeJi+YyBeLwP0bylWvLUvwHn7oNUnVxx1nNzQ+yvU8efzCP/I+QI8Z/MqIazK+SrrwX+VUyzyp6lCK80u5OLP9amFoP51K1n7Vd6tMUQJ0kJaMZ3B2cT1HHqFqdXKwVbWFI+3k2kdP8Z6QfzF0weh8MAMTElu+fdKliYb5A1F0GyVJmKjeMp+Dr4+fkmTnV6YDVQHXYPtZRWZcQD4+BsQsNR47YHxPRWavN5nqhRD8f83ebJWGnDxj3v4F3iwbMgE7QJ49kPjsylBJOGyKJwOeRZbcMZIi8UOEBjs46wZYnfvTY5GYMJPqvO1BnqH442uwlE2K5fhZfCqJSdKiFxK7+b7t4ExVJPGKRsXfsjRWXMT+tyubY= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3673.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(396003)(346002)(136003)(376002)(39860400002)(366004)(122000001)(30864003)(2906002)(186003)(64756008)(316002)(54906003)(66556008)(110136005)(66446008)(66946007)(4326008)(5660300002)(76116006)(83380400001)(66476007)(8676002)(86362001)(8936002)(53546011)(107886003)(478600001)(6506007)(26005)(55016003)(9686003)(52536014)(41300700001)(71200400001)(82960400001)(33656002)(38100700002)(7696005)(38070700005)(168613001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LKyTQ7bledv4Fpn7SU81K0fwGgfw1idmewFLCZGf10/o13ZgNH5UpV9Q6Z0u?= =?us-ascii?Q?mkqdShqTs+O9Q9kfq6feu2IPVPorVpPTFMzY0awrSsUVRV9PYC/dbi3JIqvl?= =?us-ascii?Q?5fg7jO4ytiydK22NjNiDlB7Iwm4Y1SBwGvNp6yxplfsz3KlwkrPPfbmc9T1o?= =?us-ascii?Q?oNBXZqllRosAnB5FOV0vDM0c3ZyUEwniBuRHzA4EZy6HzAex1W5zUiaYfgcm?= =?us-ascii?Q?mnOoaZYEMdLUrzH9ii0tvCRH6Jr0o2+NX4VOuV0mlswIZscKdEP+ZFimaI6M?= =?us-ascii?Q?fuEoUtmJ6kp9d++1xML7NRiArxDbZl17q2EG6r1wtdszVF7CR9a4E9wWOdP3?= =?us-ascii?Q?inv+SEXbx/Q1Sc9BLDYh8CFeUSCQh4Oug4P6lkgpDLDz0M8Pvv1Km13zUycj?= =?us-ascii?Q?gyItKE1pkdtBvwQ8aPQHRtU8Yi0i2Vfcbzg24AKMHdnB8M9JtY/INqIBD+rb?= =?us-ascii?Q?Oy+pHfv8oQRjh3dlsoPepMkUs8dF7iUpPwWQR4MWmk5qMYQ9tx71ZpPgqOTd?= =?us-ascii?Q?+FOWDfsmZN+y7awmJNEq+zWmvyghGEIlQlcGVi32rev2ij1qGcPnemermgAo?= =?us-ascii?Q?2Q704XhxqC5TGLtFe6nHoSi/yBySu9mIfLihgHm6NwOIQg1tSGil9raDbVj2?= =?us-ascii?Q?ZXXl1TxZOshHUUTMJIOrUDgnYVzMwypJrCCecFUtlSLtKAMaLbsSCa4/x5oq?= =?us-ascii?Q?O/xrFQ5Y5DlzoMmP/LV3yo7e0KJe3qX4/lQGUzZHh2qMPyX8h9DSbyEJ4RXm?= =?us-ascii?Q?6ukEAS4WHZ2QCg8Q6OAJLY0DuK0qhBRWS8O7Zma9WHpMIBzrcsahnIBhupRC?= =?us-ascii?Q?OsOzfJX8ZwSrIuxhn8jgH+uwwmd7EOwuY6t9UNlyMMcmIDNbSTAP6LODQWjd?= =?us-ascii?Q?/XA/C82yjRsz/ry8ncg0yyGRHGrI6E47KOX6WfP7fP3nXL2UQr0us4nnWpv8?= =?us-ascii?Q?82OAcxt/C+qiwEhm7V5D1k9/ubIIRSydXG7wKFYTeYfNjEYHXOERyqTb0Ozu?= =?us-ascii?Q?WEf/ZgEBPNMASMCvhQ2X8KAVNWsF/fPVwERRezY4zxStgGipaaIcpDqVV3JQ?= =?us-ascii?Q?lUY2/vtCcoRVtkkImO1+O7hbI6Wgx1yBtMI53W80y5TVGQ5nT+yo9YYEX1kW?= =?us-ascii?Q?1FPwZk02mpkHuk2wDY6OLnbXh0JsU7mxzF6Ph4ITHsZT1AwQxrosRnPszbTW?= =?us-ascii?Q?7eT5UnH6IlSIG7LS+2ztPdFrL6FKg6Ildl93wfGQX/pVq/Z1w7KkIPJ44P8s?= =?us-ascii?Q?eNRwBX1Y2SpjsWEgsFy9eDibKv63Kmj/gXXzd1YWruXgjlk2S9xVFXqRdVoD?= =?us-ascii?Q?GA61l48dqeJZkkwIsNVKw33a3VaJqZSbTrQVE0Ec4NHsNk7aJdxunxf2hKQh?= =?us-ascii?Q?5k2WdUCfoKXT/q5PWg47AOAGrJ7qvR0dZ4GpouOns4+QwVQK00zdXKNhOmyr?= =?us-ascii?Q?lb5tLjtQXBL4bb6VEcsBmet+g3KKbrNxDgKTwYg/IGbQdLy9/Tni3GObDwWd?= =?us-ascii?Q?grOGfCWTRHjQ1WPd6+1NT8AmfN2GdN7RdtLVIro7hkJtAytSPVOegnUnN9mm?= =?us-ascii?Q?jaLezt5T1+SOkrok+8zd6ocm7EbTYx3j7nCervzo?= 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: DM6PR11MB3673.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: af819e93-ee08-4ad1-b1e9-08da8cab033d X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2022 06:18:54.7392 (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: M0Zh2JEP3Kpom+Sh0kyQBkngtvL6s3hGyBWDRxY3/uus8qhcYOr08PtHmZHb1hlymTXQ/pyX7XEHjaimNkPAjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6117 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: Yang, Qiming > Sent: Friday, September 2, 2022 11:29 AM > To: Liu, KevinX ; dev@dpdk.org > Cc: Zhang, Yuying ; Xing, Beilei > ; Yang, SteveX ; Liu, Kevin= X > > Subject: RE: [PATCH] net/i40e: fix incorrect VLAN stripping for QinQ >=20 >=20 >=20 > > -----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, > > KevinX > > Subject: [PATCH] net/i40e: fix incorrect VLAN stripping for QinQ > > > > 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, need to configure 'outer_vlan_flags' to update vsi. > > >=20 > This commit message don't explain why we need to change the inner vlan st= rip > 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 = for > this fix. > Can you work out another simple design? Thanks for your suggestion. I'll rework it. >=20 > > When enable QinQ strip function, need to set 'port_vlan_flags' to > > configure inner VLAN strip. > > > > 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(-) > > > > 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: > > > > #. TCI input set for QinQ is invalid. > > -#. Fail to configure TPID for QinQ. > > -#. Fail to strip outer Vlan. > > > > Example of getting best performance with l3fwd example > > ------------------------------------------------------ > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.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)) > > > > +#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 > > > > @@ -4011,10 +4013,15 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, > > int mask) > > > > 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); > > + } > > } > > > > 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) > > > > 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) > > > > 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); > > + } > > } > > > > 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; > > } > > > > + 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 | > > > > 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; > > } > > > > +int i40e_vsi_config_vlan_stripping_v1(struct i40e_vsi *vsi, bool on) > > +{ >=20 > Why need to add a new function? Not fix it in exist one? >=20 > > + 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