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 DD924A04B0; Wed, 9 Dec 2020 18:55:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 354BEC924; Wed, 9 Dec 2020 18:55:33 +0100 (CET) Received: from us-smtp-delivery-181.mimecast.com (us-smtp-delivery-181.mimecast.com [63.128.21.181]) by dpdk.org (Postfix) with ESMTP id A6E0BBE79 for ; Wed, 9 Dec 2020 18:55:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rbbn.com; s=mimecast20180816; t=1607536529; 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=6nCoheE2g3fp6GOIN1dryRMt7d/QKsk7Ah/ayI9WCQ4=; b=Q/hpcuTWgTxs3JHl1KK7kIT6TFsn0v48zxzCW/NzhWiUvrBsTqUiIg9Tvh/QWzVeuuuBMT +sTENIUaiyEFTpNB/ftnVEYfSiUwwK5IB6iLXNvZifudXLP+KDLUJ7f8Xl9klz+Ks4sc8R onZLcSOOZBeCSqWa9uy86RUb31CaxRo= Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-dWoEeFOuPqGLJOZZsyh_eQ-1; Wed, 09 Dec 2020 12:55:27 -0500 X-MC-Unique: dWoEeFOuPqGLJOZZsyh_eQ-1 Received: from DM6PR03MB4777.namprd03.prod.outlook.com (2603:10b6:5:18b::26) by DS7PR03MB5544.namprd03.prod.outlook.com (2603:10b6:5:2d3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.14; Wed, 9 Dec 2020 17:55:26 +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 17:55:25 +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 12:55:16 -0500 Message-Id: <20201209175516.11844-1-sodey@rbbn.com> X-Mailer: git-send-email 2.9.3.windows.1 X-Originating-IP: [72.70.55.110] X-ClientProxiedBy: BL1PR13CA0150.namprd13.prod.outlook.com (2603:10b6:208:2bb::35) 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 BL1PR13CA0150.namprd13.prod.outlook.com (2603:10b6:208:2bb::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3654.7 via Frontend Transport; Wed, 9 Dec 2020 17:55:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c549813a-cdb1-4d5a-48ca-08d89c6b9ba6 X-MS-TrafficTypeDiagnostic: DS7PR03MB5544: 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: Wpht2jN35FdiCk7Q7gnpjoj6Nnpy2HYSJwncDyMlyiNQMmUHGLrjqUijfRfCibnHnlcGxgBOn9l5DsC6FWGF6FnPp9O2t4EdjRz0cZVI5bd2uryh/0Fp4yA8Dy1OUGTOTmijZgcsbiRdy67+ASKNXQgXkj4lDBGT9rYbToU94X4QMjj9R98eeNKQV4lpnV8VMWPXLTOxCNRyTPcZBkx50EKQnrGpgzCpTlkTpGo3QmgmJW0pnRV7r1AZIvuFuSVfsPR8AK6TR3WumL7dhGriRYNrfnmTZWkPB4DjylEub//wAXx5efCJ3HEGWYRckSOeq43NmpXHZihu1gmq3e54GUWdQSvL3mSvrozfiFGuKcWplhz+YsH2s/yV4TNRWXK+ 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)(136003)(376002)(346002)(66556008)(66476007)(66946007)(5660300002)(2906002)(8936002)(508600001)(1076003)(36756003)(8676002)(4326008)(6666004)(34490700003)(86362001)(6512007)(26005)(107886003)(2616005)(956004)(16526019)(186003)(83380400001)(6486002)(52116002)(6506007); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?Fia3l2KAo3mYzhlaS2LA6HLLZQS8k7mYRsz0HZ6jw24gRNcQp7hrqrkEW6si?= =?us-ascii?Q?b5rK7/r0UyJy8FqfuJ6QrpgcnWrXkaItFdsMYczhnMe6VIWThH0ownSAs8di?= =?us-ascii?Q?Y/j/byO+Jfv0OXKLxZgNguTrwekaz8GAM5qmmu6QpcvEjfSy+jBBpbFSYIgJ?= =?us-ascii?Q?Ur4/Bo+0f3r/qOilz7y9KnsQm53GX5G9xndTP266TxualHDpTjRCN041xQqp?= =?us-ascii?Q?yAvT65Jo4pZmARPDxWzdeoXeOnmSUFbWEzGx6GJiTkb1/T4oxItNxXonUuh1?= =?us-ascii?Q?ryYLL12N79sVFSEj5OCCMFAn6vj7PyvqNvN7S/UuCmGVvYP7+XWUQ8Rl9UCV?= =?us-ascii?Q?PyMxM6eKIMfRisznndnt7fYpFdgLZefwXoLfPZ/XwU1Ha/lK1dGkx8SnALb8?= =?us-ascii?Q?okw13EPfE5hlLAgXC1fV9M6CKCoIY45gabfkxZu98+hrrBaXDd7xU/PQcDtY?= =?us-ascii?Q?xJ7bC3cP759Xeb6dEtOwseI/P0kSXhblolClJWdCRJkbWjiu54Z7Sp0XahML?= =?us-ascii?Q?Qep9q8hy5+II9QGVerol20pNsxmKKI+o1iZnNzh56mZGENte4HghhNEG2KER?= =?us-ascii?Q?LPaPEieW6bCiCPtEq/VIF64qDVFPK1ESVWt84IAdSLtyMamzdIpuDdFuMTV+?= =?us-ascii?Q?d4v+anh7NmPz0fAdlOve/2LHLIF9VwcY4LSLxQ9aRU03tjes/F1VOzMm8VJ2?= =?us-ascii?Q?/G3v9cjfvne+m0P8zZJCd/8YFuHLlh5sD2j8l31orlrQj/JVGpCkP3ndBEAT?= =?us-ascii?Q?Sp2XVC+tp4ISjAZ21O1SlGlS2Or7s0asvhw+6ID7LQxwh6eYPuYhSAGZcVAL?= =?us-ascii?Q?RLxrAYlOz9ZOyL6K7sdEKB2V1cOStrj8diEVIfD4RD/1yYaPFm9fd7XUGgD1?= =?us-ascii?Q?BejnPu6PjYokf7As/BYRh328P5qd+u/tXFtWYZ+cQDTwxmj7gpq95TktPMKT?= =?us-ascii?Q?sPgl8IwIHY4Xx4CXnHabvMURUxzoCKt2fNj+OsOWme7ZXsL78VGeLFVnotzI?= =?us-ascii?Q?/cC3?= 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 17:55:25.8875 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 29a671dc-ed7e-4a54-b1e5-8da1eb495dc3 X-MS-Exchange-CrossTenant-Network-Message-Id: c549813a-cdb1-4d5a-48ca-08d89c6b9ba6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kDqx6oG5nGUfA+jP/hU/mZHQyJSMQ2o0OICvrrb1ljeQnjBpO9RAY6CFpPgkS6LT X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR03MB5544 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