From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 59B05A09E9; Tue, 15 Dec 2020 06:27:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9B6B21E2F; Tue, 15 Dec 2020 06:27:17 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 8259EDE0 for ; Tue, 15 Dec 2020 06:27:16 +0100 (CET) IronPort-SDR: a+qNYImEQ7DGAKxHZNngjRPYFl32mtZjAYaCaeAoNMvF8+FVlWipWJwmXTTwXgId5HGzMzRzc0 eRfy2AR/Fdsg== X-IronPort-AV: E=McAfee;i="6000,8403,9835"; a="154059658" X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="154059658" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2020 21:27:11 -0800 IronPort-SDR: aXo6iYxN2udp0jhGXVXNW+VAi+gtzIGc0JiAXqzKHqI/FtlrYy0gWLfo4KA2y/qkthBVSO1A/z n6oRNkPXtBWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="450507785" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 14 Dec 2020 21:27:11 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Dec 2020 21:27:11 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Dec 2020 21:27:11 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 14 Dec 2020 21:27:11 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 14 Dec 2020 21:27:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJO+4+YwDKMT2fm+V3FSjLx0CxUNjHNyNknVjlmEyFO/Pn4WkevPenJjrI9C2Rh3U8eoqwydHHaZqmXYnDjUVRrdwdCscQFuVNb1LYliXGXFLrPN+DFyCJPFV+KZe2UQk4vzCcGAvQHHKNNE/BV8KiuBRMmm0ocEozP1zdUSa4N18zMtgoxLBhIIQe8WyturFp7qTkV3pclRhLCNLQuJKyL8XvyPZSd+hxuaoRInA1TyInXuSfeXd3rQW/4JYUrQWjBUlyF2Xr2qLPRGvk+Y+b+gbNDj1jVLS1AQA45NBdgqjr4QD9Sr31//yw2PFH8qOvbuQc8ta/Kwm+R1pjnyaw== 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-SenderADCheck; bh=QCA92EWxIgEB9NT+j417sx8kBBA0WJtyJvKVUD97u+w=; b=AhVH91+LicHlerPaD7YeohXG+dGYzwqlquL/Cg+uTxitMqxtQVw58pt1J/sgYHEWmPeIq7s3XweXC48W+FDd7kcOBp5Fj/yZh9aoqQu6M3GKGoCQSxzKaaG7jVYpOup+FptYgtwCaLg9xla7XwCb445b2F2yE4hN2e7FOHNnZlplxPpV/gwBGaRY1qdse3E/U6/05xYpPOuOkZHIx2kgsKq4twKgjF7fysWeUPV+s9vJkr2N1ikFI/m2CcsTOVD1b5QQF2f0FHPJ0xzW8jorDLVxYkd6WRotsxiQg2XJu8OkFVswbxW6wkOr2kPfSQdbpATxafqYTLA+vsoeGz+iwg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QCA92EWxIgEB9NT+j417sx8kBBA0WJtyJvKVUD97u+w=; b=tN7gcO1EircPdFx/wCm/x7jFk2RDdye06PlK94UhmZScf8kxWd9DYbKKm91bbMdL0orzm15efJdNomgs2LwUdhJTfhPalEcEOHx5cO73Rq+lHMzWmukwEvn6KkORLzp7RjVIwwzyPQgVeHhY0mpT03uDb7tzoXPIMONKjnMGnh0= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN6PR11MB1844.namprd11.prod.outlook.com (2603:10b6:404:103::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12; Tue, 15 Dec 2020 05:27:07 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::c0ef:8931:9b53:b3b6]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::c0ef:8931:9b53:b3b6%7]) with mapi id 15.20.3654.025; Tue, 15 Dec 2020 05:27:07 +0000 From: "Wang, Haiyue" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Wu, Jingjing" , "Zhang, Qi Z" , "Xing, Beilei" Thread-Topic: [PATCH v2 5/5] net/iavf: support new VLAN virtchnl opcodes Thread-Index: AQHW0ep+hrfFvc2ge0C5DDe/28Wv3qn3oCMAgAABVNA= Date: Tue, 15 Dec 2020 05:27:07 +0000 Message-ID: References: <20201214071155.98764-1-haiyue.wang@intel.com> <20201214071155.98764-6-haiyue.wang@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-reaction: no-action dlp-version: 11.6.0.76 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 49cb895b-f9f1-4886-5bed-08d8a0ba109c x-ms-traffictypediagnostic: BN6PR11MB1844: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5Mrp+0arFBy50DxFwrR/CMB6bJdJrciPuNuuH2Nh3CwonjhwGRVrK6HBxVqeS5vipPsa/Z7c+eTLbzMjHUMKvOdeTPCRXN/pNSZqchOAbqwLsnCT/0mRoLsdH8gy+ioczVgWpm9J5JH5WC1tJJgVBDMD1P/GP32Rg+vTyZTMMxPGttlJKS4zH7/G6isoBPz47qhcW67l05hmVgrwq1iqwMaVciapJR7jm78GWzywq7pp9PbgPWJ3F/bOQ02Ni0qSPcDC1R4d0PejW+xPoAR+l2aIrBw6/+i41Scb2w794ZEbOqOKLxps/kvLWG9k79uA21FY0xaTUwhcoz/8wIdJBg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(366004)(376002)(136003)(8936002)(9686003)(66476007)(8676002)(186003)(4326008)(55016002)(5660300002)(2906002)(71200400001)(6506007)(26005)(52536014)(66446008)(33656002)(7696005)(64756008)(53546011)(76116006)(66946007)(54906003)(110136005)(86362001)(107886003)(83380400001)(508600001)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?p7isZLI8nr14wOa2CYx/5FbLncwDXUf7PFwJCh+K0OMfeCWlC1J83mlmluAs?= =?us-ascii?Q?R6QocURCYf5y5+x169KIQJ57WGKZMdiumJh685mSc3ywtwQg5nBAwTcP0fsG?= =?us-ascii?Q?9ziJ2EfKLHC+OP20jYuXIUGi/Qg5HooNGr1rVv+z59nAMGKZpH8Lp6iDaIIZ?= =?us-ascii?Q?Hypa3EjLnYd2eqIq14peVMSDRu6QgxMGZJU89LC1giYJHGDpoC4/27pj7CXt?= =?us-ascii?Q?+aPeFHawy5eTPKD9aWxkv/pGVaMrSWT3uW1AjcFP2LgmSgrOInkJrxkLXksF?= =?us-ascii?Q?qJMwv+rM6skqMl3APpR0kjkHLCOYcupezKoue1fDB5vT/SzYk0ODAHXaJZxB?= =?us-ascii?Q?KFF2ibItPylqFGdr+9RFUjPJ7s3H65uGfUPhISc2SX+d/QO1XzzOfmmV5BTA?= =?us-ascii?Q?j+c171WBm2dIR7JyUuZ8vVqSwXzzSTp+6rR794ZHJzp8kddUI5cc8DF0TCBL?= =?us-ascii?Q?kNxGbmx/gL8rsu8thNMxdvUt9RJTF15lO2b46tMEFx+BmP87p+oGFlw8zXMs?= =?us-ascii?Q?E/JuC/OZIWFhTRmoDpBA/V0HzBQkbfR3L03cFolV9dofEG+TIbzO7khdMkEV?= =?us-ascii?Q?u8fR8rxxiVMJwQSgzPM3HLvADNZ5WovGd5WZw67x3j1y1GfE4iob9mREcxpU?= =?us-ascii?Q?PGX6G3DeKja+dL6vXTTgXeZjQZzX9NIu25N5MjkG9flnoINh8B8A/8jMitSj?= =?us-ascii?Q?+nKY9jZbTiuF1dpow4N26iy9L4iDC2jshqDrEwXhuuIw+A0auY7EeGpD+OyN?= =?us-ascii?Q?pAN5nf20pTUlaFGCKgXyveZrWH0pV3OF4ik9jld5TDEcHGglamvCoWSPSOpo?= =?us-ascii?Q?syIGxFDdVGFRcgz+BTeZucsL3zGeZDxhqoOwvbLMgdO16HCa6GsksLCaN6mU?= =?us-ascii?Q?GC0bP30gmdlDcbwiOeSBGQ8e7NMPSYHRP7yALv+oSSFGh720Yh8Z6S0XQCWO?= =?us-ascii?Q?QktHIgvfOaJ24Y9aVMuglc+xZaYMATkjePd6R/X8Opk=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: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49cb895b-f9f1-4886-5bed-08d8a0ba109c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2020 05:27:07.3830 (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: 4BUzORStB+k4M1wAWsi5GXTLgv2Dk5CbAxbKoYhWag1MqsfBPh/NuFQqZYfnRRkrzenLT0ojQZqJKxoLf1e7HQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1844 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 5/5] net/iavf: support new VLAN virtchnl opcodes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Yang, Qiming > Sent: Tuesday, December 15, 2020 13:20 > To: Wang, Haiyue ; dev@dpdk.org > Cc: Wu, Jingjing ; Zhang, Qi Z ; Xing, Beilei > > Subject: RE: [PATCH v2 5/5] net/iavf: support new VLAN virtchnl opcodes >=20 >=20 >=20 > > -----Original Message----- > > From: Wang, Haiyue > > Sent: Monday, December 14, 2020 15:12 > > To: dev@dpdk.org > > Cc: Yang, Qiming ; Wu, Jingjing > > ; Zhang, Qi Z ; Wang, Haiy= ue > > ; Xing, Beilei > > Subject: [PATCH v2 5/5] net/iavf: support new VLAN virtchnl opcodes > > > > The new VLAN virtchnl opcodes introduce rich capabilities setting like > > outer/inner different TPIDs. > > > > Signed-off-by: Haiyue Wang > > --- > > drivers/net/iavf/iavf.h | 6 ++ > > drivers/net/iavf/iavf_ethdev.c | 46 +++++++++++ > > drivers/net/iavf/iavf_vchnl.c | 147 +++++++++++++++++++++++++++++++++ > > 3 files changed, 199 insertions(+) > > > > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > > 6d5912d8c..c57ad6175 100644 > > --- a/drivers/net/iavf/iavf.h > > +++ b/drivers/net/iavf/iavf.h > > @@ -132,6 +132,7 @@ struct iavf_info { > > struct virtchnl_version_info virtchnl_version; > > struct virtchnl_vf_resource *vf_res; /* VF resource */ > > struct virtchnl_vsi_resource *vsi_res; /* LAN VSI */ > > + struct virtchnl_vlan_caps vlan_v2_caps; > > uint64_t supported_rxdid; > > uint8_t *proto_xtr; /* proto xtr type for all queues */ > > volatile enum virtchnl_ops pend_cmd; /* pending command not > > finished */ @@ -288,7 +289,9 @@ int iavf_check_api_version(struct > > iavf_adapter *adapter); int iavf_get_vf_resource(struct iavf_adapter > > *adapter); void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev); in= t > > iavf_enable_vlan_strip(struct iavf_adapter *adapter); > > +int iavf_enable_vlan_strip_v2(struct iavf_adapter *adapter); > > int iavf_disable_vlan_strip(struct iavf_adapter *adapter); > > +int iavf_disable_vlan_strip_v2(struct iavf_adapter *adapter); > > int iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid, > > bool rx, bool on); > > int iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid, @= @ - > > 302,6 +305,7 @@ int iavf_configure_rss_key(struct iavf_adapter *adapter= ); > > int iavf_configure_queues(struct iavf_adapter *adapter, > > uint16_t num_queue_pairs, uint16_t index); int > > iavf_get_supported_rxdid(struct iavf_adapter *adapter); > > +int iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter); > > int iavf_config_irq_map(struct iavf_adapter *adapter); int > > iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num, > > uint16_t index); > > @@ -315,6 +319,8 @@ int iavf_config_promisc(struct iavf_adapter *adapte= r, > > bool enable_unicast, int iavf_add_del_eth_addr(struct iavf_adapter > > *adapter, > > struct rte_ether_addr *addr, bool add); int > > iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool a= dd); > > +int iavf_add_del_vlan_v2(struct iavf_adapter *adapter, uint16_t vlanid= , > > + bool add); > > int iavf_fdir_add(struct iavf_adapter *adapter, struct iavf_fdir_conf = *filter); > > int iavf_fdir_del(struct iavf_adapter *adapter, struct iavf_fdir_conf *= filter); > > int iavf_fdir_check(struct iavf_adapter *adapter, diff --git > > a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index > > 0fd06e4b4..4d946013c 100644 > > --- a/drivers/net/iavf/iavf_ethdev.c > > +++ b/drivers/net/iavf/iavf_ethdev.c > > @@ -384,6 +384,14 @@ iavf_dev_configure(struct rte_eth_dev *dev) > > vf->max_rss_qregion =3D IAVF_MAX_NUM_QUEUES_DFLT; > > } > > > > + /* Vlan stripping setting v2 */ > > + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2) { > > + if (dev_conf->rxmode.offloads & > > DEV_RX_OFFLOAD_VLAN_STRIP) > > + iavf_enable_vlan_strip_v2(ad); > > + else > > + iavf_disable_vlan_strip_v2(ad); > > + } > > + > > /* Vlan stripping setting */ > > if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) { > > if (dev_conf->rxmode.offloads & > > DEV_RX_OFFLOAD_VLAN_STRIP) @@ -992,6 +1000,13 @@ > > iavf_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int= on) > > struct iavf_info *vf =3D IAVF_DEV_PRIVATE_TO_VF(adapter); > > int err; > > > > + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2) { > > + err =3D iavf_add_del_vlan_v2(adapter, vlan_id, on); > > + if (err) > > + return -EIO; > > + return 0; > > + } > > + > > if (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)) > > return -ENOTSUP; > > > > @@ -1001,6 +1016,27 @@ iavf_dev_vlan_filter_set(struct rte_eth_dev *dev= , > > uint16_t vlan_id, int on) > > return 0; > > } > > > > +static int > > +iavf_dev_vlan_offload_set_v2(struct rte_eth_dev *dev, int mask) { > > + struct iavf_adapter *adapter =3D > > + IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > > + struct rte_eth_conf *dev_conf =3D &dev->data->dev_conf; > > + int err; > > + > > + if (mask & ETH_VLAN_STRIP_MASK) { > > + if (dev_conf->rxmode.offloads & > > DEV_RX_OFFLOAD_VLAN_STRIP) > > + err =3D iavf_enable_vlan_strip_v2(adapter); > > + else > > + err =3D iavf_disable_vlan_strip_v2(adapter); > > + > > + if (err) > > + return -EIO; > > + } > > + > > + return 0; > > +} > > + > > static int > > iavf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask) { @@ -10= 10,6 > > +1046,9 @@ iavf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask) > > struct rte_eth_conf *dev_conf =3D &dev->data->dev_conf; > > int err; > > > > + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2) > > + return iavf_dev_vlan_offload_set_v2(dev, mask); > > + > > if (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)) > > return -ENOTSUP; > > > > @@ -1861,6 +1900,13 @@ iavf_init_vf(struct rte_eth_dev *dev) > > } > > } > > > > + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2) { > > + if (iavf_get_vlan_offload_caps_v2(adapter) !=3D 0) { > > + PMD_INIT_LOG(ERR, "failed to do get VLAN offload > > v2 capabilities"); > > + goto err_rss; > > + } > > + } > > + > > iavf_init_proto_xtr(dev); > > > > return 0; > > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchn= l.c index > > 3f949c9e3..6b571924f 100644 > > --- a/drivers/net/iavf/iavf_vchnl.c > > +++ b/drivers/net/iavf/iavf_vchnl.c > > @@ -174,6 +174,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, > > struct iavf_cmd_info *args) > > case VIRTCHNL_OP_VERSION: > > case VIRTCHNL_OP_GET_VF_RESOURCES: > > case VIRTCHNL_OP_GET_SUPPORTED_RXDIDS: > > + case VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS: > > /* for init virtchnl ops, need to poll the response */ > > do { > > result =3D iavf_read_msg_from_pf(adapter, args- > > >out_size, @@ -366,6 +367,45 @@ iavf_enable_vlan_strip(struct > > iavf_adapter *adapter) > > return ret; > > } > > > > +int > > +iavf_enable_vlan_strip_v2(struct iavf_adapter *adapter) { >=20 > Why we don't use one function to implement vlan strip v2? > iavf_switch_vlan_strip_v2(struct iavf_adapter *adapter, bool on) > args.ops =3D on ? VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2 > : VIRTCHNL_OP_DISABLE_VLAN_STRIPPING_V2; Make the code align to VLAN v1, like: /* Vlan stripping setting v2 */ if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2) { if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) iavf_enable_vlan_strip_v2(ad); else iavf_disable_vlan_strip_v2(ad); } /* Vlan stripping setting */ if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) { if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) iavf_enable_vlan_strip(ad); else iavf_disable_vlan_strip(ad); } >=20 > > + struct iavf_info *vf =3D IAVF_DEV_PRIVATE_TO_VF(adapter); > > + struct virtchnl_vlan_offload_caps *offload_caps; > > + struct virtchnl_vlan_strip vlan_strip; > > + struct iavf_cmd_info args; > > + bool outer; > > + int ret; > > + > > + offload_caps =3D &vf->vlan_v2_caps.offloads; > > + if (offload_caps->outer_stripping & > > VIRTCHNL_VLAN_ETHERTYPE_8100) > > + outer =3D true; > > + else if (offload_caps->inner_stripping & > > VIRTCHNL_VLAN_ETHERTYPE_8100) > > + outer =3D false; > > + else > > + return -ENOTSUP; > > + > > + memset(&vlan_strip, 0, sizeof(vlan_strip)); > > + vlan_strip.vsi_id =3D vf->vsi_res->vsi_id; > > + if (outer) > > + vlan_strip.outer_ethertype_setting =3D > > + VIRTCHNL_VLAN_ETHERTYPE_8100; > > + else > > + vlan_strip.inner_ethertype_setting =3D > > + VIRTCHNL_VLAN_ETHERTYPE_8100; > > + > > + args.ops =3D VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2; > > + args.in_args =3D (uint8_t *)&vlan_strip; > > + args.in_args_size =3D sizeof(vlan_strip); > > + args.out_buffer =3D vf->aq_resp; > > + args.out_size =3D IAVF_AQ_BUF_SZ; > > + ret =3D iavf_execute_vf_cmd(adapter, &args); > > + if (ret) > > + PMD_DRV_LOG(ERR, "fail to execute command > > +VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2"); > > + > > + return ret; > > +} > > + > > int > > iavf_disable_vlan_strip(struct iavf_adapter *adapter) { @@ -387,6 +42= 7,45 > > @@ iavf_disable_vlan_strip(struct iavf_adapter *adapter) > > return ret; > > } > > > > +int > > +iavf_disable_vlan_strip_v2(struct iavf_adapter *adapter) { >=20 > Same comment. >=20 Ditto. > > 2.29.2