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 7028BA04FF; Tue, 24 May 2022 14:57:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92AE640140; Tue, 24 May 2022 14:57:27 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2055.outbound.protection.outlook.com [40.107.101.55]) by mails.dpdk.org (Postfix) with ESMTP id 467C1400D6; Tue, 24 May 2022 14:57:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KB0QmqSOyzgGcQ9t/8Sbl5eyBMJ7i7v4pKKm9Lw0GKbszQciHaMGu5ttei8+ZZdO/Bn0V5YSaGOM7OCGfndNmhMoEnFiUrl0WGhqdPtV34T1RxoGTu/L+ccCmmPTeqp2OLp0r6FVZ1WAnerryJBleHzjm717Bxqs9C6r5xp2j+/YWQw1rqQX2+0IjW8OvL8ebXdgXNvYHuut6fwlnJUfRgkI6wLuiO9AlPmz3G0QlnlEocoBQTchQVx+8lHy5WFMxGGQauUGzR75LIAoq9BFzJ4DjPMdu3RbR/jWnWf8QfYmR25hN6EYUDeBvVtOzTPe1Sh/ckG6Wb9St4kuGMHGPw== 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=owEwp02pf42Mo+vwEu0RLxgmp/vTIsyjPB9yKtFbU0U=; b=TTdg2F/iNqdISTefql6o/0tbqHFzfgZomQPBBkQUDKHp9Lu3EeLNBFPcA8O1JffiY2dt9/NdzIf+rx9w3lLSqaAoi8NBMKkPGyPVTxV1b0PxOeOKRASdH9L1mQdRb+gWQ8eQpIisbrCljjYHTNIUJEw+DPONj9ykz1AN/6lRI90xoFGONyB6GZGzvSwTScZszNoThagHij62b6BkBuMkzwksbG7IdxLzXx6H0ko4DttmiAZwwS90hFgiiB0FhNFbGNs3WnDDLG4yVx2pOJFSvALI40PLkZx7QXrHnzGm7uHuBEjPW35VpEe2xa5sgEBuzbsjsoN5+R0Mdh6ROmU/tQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 149.199.80.198) smtp.rcpttodomain=corigine.com smtp.mailfrom=amd.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=owEwp02pf42Mo+vwEu0RLxgmp/vTIsyjPB9yKtFbU0U=; b=oKyOEXEsta5WxysgHprTIyLcIREVrha9m9QTtmsN1btQXoXNBF7+HUGsDedwlDcCKI+gTMQgHOG8JGe/HW4V769iRQcpn34Sc4n6ZkqCiHlqn0uGffUQwEmWOLFX/mPpul8QO5ZA6nZ97NM/xg9+yidNEIAMOcZOGRh+arjDds0= Received: from SN7PR18CA0016.namprd18.prod.outlook.com (2603:10b6:806:f3::20) by BN0PR02MB7999.namprd02.prod.outlook.com (2603:10b6:408:16c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15; Tue, 24 May 2022 12:57:24 +0000 Received: from SN1NAM02FT0040.eop-nam02.prod.protection.outlook.com (2603:10b6:806:f3:cafe::d9) by SN7PR18CA0016.outlook.office365.com (2603:10b6:806:f3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.23 via Frontend Transport; Tue, 24 May 2022 12:57:24 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 149.199.80.198) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=amd.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning amd.com discourages use of 149.199.80.198 as permitted sender) Received: from xir-pvapexch01.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0040.mail.protection.outlook.com (10.97.5.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Tue, 24 May 2022 12:57:23 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 24 May 2022 13:57:22 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 24 May 2022 13:57:22 +0100 Envelope-to: peng.zhang@corigine.com, niklas.soderlund@corigine.com, niklas.soderlund@corigine.com, stable@dpdk.org, yong.xu@corigine.com, chaoyong.he@corigine.com, dev@dpdk.org Received: from [10.71.118.53] (port=19915) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1ntU6E-0001e7-DT; Tue, 24 May 2022 13:57:22 +0100 Message-ID: Date: Tue, 24 May 2022 13:57:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] net/nfp: fix the issue about set the vlan strip offload off Content-Language: en-US To: Peng Zhang , =?UTF-8?Q?Niklas_S=c3=b6derlund?= CC: , , Yong Xu , Chaoyong He , References: <20220419083857.409261-1-peng.zhang@corigine.com> From: Ferruh Yigit In-Reply-To: <20220419083857.409261-1-peng.zhang@corigine.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dad9d5fe-0681-4fe0-0653-08da3d84f2a6 X-MS-TrafficTypeDiagnostic: BN0PR02MB7999:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RCyOm3kKLOeiDnupWnSzM/649vjLAeCSe3jLjlvO3Ew0agP6RSO6IynZssBxeL8a3Hk61og/ehuqM5a1GlCjD25J8lboxBR6yhjx7hjEJYcJEsXVo2cTesIhyHE4evoaI1/ZaFy0AHrgrTYvW4wNKkZgsBPsaAXjSJ3rwO1v/GIoQgX+yZXWt1VG8OvIjXAg8A0UKqUXBUUn+nhv6ZpL38ZtrFp75D3WbC+nAhhooFDzzy34kmUo+Hn6ojB96+1v0GWgfEOfgSpf8qab6FXUg8wBE7ZiT14N7SSqNJ3fDZ69HIKfFPT/soitTihuWSb4OZpg7ubzUCAFIg3BMjQRjyL1oaEcyZYkXGk6wqhOHHmqM+drxKGGDyladzo1zeXfo8a52k4gTwF5Nn5e7H5zTxIW0bEJI27cV8T6fT9OjzwglbmlO0XrQYAT+doeInxSDVuDpjzDRkZ2MEOsN5+KOyEFdDVMQJ0uUrBaqoaPN3PVff1KRk06BrWyeugYa+eeIjRJZ3NqlXRf2R2nIPwSkkCl2l65IkNDGMzapuyhdF4khrNOXvquB5ayfaZsHDoUGv+T5pE/deWHIs6PHFo0MIORCEJg9skhfx4jNtbI35lx2Cma6gIaU7tHsP4jNOR4Tfw1BiyU06uaatF425+2ODn3YOh5OIfyqWeaTuMU23rvi4HzIE+KMraPz63YT+bAwwcQE5W9YkRW0946cF4hjwxLcfVUPw0bu/A/vhhEERc= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(508600001)(35950700001)(70586007)(70206006)(7636003)(9786002)(2906002)(110136005)(36756003)(86362001)(336012)(8936002)(47076005)(82310400005)(83380400001)(53546011)(8676002)(5660300002)(4326008)(2616005)(26005)(316002)(356005)(44832011)(40460700003)(31696002)(31686004)(54906003)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2022 12:57:23.9478 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dad9d5fe-0681-4fe0-0653-08da3d84f2a6 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0040.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7999 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 On 4/19/2022 9:38 AM, Peng Zhang wrote: > When set the vlan_strip_offload off, it doesn't work. > Because we can't update the msg in the nic. > > This patch will fix this error. > > Fixes: d4a27a3b092a ("nfp: add basic features") > Cc: stable@dpdk.org > > Signed-off-by: Peng Zhang > Signed-off-by: Yong Xu > Signed-off-by: Chaoyong He > --- > drivers/net/nfp/nfp_common.c | 21 ++++++++++----------- > 1 file changed, 10 insertions(+), 11 deletions(-) > > diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c > index b26770dbfb..ab4cfda389 100644 > --- a/drivers/net/nfp/nfp_common.c > +++ b/drivers/net/nfp/nfp_common.c > @@ -968,19 +968,18 @@ nfp_net_vlan_offload_set(struct rte_eth_dev *dev, int mask) > int ret; > > hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); > - new_ctrl = 0; > + new_ctrl = hw->ctrl; > > - /* Enable vlan strip if it is not configured yet */ > - if ((mask & RTE_ETH_VLAN_STRIP_OFFLOAD) && > - !(hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN)) > - new_ctrl = hw->ctrl | NFP_NET_CFG_CTRL_RXVLAN; > - > - /* Disable vlan strip just if it is configured */ > - if (!(mask & RTE_ETH_VLAN_STRIP_OFFLOAD) && > - (hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN)) > - new_ctrl = hw->ctrl & ~NFP_NET_CFG_CTRL_RXVLAN; > + if (mask & RTE_ETH_VLAN_STRIP_OFFLOAD) { > + /* Disable vlan strip just if it is configured */ > + if (hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN) > + new_ctrl = new_ctrl & ~NFP_NET_CFG_CTRL_RXVLAN; > + /* Enable vlan strip if it is not configured yet */ > + else > + new_ctrl = new_ctrl | NFP_NET_CFG_CTRL_RXVLAN; > + } Hi Peng, I think both old and new implementations are not correct, although new one is on the right track to fix. First 'mask' is filled with ethdev layer and can get one of below values: RTE_ETH_VLAN_STRIP_MASK RTE_ETH_VLAN_FILTER_MASK RTE_ETH_VLAN_EXTEND_MASK RTE_ETH_QINQ_STRIP_MASK So PMDs should check 'mask' against those values. 'RTE_ETH_VLAN_*_OFFLOAD' are the values passed by application to the ethdev layer. (Why ethdev layer converts them to different set of macros, I don't know :/ ) And PMD 'vlan_offload_set()' dev_ops having one of 'RTE_ETH_VLAN_*_MASK' macro means that config is changed, this doesn't say yet if it is enabled or disabled. 'dev->data->dev_conf.rxmode' needs to be checked to decide to enable or disable a config. Please check 'rte_eth_dev_set_vlan_offload()' API implementation for details. > > - if (new_ctrl == 0) > + if (new_ctrl == hw->ctrl) > return 0; > > update = NFP_NET_CFG_UPDATE_GEN;