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 6954443F08 for ; Thu, 25 Apr 2024 18:53:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F862438F9; Thu, 25 Apr 2024 18:53:29 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2064.outbound.protection.outlook.com [40.107.243.64]) by mails.dpdk.org (Postfix) with ESMTP id F073B438DA; Thu, 25 Apr 2024 18:53:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dcZaiMbSxzearx1svmYQ07xZopGFg1fS7hMRN70wDEDG8B3Z0U7DRRxsLyzK1iXbwMBsejEEe3//LlVMGBgYb076U0ZOJtSJljW/ljXkjjIDqIv5Eimt6Bh3r6iPiRycXwtR8DvErbn/C1pboZGQ9scd36YFiKruStG8NktelpCAytgVaZ4B4sTAqGpM0/18MFSIb+sQGbGP6EReQkPZHNplfHem5BM8YbOsHqr+hmFk3Sr1rGvl3b2fHkTzOK2unTB9qHimIwcVxBgyhR5XWat+gQtVzaqE3DEiGy4FDRtM/LJXZoUjVBGG3H+qcLPoqlbnUHZF1J3G3ZvRcNgBPg== 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=ImEO5a6l0Ycywe4ieS9eQ0NodKLWxgnxcZl1T6r5cdA=; b=Vhg7bmNiPXUmTPDFwLSKp25mB/u/wNzMqlT/M9UZ790AjfH1zb0vGf33V6v04/qeSdCndUDXQBrteEqzUdXGBYjHWGtY1yrvGHwaSqkaljxfUwiyl6BQmomXDQc3yjMn/o6qBt/1Ug1MWfRADHL3M882DxV4qQjsrr5J6Az1UwnBoM7DnRbffQmRIUowe2g9cy+d25bGoroAUZIgqoem3ML5PDzCylt/yuGwwN0PDBRycatvGH2NRcGgxpUlZr27IqX2Cp29yqjnzXMri1B4uGDcpxigOG/MOCl3HG48Wo/uy0Pi0Hm8MJ7gDkSt8HCuYmzqiITYmDOQqgLzKhDdsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=monjalon.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ImEO5a6l0Ycywe4ieS9eQ0NodKLWxgnxcZl1T6r5cdA=; b=rekTFxiy1ZtHqDakSytN1Eck5YAtchOugHi/B0RvQvJbqxRJ3432clbkC6ID0xLb+1S8YYt2HnzFCdEehKhIPT1s6oJ83eTZ48CwoFG5gVDU5slh+AlngsON4bAjpy//BRylFj7ox5FDQ48xCREwyZYJslAb8LnyyfRapxSrAfA= Received: from SJ0PR13CA0186.namprd13.prod.outlook.com (2603:10b6:a03:2c3::11) by LV3PR12MB9266.namprd12.prod.outlook.com (2603:10b6:408:21b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Thu, 25 Apr 2024 16:53:23 +0000 Received: from SJ5PEPF000001D3.namprd05.prod.outlook.com (2603:10b6:a03:2c3:cafe::b8) by SJ0PR13CA0186.outlook.office365.com (2603:10b6:a03:2c3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.23 via Frontend Transport; Thu, 25 Apr 2024 16:53:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001D3.mail.protection.outlook.com (10.167.242.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.19 via Frontend Transport; Thu, 25 Apr 2024 16:53:22 +0000 Received: from telcodpdk.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 25 Apr 2024 11:53:21 -0500 From: Ferruh Yigit To: Thomas Monjalon , Andrew Rybchenko CC: , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , Stephen Hemminger , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH] ethdev: document that stats reset APIs are not thread-safe Date: Thu, 25 Apr 2024 17:53:08 +0100 Message-ID: <20240425165308.1078454-1-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D3:EE_|LV3PR12MB9266:EE_ X-MS-Office365-Filtering-Correlation-Id: f4309a52-93fd-4ad9-6c19-08dc654837d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL: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q8jLgC6+jjx/vLMvwlcBobZ5DLwnXU0tZ?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(36860700004)(376005)(82310400014)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2024 16:53:22.7014 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4309a52-93fd-4ad9-6c19-08dc654837d3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001D3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9266 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 Making 'rte_eth_stats_reset()' and 'rte_eth_xstats_reset()' APIs thread safe has performance impact on datapath. Instead document APIs as not thread safe and add condition for reliable stats reset functionality, forwarding should be stopped. Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Cc: Mattias Rönnblom Cc: Stephen Hemminger Cc: Morten Brørup This update triggered by mail list discussion [1]. [1] https://inbox.dpdk.org/dev/3b2cf48e-2293-4226-b6cd-5f4dd3969f99@lysator.liu.se/ --- lib/ethdev/rte_ethdev.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 548fada1c7ad..40f04c0e191b 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -3136,6 +3136,9 @@ int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); /** * Reset the general I/O statistics of an Ethernet device. * + * API is not multi-thread safe. + * Application should stop forwarding before calling this API. + * * @param port_id * The port identifier of the Ethernet device. * @return @@ -3296,6 +3299,9 @@ int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, /** * Reset extended statistics of an Ethernet device. * + * API is not multi-thread safe. + * Application should stop forwarding before calling this API. + * * @param port_id * The port identifier of the Ethernet device. * @return -- 2.34.1