Message ID | 20221031160824.330200-4-michaelba@nvidia.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Raslan Darawsheh |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4313A0540; Mon, 31 Oct 2022 17:09:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12D494161A; Mon, 31 Oct 2022 17:08:51 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2089.outbound.protection.outlook.com [40.107.243.89]) by mails.dpdk.org (Postfix) with ESMTP id 7E37340E5A for <dev@dpdk.org>; Mon, 31 Oct 2022 17:08:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nBAtNmzUEcJrjfUTJPykqkZ8fDtMaU6O+km+ltuzfrpRh3KZspH10TbPu+t6hvoMwfLpV/ZQ5V1JDk2awxVDzICtmkyUQ84w1Fwo1JEHXSj423c2hMahGrF1l+dMFeUlZS73cMYW1kWhn86jJEXqt3f52uLVGdXem9GTt0Fw/A7U1GPcpAkpzTzISDRb0kwk5OcKScBtGZQwRNgnvQfGairtHtGZIt9ss+CdnVMvbF24m33pDWQCpBXqCGIKYXZU49XnAcsm+3EDu52I1GdgKyz/r0a8juvxcJdbD5taRW1yaWnKyH/f4BGlRPJifYg7BFGT7pXa/jr7biiZ80eJYA== 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=rlv5wSRGF7mZxCT3q9aqbcze4d0l6xfumaRBI8azqVI=; b=GilJ6Uo+fMGgCYQsstKo2/tl1DwkVHa9R9e0thiT8VJDXyDxN86QzB0owh3cKSkc2ZvU7yotJ3VKyNFMGGMrlTuuqoKhbfI/IFgcQc0QDtkzRlRANmaCqTbIMQafPRliKb/Ps2Sk8IUsmAU+fBTsajl4ypOb3IDeor4PjN8pTi50CRFgW6nazkSHl5U5xzzQsI67waGhhutXin3OKtOkFj6X2lw+kfSEDrHvy+N7JtzSqD/YpGYRE58FMGKxAQIqeQB3KBVn6f+LelGPKLwARKExbPw0X/m2/YUQcCJ5dlK0TMNRMRmqx/DGYcYxDAvqAQH1AVJyOCXos5JU4p9KTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=rlv5wSRGF7mZxCT3q9aqbcze4d0l6xfumaRBI8azqVI=; b=gdGBALTNKcNC43dZ3MOpghazphd5WjYksGrg0xKXxS3Yjt8G1FbKngv+e7yPDZSyZx7OEgZHhi0C+TKmFFe+SQA3KsiFUI75oZSm3yk36x6NqGKOtaov8MziPS5LpyZUOApXVfNgOFABeMG7QrKhhEnXeYshcRpjzzgbq2FNEc+O7ArOjZ+akC11h8itgYU8A0iKh8G1tpdkTEN7GH2BZ4XLx8XSrAzsuGZQuo1R4mEsSU5v7Js6HHk8DqKIj5HRHH90RCg+BzfXZ+IVaQK6igQDBPOLZWG23GckuFYIg3r2SiyhDpydRmpyHMujIFsntl00OEN3c5qIjg61Du/HgA== Received: from BN0PR02CA0049.namprd02.prod.outlook.com (2603:10b6:408:e5::24) by DS7PR12MB6094.namprd12.prod.outlook.com (2603:10b6:8:9d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Mon, 31 Oct 2022 16:08:45 +0000 Received: from BN8NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e5:cafe::1) by BN0PR02CA0049.outlook.office365.com (2603:10b6:408:e5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19 via Frontend Transport; Mon, 31 Oct 2022 16:08:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BN8NAM11FT081.mail.protection.outlook.com (10.13.177.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Mon, 31 Oct 2022 16:08:45 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 31 Oct 2022 09:08:35 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 31 Oct 2022 09:08:35 -0700 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29 via Frontend Transport; Mon, 31 Oct 2022 09:08:33 -0700 From: Michael Baum <michaelba@nvidia.com> To: <dev@dpdk.org> CC: Matan Azrad <matan@nvidia.com>, Raslan Darawsheh <rasland@nvidia.com>, Viacheslav Ovsiienko <viacheslavo@nvidia.com>, <jackmin@nvidia.com> Subject: [PATCH 3/5] net/mlx5: fix missing counter elements copies in r2r cases Date: Mon, 31 Oct 2022 18:08:22 +0200 Message-ID: <20221031160824.330200-4-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031160824.330200-1-michaelba@nvidia.com> References: <20221031160824.330200-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT081:EE_|DS7PR12MB6094:EE_ X-MS-Office365-Filtering-Correlation-Id: a5be50db-9aa6-4a51-6e8f-08dabb5a3038 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ct5blpE+Aa3pTk7YDngb5e7EkK40rxXomzyXWDWaGEWTk3GA3bnIkoUtAqysg+vr9bqRty4NCFMUCLMoSW+BmyO3mr9hB0ra/PGLuBVAlDrcN2IL3sFg0DH1Fe6vyNvQrIQv5AyyJgO0fhFM+1ZL3sV/Xyzf2bYr49wJ/xWnS2MLqnde8y2rLSgVohoYz7tFO8itli/dWIa7OQsSDZg/OzKep3EzIXBaicgWKrbFFxFK7RZjftQPCrihA71ZF79pvPdpvYzXtz5jmrhTKNXkxGjwsfS8UkSI8gCWVZiEDFlQI+LNYKziAYG4qn7+6qTYQonKcxdaubV/eCfJ/5qQpIZYdSaCkE/8iLvEYXGF5a5H5koviObz5EfA2g80/+NqRopei18S9HT+GY0T2NbYpDSBDBqVjsmCYHL7XXrC/zjbvdRlcyJ92+4r5851BbgdE5Wl014dY3tg2vYtwpCcqsm8Ad97ZLEyY7y5KMkoPHCD4hKRp9nIAGJ4R0+ikLyjxK3zmtlSssxvm+ZAXyCiG2qic0LW9KPLLMWSESNAsWdNvqrIGv+kuW017oOxJ17s7WxcRlrYz4oS313aHFiHiUMq8583qbC3Aq5RyGdOAly+AW/dODX2MVRNbItCOH2LAFpc9wC5wYjDw7OHCGF9cIwQqswAfza9d4+keA0Xrq7BHW0+I8h8+mWLvZZOYDup5VbofK9EQcjXacHQY73GJmMqZL+D4SULntwfQEz9BstneVSIujlHnGCMqycL40z4bDrcdkCehAnsWNVS0mA+0A== X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(136003)(39860400002)(396003)(346002)(376002)(451199015)(36840700001)(46966006)(40470700004)(6666004)(426003)(47076005)(7636003)(36860700001)(40460700003)(356005)(82740400003)(86362001)(2906002)(5660300002)(8676002)(70206006)(41300700001)(4326008)(2616005)(6286002)(82310400005)(70586007)(107886003)(7696005)(54906003)(186003)(336012)(1076003)(478600001)(316002)(8936002)(6916009)(26005)(55016003)(40480700001)(83380400001)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2022 16:08:45.4927 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5be50db-9aa6-4a51-6e8f-08dabb5a3038 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6094 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
net/mlx5: some counter fixes
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Michael Baum
Oct. 31, 2022, 4:08 p.m. UTC
The __hws_cnt_r2rcpy() function copies elements from one zero-copy ring to another zero-copy ring in place. This routine needs to consider the situation that the address was given by source and destination could be both wrapped. It uses 4 different "n" local variables to manage it: - n: Number of elements to copy in total. - n1: Number of elements to copy from ptr1, it is the minimal value from source/dest n1 field. - n2: Number of elements to copy from src->ptr1 to dst->ptr2 or from src->ptr2 to dst->ptr1, this variable is 0 when both source and dest n1 field are equal. - n3: Number of elements to copy from src->ptr2 to dst->ptr2. The function copies the first n1 elements. If n2 isn't zero it copies more elements and check whether n3 is zero. This logic is wrong since n3 may be bigger than zero even when n2 is zero. This scenario is commonly happening in counters when the internal mlx5 service thread copies elements from the reset ring into the reuse ring. This patch changes the function to copy n3 regardless of n2 value. Fixes: 4d368e1da3a4 ("net/mlx5: support flow counter action for HWS") Cc: jackmin@nvidia.com Signed-off-by: Michael Baum <michaelba@nvidia.com> Acked-by: Matan Azrad <matan@nvidia.com> Acked-by: Xiaoyu Min <jackmin@nvidia.com> --- drivers/net/mlx5/mlx5_hws_cnt.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_hws_cnt.h b/drivers/net/mlx5/mlx5_hws_cnt.h index 196604aded..6e371f1929 100644 --- a/drivers/net/mlx5/mlx5_hws_cnt.h +++ b/drivers/net/mlx5/mlx5_hws_cnt.h @@ -281,11 +281,10 @@ __hws_cnt_r2rcpy(struct rte_ring_zc_data *zcdd, struct rte_ring_zc_data *zcds, d3 = zcdd->ptr2; } memcpy(d1, s1, n1 * sizeof(cnt_id_t)); - if (n2 != 0) { + if (n2 != 0) memcpy(d2, s2, n2 * sizeof(cnt_id_t)); - if (n3 != 0) - memcpy(d3, s3, n3 * sizeof(cnt_id_t)); - } + if (n3 != 0) + memcpy(d3, s3, n3 * sizeof(cnt_id_t)); } static __rte_always_inline int