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 4573E46121; Fri, 24 Jan 2025 12:43:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 298B241101; Fri, 24 Jan 2025 12:43:55 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2053.outbound.protection.outlook.com [40.107.223.53]) by mails.dpdk.org (Postfix) with ESMTP id 2B287410FA for ; Fri, 24 Jan 2025 12:43:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xt6TSWT5ZGr6oeJ47OBbSjw0Jmah/Ftv0OUz88SXp2rFR0uwZnlFSt/vhpQkpApI2BuVWnyi+IfcZEar8tnI+hUFGezLENnDUZLvqEBFcXhhGBuqdnzW9hl/X70U84siipaUobmz2NzgNri8cLKlzywC3VqZtpxWzbEi0UmldteVIKpoFdY5wBaQbKlKARK/uMVrQ6Cnr25ooGgK7U0FlRekh3KHGukPdJ0S/2Ypkm6HHnlMYT2fKsk7ugdczL8aBXB3DGQKeSlAG/8LsTV6Pk1+i7bZ9CAlmKNUQjgyqC+hEeWXtEM2GZ218VRvl6jOSqC5FdPoho2jM7cEL/ksXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=r65oWkvmOfxaInDRs2JfVXLkNNdD3pWyE1gFUHk/Hug=; b=VzSqza4Zz+LTYD8I0BZMN0qoXHF3j4vs32q8TwXKkj6ruXIylXmk+nrM4YQP46cZADvCdcBcnHkFT3NGRV8WnZrCMsgxoortdmYdvSMj2NNJcGsMMBLAxI1vvyTjCsc8ZHPHmi+CMtl59YpGzkHpPwemu2wU14ddDC0To3y5AlsT+7alyPcIX5c8/V7t36PNxUiYIBZZ5toDGa3Ki0xtTtpbXgAH834asibPfMxnWxXGgNBvIG4MfMYsy3toNM9Tlncz0qBZvPhNCXdPcU30CF+zyrkCn8Ko7SMsT+rZlUE69b0RIwGpFufOCf5FeC/Gz5o7MeV1eoqe9k4oDddsWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 (0) 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=r65oWkvmOfxaInDRs2JfVXLkNNdD3pWyE1gFUHk/Hug=; b=RiqG+UgQCXVq8XrYKUhTIFyPZMqFcVY3iH/aGDwxBmLcHIisLZLOnkcefi8dydkq2MsplsusptlaIrisjLDAhp1qH2FnMCGsPOXNbR1uvYenUDoccnIZFGmq8yE/Rt9CfRQJe0L6xuNLq5kvp/DBO4OnMF1VHgS8rLKVT4lwqST5sd3qvM9wo7DHulsWBPX2lOR9sQMuDSCIaZcCRLYjw18gPhPRAe66PQm6d2awaxhWJJ45fLcPD2S7tODf1JhXJqXGmV/SbViD3nPmMdbQojTV6izrhD1PXJXQBYfRa2CajOedimWhmJpLoZUD/C9U8XTKiL3IlDx+pn6j09Wohw== Received: from BN8PR12CA0030.namprd12.prod.outlook.com (2603:10b6:408:60::43) by CH3PR12MB7548.namprd12.prod.outlook.com (2603:10b6:610:144::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.17; Fri, 24 Jan 2025 11:43:48 +0000 Received: from BN2PEPF0000449D.namprd02.prod.outlook.com (2603:10b6:408:60:cafe::38) by BN8PR12CA0030.outlook.office365.com (2603:10b6:408:60::43) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8377.19 via Frontend Transport; Fri, 24 Jan 2025 11:43:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN2PEPF0000449D.mail.protection.outlook.com (10.167.243.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.8 via Frontend Transport; Fri, 24 Jan 2025 11:43:48 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 24 Jan 2025 03:43:41 -0800 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 24 Jan 2025 03:43:40 -0800 Received: from nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Fri, 24 Jan 2025 03:43:39 -0800 From: Shani Peretz To: CC: , , Shani Peretz Subject: [PATCH v2 0/3] add new API to enable/disable xstat counters Date: Fri, 24 Jan 2025 13:43:32 +0200 Message-ID: <20250124114336.16610-1-shperetz@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241222153819.62519-1-shperetz@nvidia.com> References: <20241222153819.62519-1-shperetz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF0000449D:EE_|CH3PR12MB7548:EE_ X-MS-Office365-Filtering-Correlation-Id: 946ae9bc-dbe0-46c7-7340-08dd3c6c5dae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?pFKSMZUUB/m6hLAlmivRffzkq1CFPYZicFRWAOA6lNjESJAKUt2sWKmmcbDL?= =?us-ascii?Q?sqtY9cfGThDaKLu5huxuLZRXE97vmklu+xuOS38K3F4yO1A5IPk2XuHx4g6g?= =?us-ascii?Q?twxsfO0mV2t9tltKLdWPLnchrG7trbLHya5lTfQYNc7L+uyVLsBGAoYhMBG3?= =?us-ascii?Q?tWp5UW3CbYlnq7rIIyKRynilL94+TaKq9lrSx49Y2Dzekf9REMWtpT43YTKv?= =?us-ascii?Q?rUrmo/EjRoVJIc/ck4db+9UGCGIl96ezN0RXrXs1aWDfZbR1SthCS/lbVDow?= =?us-ascii?Q?BZ3xWsLAGOt+GgURdMnHBWZ9ETTZDv4jaVvjwfy73yyuK48WTSixqoAnvc4Y?= =?us-ascii?Q?54EQlh+E9flbZJYh8H9NEyOhjlAl8jazl6sqO2UaGmGQ5+bYr8nU1SxOfTz9?= =?us-ascii?Q?qMtI4RD6kV7UbAk3KAQcHw5yIix5D/NrjmoAI3coMhIlLtAPAl0DrVktpkTp?= =?us-ascii?Q?B4hxkAl1k8dCK9zAjR0vt/PuMb7d7WxrkxEj4STmkqPblW9KMX6ChPuJF+ag?= =?us-ascii?Q?pctpFA4Of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JtDNn?= =?us-ascii?Q?zYYgy6zHc85DW9dp7WYjNjGjtMhLdqnouu0gR4ssI+Mh2uwW8TDVa+KwYFUC?= =?us-ascii?Q?SwwgFNLu7iyMBWI=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2025 11:43:48.0139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 946ae9bc-dbe0-46c7-7340-08dd3c6c5dae X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF0000449D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7548 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 These series introduce new API functionality to manage xstats counters, allowing users to enable, disable, and query them. Additionally, we've implemented testpmd commands to show xstats along with their current state. The changes also include a new feature in the mlx5 driver that utilizes these APIs, introducing a new xstat counter designed to track hairpin packet drops. Shani Peretz (3): ethdev: add new API to enable/disable xstat by counters ID app/testpmd: added testpmd commands to enable/disable xstat net/mlx5: add port and queue level counters of hairpin drops app/test-pmd/cmdline.c | 125 ++++++++++ app/test-pmd/config.c | 96 ++++++++ app/test-pmd/testpmd.c | 10 + app/test-pmd/testpmd.h | 5 + drivers/common/mlx5/mlx5_devx_cmds.c | 9 +- drivers/common/mlx5/mlx5_devx_cmds.h | 2 +- drivers/common/mlx5/mlx5_prm.h | 3 + drivers/net/mlx5/linux/mlx5_ethdev_os.c | 5 + drivers/net/mlx5/linux/mlx5_os.c | 21 +- drivers/net/mlx5/mlx5.c | 288 ++++++++++++++++++++++- drivers/net/mlx5/mlx5.h | 28 ++- drivers/net/mlx5/mlx5_devx.c | 75 ++---- drivers/net/mlx5/mlx5_rx.h | 20 ++ drivers/net/mlx5/mlx5_rxq.c | 36 +++ drivers/net/mlx5/mlx5_stats.c | 292 +++++++++++++++++++++++- drivers/net/mlx5/windows/mlx5_os.c | 3 +- lib/cmdline/cmdline_parse_bool.c | 49 ++++ lib/cmdline/cmdline_parse_bool.h | 39 ++++ lib/cmdline/cmdline_parse_num.c | 2 +- lib/cmdline/cmdline_parse_num.h | 1 + lib/cmdline/meson.build | 2 + lib/cmdline/version.map | 7 + lib/ethdev/ethdev_driver.h | 13 ++ lib/ethdev/rte_ethdev.c | 49 ++++ lib/ethdev/rte_ethdev.h | 32 +++ lib/ethdev/version.map | 2 + 26 files changed, 1122 insertions(+), 92 deletions(-) create mode 100644 lib/cmdline/cmdline_parse_bool.c create mode 100644 lib/cmdline/cmdline_parse_bool.h -- 2.34.1