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 5CB1BA0A0E for ; Mon, 10 May 2021 18:18:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55FAE40395; Mon, 10 May 2021 18:18:59 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) by mails.dpdk.org (Postfix) with ESMTP id CCFA440395 for ; Mon, 10 May 2021 18:18:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=faHjYvUrUIzDEBEWeZiocm6lrzveFyvSHs6DxIehEtMD1bRNn/o6JVx+W+qgMPAiW42oM9fy5HlacKr5DV4r+WpcDttqh0LCnvaF6svL7GJ0VWj9PuaF3rTfvUOQlDIIIX3idhG1kg1G9NQP7BxMetT7DFWQN3bmHBrcGcCyZwWmz+r+UD2zPMSaOl7qltVzHL4F4f55EL5ylLhaDd0D2s4mnyNxBDrO/2mp29m0jQCn5CxydcFIvQBhuLuLAkyJ4H03tVjNc73r1nGOtrPVkS7q4lOLvkAt1l91oTIY46WjcipT3XLU2hVHJxIneeODAyhN9s4q3TBM+9oIXYkI1g== 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=7peidwCKjwdRWw7E3UdH7X35fqmvrsP7K7ApuTgM1+0=; b=O/oSIzUEKaWu1HAC1AQvqdL8locGKC2AqH5SntK13evCIhC/5F43MSkxsWhWKovbbkK8wHTZ8ijCNWXHFGJClSxZp0RDx4MPFPdhnTmfhNIwUm//Z13Ya6fVSaVgAIX0+TbcRvdfFQCULd53+NjhMAmLJUtCL9hiGAxw8o6+a+jlXxO9Byv4FJaQbKMqzizrcvxgp2Q9j0vJUuqzBdlkvTVB4c9i1KJBpDs9OEYN6ptaQIoMjLsoXxBlkR+WU2zjZ0Q8AI+2WnP+GH+p4Ayy0ViVEPm6yiTbdHWZW3hnot/hIjx60wMTx/oCmrxLpeoq4AsFQV3ABCIT5BrWN2VgQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7peidwCKjwdRWw7E3UdH7X35fqmvrsP7K7ApuTgM1+0=; b=Gwhifpg9T3SEMq6Tzi5fdL7FaYMN19yGr7feP9ljrkP/VF7eOvyAC0+qcw6aa6Tw3Zk+8LDygZeow2+1iBkFkf/jin8mQZrTJ+jSKLkxfa5OX3aUPV2lOABXyMsqvm8nHD82fJYhnd0Q1bUhdsHdy7J4HtktGKWuRuu+TSnqjHxfkzwj+ZIkmdT85XAFIgdNPToShOXsLZMG1fgsGzlGySW/SmGqQmGrdT+Yw4Lyo0r+ruVnJojTg2br1JGPpNj7skXX6Lf/pmCr5JDhrCNuzckxehsCtLC+BtCnkTDC4rQgxwhl1FyF2zBE+VFFHQZI0qL+r6vy9e7KdaU6xxdW7A== Received: from DS7PR03CA0138.namprd03.prod.outlook.com (2603:10b6:5:3b4::23) by BN8PR12MB3491.namprd12.prod.outlook.com (2603:10b6:408:41::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24; Mon, 10 May 2021 16:18:57 +0000 Received: from DM6NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b4:cafe::60) by DS7PR03CA0138.outlook.office365.com (2603:10b6:5:3b4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:18:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT039.mail.protection.outlook.com (10.13.172.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:18:56 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:18:54 +0000 From: Xueming Li To: Chengwen Feng CC: Luca Boccassi , Min Hu , dpdk stable Date: Tue, 11 May 2021 00:01:47 +0800 Message-ID: <20210510160258.30982-158-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5a04d7b-c3fd-4109-f87d-08d913cf4fac X-MS-TrafficTypeDiagnostic: BN8PR12MB3491: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 66cTD6y6iUYXgez0WIZYI4DIg/tmzhyUsYgHykBP7AGOs1qLMnynOJSlppWm4+L72e281CiwNiTSDe6o9uK97gQjQA28E5BwCHAlFr1hM+yPLEDqcCINGhXxaoB/nGo5zEhs39gSCwRo8ETiGNM7h01YNwPVs4+/sAP00RkRfLkFLt1uNJ3aeJRihWontLWv72be7DjXbNlH1QrUIocvaIU/e/ARgOyRj4pzOuisx0Z0xF6hL4UY0CpahB2rHHNt2J74JK5qm/Z9M12LApGC7iz+WsmnsyS2fMbPMmn8GJ/JMmu0swihLKBqTwjA0hc6YQUZiKw8XQoyH91vBmQRG+EHjl4NppfMPTVWlYgNCiGRtztGVEAlWf292waE0V0abXw877sfB8+EawYGmNKYtSCFO7QhyQmmSW0qFUpV1czWGwA6SHdvcoLEQrMRz5ryiCfosx9D/1AeEpzGdcoUIjFiO3cxr1dS2hCz2uGkFd3uRmYh/ZmDR4Eikeg2S0pwjCx5eMXxn7MF9eA2/y4ezY+z8mgAAKQnV6JPnOrPgoSJto1kUrXf2HPslNFUAf7+jrLhHUjhhKxEx9nCUkyEp+k5hbr8pVD0qMQrebxQQRavD+cMkM1iPBDbCzioc0LeUA2Sw4ZTcnN6oDhXwDFTZsliXgKeLjbPm4ZGIk0g0XIuYTWOxSGhOYf+8bDmJmMy2vM+EBqXLVe19Ezr8NL4pw6t7qGNi9sHcasF6qHsbsPfhhLKxwaseUmngzq7UVqLYSBqoVtARj+yVn1dUe3nNA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(396003)(136003)(346002)(376002)(36840700001)(46966006)(53546011)(6916009)(356005)(316002)(36860700001)(6286002)(4326008)(7696005)(2906002)(36906005)(5660300002)(54906003)(16526019)(82740400003)(2616005)(186003)(8676002)(26005)(47076005)(55016002)(70586007)(70206006)(966005)(6666004)(36756003)(478600001)(336012)(8936002)(86362001)(426003)(1076003)(7636003)(82310400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:18:56.4480 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5a04d7b-c3fd-4109-f87d-08d913cf4fac X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3491 Subject: [dpdk-stable] patch 'net/hns3: fix flow counter value' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/bb24098f63cf85382dcd330468458060084a11c5 Thanks. Xueming Li --- >From bb24098f63cf85382dcd330468458060084a11c5 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Wed, 31 Mar 2021 18:01:40 +0800 Subject: [PATCH] net/hns3: fix flow counter value Cc: Luca Boccassi [ upstream commit a06c3b0e9f0a4807ee8ac145f58284ec49f2f33d ] User could create flow rules with specified counter by the action of RTE_FLOW_ACTION_TYPE_COUNT, but the counter may retain the original value when create. This patch fix the bug by read the counter when creating the rule because the counter is read-clear. Fixes: fcba820d9b9e ("net/hns3: support flow director") Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_flow.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index af0aa72482..ba77defb08 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -158,7 +158,10 @@ hns3_counter_new(struct rte_eth_dev *dev, uint32_t shared, uint32_t id, { struct hns3_adapter *hns = dev->data->dev_private; struct hns3_pf *pf = &hns->pf; + struct hns3_hw *hw = &hns->hw; struct hns3_flow_counter *cnt; + uint64_t value; + int ret; cnt = hns3_counter_lookup(dev, id); if (cnt) { @@ -171,6 +174,13 @@ hns3_counter_new(struct rte_eth_dev *dev, uint32_t shared, uint32_t id, return 0; } + /* Clear the counter by read ops because the counter is read-clear */ + ret = hns3_get_count(hw, id, &value); + if (ret) + return rte_flow_error_set(error, EIO, + RTE_FLOW_ERROR_TYPE_HANDLE, NULL, + "Clear counter failed!"); + cnt = rte_zmalloc("hns3 counter", sizeof(*cnt), 0); if (cnt == NULL) return rte_flow_error_set(error, ENOMEM, -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:30.715474700 +0800 +++ 0159-net-hns3-fix-flow-counter-value.patch 2021-05-10 23:59:26.610000000 +0800 @@ -1 +1 @@ -From a06c3b0e9f0a4807ee8ac145f58284ec49f2f33d Mon Sep 17 00:00:00 2001 +From bb24098f63cf85382dcd330468458060084a11c5 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit a06c3b0e9f0a4807ee8ac145f58284ec49f2f33d ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index 711eed3f54..098b191909 100644 +index af0aa72482..ba77defb08 100644