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 1B17AA0547; Mon, 30 Aug 2021 07:23:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF3CB4068A; Mon, 30 Aug 2021 07:23:25 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 2667440142 for ; Mon, 30 Aug 2021 07:23:24 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10091"; a="240445721" X-IronPort-AV: E=Sophos;i="5.84,362,1620716400"; d="scan'208";a="240445721" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2021 22:23:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,362,1620716400"; d="scan'208";a="600272714" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga001.fm.intel.com with ESMTP; 29 Aug 2021 22:23:19 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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.2242.10; Sun, 29 Aug 2021 22:23:19 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Sun, 29 Aug 2021 22:23:18 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Sun, 29 Aug 2021 22:23:18 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Sun, 29 Aug 2021 22:23:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NS1OeqIqukZ15TxZ37AOWUT8vvpkUkIkQvhgTIh43h64eo0ogs6wl1IXEB55lkNWC8STxfUMF5R1gCzei8tvR4hSWUykoadR1oWBNT81gc8Nknue/xIk+YBbQbmRbekoAHvn4UQMZxFNuEdnlv8U0FN49Oz6rMX45OYMZDzRzngMVj3E1jciEfpfMLuZATeb3rNaqukBkg9XD70a4Z377+p4mbefUr53CF3D7b7I8yP+1D8qsztK0esHCj6rSo8d8VAhGRmGGewWwOQg6sZwynElZAADl8uu76Bi+9phu1nqsAyOO7CUuQckHRzaLrxAVY14J9iBC2B7+rCyUdSlUA== 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=IhofU8lmesJqOkohG9K6s6cQwWHDHdJ+4FTXN/X35Eg=; b=X+1ydRKbCC6oiR8ym6PAPnIk+BKNuKOJjSjOfuXTwdeLkGb2++8yikbdoLFH9WaLihvpH36gvr22zgVdupLatbAOfWD0mbCLjRyxaq1Bcsk/ss/ZrfqlW2knS/r+b0zUlFpetXtJJAzJWAPNJtZkf2NmJ6Y6hbd6TCXhwfvUR2guhd3TibLAHDusD2Nl4NhRQW7SNE8OI00ncT+jVHiMkjaQGdVDweCCRMrPcjYEcvHDK8B6DQvBx0D4OiuxI/U0DVeB8HLJVopA6ghR3Ogr1+bDDGj46ulZm36phMGr6nOlrFIpCbeat7+w5u+En0OemwdxBCURnWE1UJmqsFFqUQ== 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=IhofU8lmesJqOkohG9K6s6cQwWHDHdJ+4FTXN/X35Eg=; b=IpIkiMZoKcHaSlZ6kf14YCYYnIdq6j+7SwUxXThK5Ms9dJ+NYLmCq05nd2aQ3unFGliZ0Oj4saU1eQn9i40+NALClnlSmMDETI42XRz2bs74AwZ9U387EA9xTPMBjsTXT7DlcKzlcKcuHlwNZGVVfJgZi3q7C6z7xZV14VCkSu0= Received: from MN2PR11MB3807.namprd11.prod.outlook.com (2603:10b6:208:f0::24) by MN2PR11MB3790.namprd11.prod.outlook.com (2603:10b6:208:f6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.24; Mon, 30 Aug 2021 05:23:16 +0000 Received: from MN2PR11MB3807.namprd11.prod.outlook.com ([fe80::197b:884c:3d10:ee6a]) by MN2PR11MB3807.namprd11.prod.outlook.com ([fe80::197b:884c:3d10:ee6a%5]) with mapi id 15.20.4457.024; Mon, 30 Aug 2021 05:23:16 +0000 From: "Xing, Beilei" To: Qiming Chen , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] net/i40e: solve vf vlan strip Thread-Index: AQHXnURk2E6/lVgMfkGfUutN091AJKuLgc3A Date: Mon, 30 Aug 2021 05:23:16 +0000 Message-ID: References: <20210830020219.2605-1-chenqiming_huawei@163.com> <20210830020945.2715-1-chenqiming_huawei@163.com> In-Reply-To: <20210830020945.2715-1-chenqiming_huawei@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 163.com; dkim=none (message not signed) header.d=none;163.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9ce2f6c5-3d18-4c6f-6788-08d96b764560 x-ms-traffictypediagnostic: MN2PR11MB3790: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Vp/R7K+mjojIX++WnJQZCU9zEygSiVDmKWyYFU6vCvshYBKdx8q66R5r4Icv4ehjLA0Pa+xNowaIXm8DPxepWeLcjiU9wy9bWFQ4FGdtLsOO5R82dRWmfMcUdkCmBTDZfJRXgS9Y9irxLSBGyICRyd2+c5yd/3MHb4PTWuKAG9PUzQm40E42kmru/tSB2uC/47kIYA4yGisRx5UqCllYxpu+aGoJPmZoB4CSsa88nDa0gBPCcI+RGHYcLfZHeeL68Fc62R3jxvMTjjO2u4ndjJ7ECbD8spRs4AOaxZQTlwDuvAAMbwvbWTWS5ZI/lwk3eFWLzln5wNPE7gbyHn0GTGshf9OXzVgK9Y6/7C9kXgFu7NdIM/zSmIXs02AwDp52H/SXqYcFJ8xSfrICm+zUiMeAkyyu4wlYYICd3h1PUBQiXhBwGkxcBDGUQrMcXSaJtdMetyynf6bOG00u3FXg72+S9TYbCYDYCCbd5M+wGp5dSaQ9ppJG4jJW6hbE9YkogJmimaDY+G+Q/EuXl2uM7Kz1KCyno5zKmsNqhgH4UjjYxjFBRqyQlDGa826t+rzOUeoCLR2XRtAQXL7H+uap2I36SGE/kuW93JrVI77a8udB4oEiqdYdyNfGi5xQIBkoQ4H/rtsyMDnkKf6CQI6tiWZzQPM6UCdkhig425/q6Pqqdyp4HqO1JQLE17U5SNCi3yUmq1OEpNerGwhxo91Vng== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3807.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(83380400001)(186003)(508600001)(8676002)(2906002)(110136005)(55016002)(6506007)(53546011)(66446008)(33656002)(316002)(86362001)(9686003)(64756008)(122000001)(5660300002)(7696005)(38100700002)(38070700005)(8936002)(52536014)(71200400001)(66946007)(76116006)(66476007)(66556008)(26005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?y+2XvHh8g462F+CEhGPxIo5A4bTX4mZOMfYBU/jzwSJ2jACX3efh2fp78CrK?= =?us-ascii?Q?KeB8txBieCV749w1vKaSbU4n5bUiVRm+Qe/V/zYGKHIPS+njOYfoWt2M6HJd?= =?us-ascii?Q?q1715yEShELpIHRweMiBRD42sEqotVo9jwQMo2Qe5kgK4lxxVFlW+PnLyd6f?= =?us-ascii?Q?DdFMbS6FUypuWBAZr+DpjWa23dbPFunxXvpHixV3fFo9P5UGjYMd/JqbZsT+?= =?us-ascii?Q?NqWLgWydFjeZT31a1CcfHORM2bqi4ZXnJgl8jhBQtQhFxku1EY2WZcYvGv7A?= =?us-ascii?Q?4DS0DY1m0s4JBsNjxUknCCpmApraY1WQpF97O4U1fNMyiWR5rpK8VxlGVw/c?= =?us-ascii?Q?Hrp3wjke8GY+rFsKcghvjyB8dTCMP1Hdw5e1OBG4yNyBFEbHfOUrsh4hFeKJ?= =?us-ascii?Q?VG43JtunD5iJoolj7fyadpoDkXXzpZThCz2mFcrsF9ilY643eDjx6todr7y2?= =?us-ascii?Q?PqxatCliFoMzg1tLaxuGMhDFBkMImbbgk0PjG7CpladaesQreDzM7JYH4qLd?= =?us-ascii?Q?IpRTY0W6oiVbCDoWs+X+6pcNsgiJN1WPKhChQQ+hTetfp82g57Mu0IvjK+/+?= =?us-ascii?Q?ikJa0k+SYQ36l8Cpg7FP+GXB1wYfr9BTJDrQztqwq9Vt86Becup6qVBiDfX1?= =?us-ascii?Q?NME3SEDH+w+5kkGlMDhfKTqlfji9ABs2CGENCBIBKv4AHcfHUH1ka/ThA2Xi?= =?us-ascii?Q?dtDmWab6Pun9V8ylEw5R29nWGNt42ZzUDi33YVDiUxQ6lFp2F5ky7XnNp32D?= =?us-ascii?Q?hTmGkPn02ueQ+8AmFnq7hCik6ChvX7HMEhmWW3RVB0fccx5dpZ1jni0sn+5j?= =?us-ascii?Q?kNyg70WAra6lPmdkroXnEbBbdnfAfxL4xoV+9iYBdbhHqFIuHEH6jbr1A/a9?= =?us-ascii?Q?xCHPrmR1l3b0sBwdwuSnqX/AgoAvuBykeLTDRli3Gx9TFmqFLQlhGoIcrTBj?= =?us-ascii?Q?zQBmH0IZATQoU1r4XBGsBmfiNs4PPKMPjrQIzQuiXHSS5lbSMpw8eZX/4Thz?= =?us-ascii?Q?+HIcuCOAYwXM8wRz6HymU4Z3Wj4wkL9YHCS8VxTHbQr3vss0qTbGvQfOtRpn?= =?us-ascii?Q?jTX3PR+LQxXZ8kKNoY8SMlh8hu3SqjTpaPBueaKIxhjFSg011oBdv/38wKLj?= =?us-ascii?Q?zrmAxWkTxuJYn7R/qImkHPTaGB81EcWzklbMv0QZFWSEcyfUbctfXZHBIGWP?= =?us-ascii?Q?9HvrXuweEGsDYGfm052mgMcyOj6pHqKX0yuFYJBBq+2l3/AaA9DYzMHN1qkl?= =?us-ascii?Q?jerpZdwvlr2gICEZp52/qrAeaLhTQNB/sKw9ECmx3Qpa8EPvhqOM59eTicsB?= =?us-ascii?Q?XxyDrVXLxn0YaGpYSacQep4t?= x-ms-exchange-transport-forked: True 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: MN2PR11MB3807.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ce2f6c5-3d18-4c6f-6788-08d96b764560 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Aug 2021 05:23:16.3015 (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: cd1CsQmdTp5lRzfqk3Eoa0f1PYBOyitjYMCE2G7VEzd5Wvok7PRQyC6HG3Le4qmIA7iR2iGAqJk/QsXW6+UfZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3790 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: solve vf vlan strip 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 Sender: "dev" > -----Original Message----- > From: dev On Behalf Of Qiming Chen > Sent: Monday, August 30, 2021 10:10 AM > To: dev@dpdk.org > Cc: Xing, Beilei ; Qiming Chen > > Subject: [dpdk-dev] [PATCH v2] net/i40e: solve vf vlan strip >=20 > Kernel PF+DPDK VF mode, after vf adds vlan, the test result shows that th= e > vlan received from vf has been stripped. >=20 > The patch solves the problem that the kernel i40e.ko driver strips the vl= an by > default after vf adds vlan. Determine whether to strip vlan through the > DEV_RX_OFFLOAD_VLAN_STRIP mask bit in rxmode.offload. >=20 > Environmental information: > 1) dpdk 19.11 > 2) Kernel PF i40e.ko: 2.7.12 > 3) Firmware: 6.01 0x800034a3 1.1747.0 Thanks for the patch. As Qi mentioned, i40evf will be deprecated. So please don't submit the patc= h to master repo, but submit to LTS. Thanks. >=20 > I did not use testpmd to test vlan filter, but write Demo for testing bas= ed on > the following deployment: > 1) x710 nic, use 2 PFs, each PF virtualizes 1 VF > 2) 2 pf connected with fiber optic cable > 3) 2 vf are hard to pass through to the VM > 4) In vm, dpdk takes over the vf port, > 5) One port is used as the sending port, and the other port is used as th= e > receiving port, e.g. xmit portid is 0, rx portid is 1 >=20 > Use the default configuration for port 0 as the sender, and configure por= t 1 > as the receiving port as follows: > 1) rte_eth_dev_set_vlan_offload(1, ETH_VLAN_FILTER_OFFLOAD) > 2) rte_eth_dev_vlan_filter(1, 100, 1) >=20 > Do the following tests: > Demo constructs a message with vlan 100 to be sent from port 0, and found > that the vlan header of the message received from port 1 was stripped. >=20 > Signed-off-by: Qiming Chen > --- > v2: > Clear coding style quesion. > --- > drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > b/drivers/net/i40e/i40e_ethdev_vf.c > index 625981048a..267e7be0c6 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1852,11 +1852,15 @@ static int > i40evf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on= ) { > int ret; > + struct rte_eth_conf *dev_conf =3D &dev->data->dev_conf; >=20 > - if (on) > + if (on) { > ret =3D i40evf_add_vlan(dev, vlan_id); > - else > + if (!(dev_conf->rxmode.offloads & > DEV_RX_OFFLOAD_VLAN_STRIP)) > + i40evf_disable_vlan_strip(dev); > + } else { > ret =3D i40evf_del_vlan(dev,vlan_id); > + } >=20 > return ret; > } > -- > 2.30.1.windows.1