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 6D2DC42E32; Mon, 10 Jul 2023 03:42:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03671410EF; Mon, 10 Jul 2023 03:42:40 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 710B5410D7 for ; Mon, 10 Jul 2023 03:42:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688953357; x=1720489357; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vKG1qIOwgzK8e71dd7M7R9goZu2cgGa0MGAQDCkuXMw=; b=BCGisswpGEcVVAHhB0EiWEQBH428vKTn9oETQbP78fHHpbDTloyDqr8Q AKbltyxLbID41PkZZ1Rdt+s2ikNxHnsjfGQ50juVx82G2wAY3Nrn4viM9 VaL6/7FiXd20GkauO5arQauyu8W9OYEbn3gdcQrC+c1i5nw4Hceq5QJn+ 5j1RezJCiK2+S8Py1RbbME89gteRZj8GPSSB2KOJi3UE4J7FeKQxqbXZM gGnkbQkLADMvSmh5ll+Jvtf6yqsH5Ga2tRNidXxAwN7J/x9YjX/fjlDKC OLmLKL0cfs/TZ1kzO/haHa54EVkZWogMMq8uE0E2w9kHBkK/nBgygyTot w==; X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="427926493" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="427926493" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2023 18:42:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="810659398" X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="810659398" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jul 2023 18:42:36 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) 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.2507.27; Sun, 9 Jul 2023 18:42:36 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) 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.2507.27 via Frontend Transport; Sun, 9 Jul 2023 18:42:36 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Sun, 9 Jul 2023 18:42:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OK2ss1od0Arhvbnh9rVg6FM5SHyXRGDZJXUk7f+dn0toD1FBLCx1OttJF9mqDL6yBJJsdQsiPEz/SsSALj+YFyt5Jm8g31rzCmHCmBGuD4R8tLfks+H1giiu5mm3goL/HPMchZAdR+IM1VQzEV5Bzz8CbEOjIniFsNDKup5DnSPuKDhRj2LtlrbNM5kFOMbV92vICn7MjCdcIj51HDYyl+918Nge21h7lMCE6gka9fIyM9Rh06kJP4/7JIL3Dcr4kEWefBNQ/HuxaoBAbdddXjTq9qcBV/zbPeYChCJlQsI4SWqN5PQCb9CIHbJ95GJil+VY9O5CKpNtkx2hLBZ+wQ== 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=UMFg7flks/+hs6ypG95BLiLN/so5mt2+KiakSLLzF6g=; b=WhJE5crq7s/XVPhMbPkWy5xCI8evu5bZfD6pHvaUoaQjrQNlhXP6xlLnG1sbeSpyElSflyygzNmAaEYm15c7wwuozyppJRHLxq18R/CweuIHne4wOO4kPTGgqqeS6vG0mwbB7oFZ8zIkHqWmzl+j4bkxMjC/vIKYogx1QH2w9kcDnbH+lMxtRl0m0/Rmhqm3BIaB1i1TbCY7hUThz4/VBp2ZUgMxCqMhVwaRn0mWYz/wLu9jlxzIO3RwwqfK/+YJ+UvvcFINz0lRhopcIni7LQVlrCEIOoedNzTEw3MLT3qcgyGDClAEJYRSFQqZWz5bE7CQKqCfX/4DGILrty272Q== 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 DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by MN0PR11MB5985.namprd11.prod.outlook.com (2603:10b6:208:370::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 01:42:34 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::d3b4:2f0c:6e6:867f]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::d3b4:2f0c:6e6:867f%5]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 01:42:34 +0000 From: "Zhang, Qi Z" To: "Qiao, Wenjing" , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "Huang, ZhiminX" , "Qiao, Wenjing" Subject: RE: [PATCH] net/iavf: fix vlan offload strip flag inconsistency Thread-Topic: [PATCH] net/iavf: fix vlan offload strip flag inconsistency Thread-Index: AQHZsKjke209i6Y+D0+zgKTvu32+Pa+yO3XQ Date: Mon, 10 Jul 2023 01:42:34 +0000 Message-ID: References: <20230707075802.620018-1-wenjing.qiao@intel.com> In-Reply-To: <20230707075802.620018-1-wenjing.qiao@intel.com> Accept-Language: en-US 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-traffictypediagnostic: DM4PR11MB5994:EE_|MN0PR11MB5985:EE_ x-ms-office365-filtering-correlation-id: 4ed78510-2433-47dc-1822-08db80e6eee9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7S2H//FxnEfTADYkixB83Ge94mG5TD9yGTFLJDgchuMFr9zxEHTDZ8xFILJZtuRfWTIeyamm+L9LNzGTwGp+2CVfPzDhWVTKJESGAg15Id/FO1UnYd8MutwXJXX03jP4DDAcQagIyxEa7qCNu2zEPS1QMhXE9vssCb/4pHdBJ1MUyWYkaNIXTD9OXpQ/2D2A8gBmJRW8hVk8WccFvD8KJo2ojCHYVUYv/P1VBkv7wzrW0hz+PePqS1dWy6HMucSrplwxe+E7pGVD9ckwUZRwjyQVFQblea8xSx3vnoosBI9209WObFnyW24/7SMfwlilEM19XjRFh3Q47ZMALE6rq4uZPVGFcNMFj/o2zmCA2GPI7UB2Rmh2i5jMXEbQQLilONBbAm1tF2rmll2Vi+go1xgD4iPqYzNydlPhMYnNnR4qBURHdrh0kUjEdFnCRvs+gOmBZG9bi8YGT2LFA1uPLJlY3YucB7w/F6yKKV2h4AmWoSMgy1eU54lioDjwaFxy/YEH+wM8BCHHNiNPujBevzJZrGkqNYo77NkEunsKk4smR4hRV+RMQ80Tatbrx+rSXxHaFb2pKPiKCq5UTXIkC6O9nipUtM8XbNFEFg7chn8evVWdGz4vQD20iOB1rdgF x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(366004)(396003)(376002)(346002)(136003)(451199021)(186003)(26005)(6506007)(53546011)(9686003)(107886003)(83380400001)(41300700001)(4326008)(64756008)(66446008)(6636002)(2906002)(66556008)(316002)(52536014)(5660300002)(8676002)(8936002)(66476007)(66946007)(478600001)(7696005)(71200400001)(76116006)(110136005)(54906003)(55016003)(33656002)(122000001)(82960400001)(86362001)(38100700002)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?SQ8z6BJSgtgPg9UW/zgz/IVzs78ZPIBQ4U1KgMzGLZUaykeHEmisyLqERUgE?= =?us-ascii?Q?03td2q+EYYl8qvKY1m6bFCuJdjUIB308cJqkB+0DWBeLjMf/7lu6oVvvvU2e?= =?us-ascii?Q?lIxVm2Y8IFjtqhF8fs5wccoW+P9XAYgzK2AdWIlX/d0vBtKtImDWRJGHIey3?= =?us-ascii?Q?b1HIK1q9aHVB3lWipx2IR1QcDdi6WK8CxKWIqQP0PTUCxKzzOtXoDuoregDo?= =?us-ascii?Q?PP+zYEFvHJyiWEsLMu5hTUaRn9ENkrccfDqWLzMislKALzWwsUh0DaQOmxqj?= =?us-ascii?Q?JW444FRAtJWWqm0Zzlf7Q8Hkz6lOvePVI3zzEL1/43SBPXCUYNOG05kMLswc?= =?us-ascii?Q?NV0PdIEKDfrwmMy33KlmTtHCt5faR8Ube0mVImTVY5bZ4ijR3vAdbppWJgz6?= =?us-ascii?Q?Xhxqn0zdIE++3G4LkVd0wWigrikijpVGm07QWCgSSrnI6HnuNjaMuMsUgNKR?= =?us-ascii?Q?FvsFmkuak9iF/rlgkL0RvDO9z+wWYfAEPxONJPBTYGXSaxYWy0glHYUSDrsH?= =?us-ascii?Q?APTVPbb8fzvxa6ffnJgXXz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ascii?Q?Wcb+TitHGpSdadCB0uoeVxVwYSgflYWniGdRp65G6xrEyfFujAoOWcIVMVzt?= =?us-ascii?Q?5zS0hoDN8MVGYgbvKzY+EmDCSOBdubA6rXhMdRpv6Oy5efxUO/S2jfbsyrVT?= =?us-ascii?Q?HPv0xTFQskVMnhmDcrEeyvhF/+vupGtQYrNE4jVc?= 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: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ed78510-2433-47dc-1822-08db80e6eee9 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2023 01:42:34.1832 (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: Tw74+FnPOjy5c6TGhinTayCG7PzJp+DynKhhSVfOuP50b4KItdDRHjPj3rMqRRZkvD60917DIahCYoaBYQnnPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR11MB5985 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: Wenjing Qiao > Sent: Friday, July 7, 2023 3:58 PM > To: Wu, Jingjing ; Xing, Beilei > Cc: dev@dpdk.org; Huang, ZhiminX ; Qiao, > Wenjing > Subject: [PATCH] net/iavf: fix vlan offload strip flag inconsistency >=20 > For i40e in-tree kernel driver, it will set strip on when setting filter = on. To be > consistent with dpdk, disable strip again. >=20 > Fixes: cb25d4323fbf ("net/avf: enable MAC VLAN and promisc ops") >=20 > Signed-off-by: Wenjing Qiao > --- > drivers/net/iavf/iavf.h | 1 + > drivers/net/iavf/iavf_ethdev.c | 18 ++++++++++++++++++ > drivers/net/iavf/iavf_vchnl.c | 2 ++ > 3 files changed, 21 insertions(+) >=20 > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > 98861e4242..18b05f5cce 100644 > --- a/drivers/net/iavf/iavf.h > +++ b/drivers/net/iavf/iavf.h > @@ -325,6 +325,7 @@ struct iavf_adapter { > bool closed; > uint16_t fdir_ref_cnt; > struct iavf_devargs devargs; > + bool is_strip; /* only for vlan v1 */ Can we just use " dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP= "? > }; >=20 > /* IAVF_DEV_PRIVATE_TO */ > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c > index 00b963128b..8cd534e93c 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -1379,6 +1379,24 @@ iavf_dev_vlan_filter_set(struct rte_eth_dev *dev, > uint16_t vlan_id, int on) > err =3D iavf_add_del_vlan(adapter, vlan_id, on); > if (err) > return -EIO; > + /* for i40e in-tree kernel driver, it will set strip on when setting > + * filter on. To be consistent with dpdk, disable strip again. > + */ > + if (adapter->hw.vendor_id =3D=3D IAVF_INTEL_VENDOR_ID) { > + switch (adapter->hw.device_id) { > + case IAVF_DEV_ID_VF: > + case IAVF_DEV_ID_VF_HV: > + case IAVF_DEV_ID_X722_VF: How we identify this is an in-tree or out-of-tree i40e kernel driver? > + if (on && !adapter->is_strip) { > + err =3D iavf_disable_vlan_strip(adapter); > + if (err) > + return -EIO; > + } > + break; > + default: > + break; > + } > + } > return 0; > } >=20 > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > 524732f67d..2d2fee4312 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -589,6 +589,7 @@ iavf_enable_vlan_strip(struct iavf_adapter *adapter) > PMD_DRV_LOG(ERR, "Failed to execute command of" > " OP_ENABLE_VLAN_STRIPPING"); >=20 > + adapter->is_strip =3D true; > return ret; > } >=20 > @@ -611,6 +612,7 @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter) > " OP_DISABLE_VLAN_STRIPPING"); >=20 > return ret; > + adapter->is_strip =3D false; > } >=20 > #define VIRTCHNL_VERSION_MAJOR_START 1 > -- > 2.34.1