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 AF64CA04E6; Wed, 9 Dec 2020 17:23:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A65DC8F8; Wed, 9 Dec 2020 17:23:56 +0100 (CET) Received: from us-smtp-delivery-181.mimecast.com (us-smtp-delivery-181.mimecast.com [216.205.24.181]) by dpdk.org (Postfix) with ESMTP id 1316598 for ; Wed, 9 Dec 2020 17:23:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1607531032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QghlreYvjyaB9oQxN5qIBT3ypbI+a8SgQ3DKvueJoBI=; b=OaskiISvpl3PUs3qb4lfeo7zI74vMkpslhjBl6wQBxbD4svKW0P5eZtJs23fhs9HCgOC5K TF6s5cBxOb9yDYEd0WcQfKvN8RGLR6DtIzmIJxp9qwbHogFm85GN7qIEFmKjxMrhvOFTdR 5Lo+m/Pt71iXKFIGeBlkqxWDKYGtBsA= Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2054.outbound.protection.outlook.com [104.47.36.54]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-8ZT_92efMm2wkJFPUUCOaQ-1; Wed, 09 Dec 2020 11:23:50 -0500 X-MC-Unique: 8ZT_92efMm2wkJFPUUCOaQ-1 Received: from DM6PR03MB4777.namprd03.prod.outlook.com (2603:10b6:5:18b::26) by DM6PR03MB5116.namprd03.prod.outlook.com (2603:10b6:5:1e4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.13; Wed, 9 Dec 2020 16:23:48 +0000 Received: from DM6PR03MB4777.namprd03.prod.outlook.com ([fe80::5cc0:8293:cf4f:44f4]) by DM6PR03MB4777.namprd03.prod.outlook.com ([fe80::5cc0:8293:cf4f:44f4%6]) with mapi id 15.20.3654.013; Wed, 9 Dec 2020 16:23:48 +0000 From: Souvik Dey To: beilei.xing@intel.com, jia.guo@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, Souvik Dey Date: Wed, 9 Dec 2020 11:23:38 -0500 Message-Id: <20201209162338.10320-1-sodey@rbbn.com> X-Mailer: git-send-email 2.9.3.windows.1 X-Originating-IP: [72.70.55.110] X-ClientProxiedBy: BL1PR13CA0219.namprd13.prod.outlook.com (2603:10b6:208:2bf::14) To DM6PR03MB4777.namprd03.prod.outlook.com (2603:10b6:5:18b::26) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from SODEY-LMA.sonusnet.com (72.70.55.110) by BL1PR13CA0219.namprd13.prod.outlook.com (2603:10b6:208:2bf::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3654.9 via Frontend Transport; Wed, 9 Dec 2020 16:23:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 75ec1388-ff4a-4f3a-ab67-08d89c5eced7 X-MS-TrafficTypeDiagnostic: DM6PR03MB5116: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: LkmSdE/UOTEN+2qnqv+BUsPvWBIOFm7aPnUy+lhsW0fdZmBbW3TiLVvGq51iwKP7mIZxQNcegvnW/6Qb4sGkS9HpwTpJbUE+9g9Da7Mv8HDdko7LK5VFmy3sTh+Qsybvfze7Kv9bP0CT2DvOtcUZK0DM8H/oNBI4af1kr8u8ui1J8zDjOLWMADrTPmkvjcX+TulmnltCx17Vq04VCpOtNt0mPiLCJ0q2QPNVM5OSzZ8sMQy79zoKJkpOYJM9IXD1fSDiGi2+uLNUbRqkzCMwcBVpSqhcou5qpvFXRbY4Dg02q/VwhLqCSm8JOUI4SLGzRWc9uVx6OE4Z8RQNSx+Rz1V7rcA/XhWScAlv0KCbOeEUAAHaZKZJt91yVOmjc/Q7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR03MB4777.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(136003)(376002)(86362001)(1076003)(6506007)(5660300002)(956004)(66946007)(66476007)(66556008)(6666004)(2616005)(4326008)(6512007)(52116002)(26005)(36756003)(508600001)(186003)(34490700003)(6486002)(8676002)(107886003)(8936002)(83380400001)(2906002)(16526019); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?jfk+CuVXzOsdN+aKOt8wtD16P2yj6Qh4WNzUkHxn6kPEnsAkKCjo6qLyPo3U?= =?us-ascii?Q?4H0JOlrmpzfRf2pJvxSr0Hzsc8pGddBBJVNo/h66HWZj+JHzwHg4FHrQOn5R?= =?us-ascii?Q?c2PsexrF58+v8po6Bz9X73IlxoVKq+jpeNpqVi7vCI9WAFQk10EXVPOqt5Xh?= =?us-ascii?Q?ecpFVtKEm8BLf8sEemRFVH/wnIMFC3LarY80PZPZTnQfaYNHg0qGuSfeu7Ry?= =?us-ascii?Q?6/2isfjugFePPUT5lt1kOK1CIoiL1enVGaTmJi8STBoNSw1qdIky9ZRtsMJa?= =?us-ascii?Q?lorV4IVFktJyNXMQqUiEzuA8muclSDZ8npRbfUogheLTQGDzWjvLmqqTJnwz?= =?us-ascii?Q?Avd8TOFeDJOW1vK5kwI6IuXKTzIWf4iXgZbrRqIa0eiA8849PAJbfzPakU0W?= =?us-ascii?Q?hy5slrYdV52oATXKJdp8PrijidEafDG4fGNfZT6H7L3171PUC+Pt1KQa9OFG?= =?us-ascii?Q?TEBYIEPuAG2ceUUmdsYb4Jfvcb/w4PqFz0pFJ6p7hikq2AsnWYRmuL7nhOQh?= =?us-ascii?Q?VtzISgRxMu27nszdyzU2qimbcU+DwFcreN57J6ASjXgytYg+5ip/Bfg6ebgg?= =?us-ascii?Q?huiUiFRyI+LKmf7sMBydHofiTzJqEFS0O1wLNwYVvnUPDBnizD/IbNG+h8Lk?= =?us-ascii?Q?zq3paf95sP/eCzU+MCNH442PxSyTPBs2VgPMsPLowLDK+vDEpnlqXloEf2Ue?= =?us-ascii?Q?wq4qRzGD+4SpTiTY3un/+pZgym+EWS8tWbFAh3ZvXQ1cvayrchmQ0P8SidJn?= =?us-ascii?Q?Jqid0fN8dexST3Xv0YfpanzvvvL3+lGC3SkDE5NuIYc+/Z/qdSSR+CRJ9QCA?= =?us-ascii?Q?i8bEle9Ufxq7voOVOCR8Y3fKmskxNgzrkLitdDoRQYDAqyQCH3Q9sNEQsjSk?= =?us-ascii?Q?JoR0+oZ9SBf0l4eTqZjE6Jb5jeIeDW8nUit/K9RMu2TF859mUUHx/iJn38F+?= =?us-ascii?Q?SQYGC+qhNlrNpf/7zt81GB92X1X3iXkMvV0NXsI8eblJXibprUNgTAjqBPPo?= =?us-ascii?Q?T254?= X-OriginatorOrg: rbbn.com X-MS-Exchange-CrossTenant-AuthSource: DM6PR03MB4777.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2020 16:23:48.2745 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-CrossTenant-Network-Message-Id: 75ec1388-ff4a-4f3a-ab67-08d89c5eced7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ciq+L+mXjx63rDXyoEKclKk1XOFfEwAueUM02ZiJLxTjV8v/jQD6gXF/NX94fLYZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5116 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA81A106 smtp.mailfrom=sodey@rbbn.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: rbbn.com Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH] net/i40e: issue with ADD VLAN from Guest 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" In case of i40evf pmd, when ADD_VLAN is sent down the linux i40e driver, along with add the vlan the kernel driver also enables the vlan stripping by default. This might have issues if the app configured DEV_RX_OFFLOAD_VLAN_STRIP as off at the port configuration. The app after adding the VLAN will expect the VLAN to be coming in the received packets but, due to VLAN_STRIP enabled at the PF, it will get stripped. This behavior of the Linux driver causes confussion with the DPDK app using i40e_pmd. So it is better to reconfigure the vlan_offload, which checks for DEV_RX_OFFLOAD_VLAN_STRIP flag in the dev_conf and enables or disables the vlan strip in the PF. Also rte_eth_dev_set_vlan_offload() to disable VLAN_STRIP cannot be used from the application, as this will only work for the first time when original and current confi mismatch, but for all subsequent call it will ignore it. Signed-off-by: Souvik Dey --- drivers/net/i40e/i40e_ethdev_vf.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethd= ev_vf.c index c26b036..2ecf74b 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1078,8 +1078,19 @@ i40evf_add_vlan(struct rte_eth_dev *dev, uint16_t vl= anid) =09args.out_buffer =3D vf->aq_resp; =09args.out_size =3D I40E_AQ_BUF_SZ; =09err =3D i40evf_execute_vf_cmd(dev, &args); -=09if (err) +=09if (err) { =09=09PMD_DRV_LOG(ERR, "fail to execute command OP_ADD_VLAN"); +=09=09return err; +=09} +=09/* +=09 * In linux kernel driver on receiving ADD_VLAN it enables +=09 * VLAN_STRIP by default. So reconfigure the vlan_offload +=09 * as it was done by the app earlier. +=09 */ +=09err =3D i40evf_vlan_offload_set(dev, ETH_VLAN_STRIP_MASK) +=09if (err) +=09=09PMD_DRV_LOG(ERR, "fail to execute command disable_vlan_strip " +=09=09=09"as a part of OP_ADD_VLAN"); =20 =09return err; } --=20 2.9.3.windows.1