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 B78DEA0545 for ; Tue, 21 Jun 2022 10:09:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E609242BCE; Tue, 21 Jun 2022 10:09:35 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2069.outbound.protection.outlook.com [40.107.95.69]) by mails.dpdk.org (Postfix) with ESMTP id 9234442BC0 for ; Tue, 21 Jun 2022 10:09:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MEaxVKl3pf3F+e25zSLHnIToLo7QodrwVGOdIc+slLUscbWaHsERnoiWI+HTFsIK3asSUxzRWg4lyQOZkBMj/wy6Mhi83SrLhB5HMNwM9HcT7y3HCRkwMXYqDRMeC1HT/JF0/U9szugDWmQqXvbkiil3cOsPgXfoH6oC9ZWs27QqTmC7O2DUzk/wV3s97K+A9mOmG6923btWXRyWgNqNtK+S4yj+IA9rsGln24vngFbKIqxEYmRuKDiYf2mLvIqh7rq21yFQ+vZMdAJmbs0/j1PEpqMOloB8gOKkLGy3mgTO3zXSoKFrIazGbFJhZim5UggKU8jA40ap9Qq+G8+WKA== 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=0H5m1QlPOh3paTmAnSlb03a77JYHZgtVe9RNjxBUL30=; b=Kr7r5aevpAN3rGot7EQuvh+X3OEl6sCPknNvTzAEDBISnPZBeZIQb2jcgYwBy6A4d6qp0jifrIZBzkpI4kf3hm5cX3iDVo4o7mTk1uo/m0QvUye6JIPd13w0PfR9bzXiPJMF08IM8QO3qAoC+fv4eMYDxx56nlYhE930eZLKjk5R6lK4QkX+P/KocA8o77+H7qu3hK4xsHf83ZxZuRMPk3pMlMzH3XiocXlClmsLsI79wZputftM/dxXaxKc+11dgokTnlzZ/+wK6gApd5Z57D/1qqWwcVnHxcV0GDtLuHxzg9NCWrvbzfZieC/BRWfe8KxpwcLCKrdf94RfFhcBgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=oktetlabs.ru 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=0H5m1QlPOh3paTmAnSlb03a77JYHZgtVe9RNjxBUL30=; b=hZeR0a45R2R5QFOJ5IhubT5jxYppej4SeTIOwpv2UqZl57jodDfL1B1zBS7aMLVbxPKmx4YaOaOgHA7Hh7llQ6vr3kBurFEkkrhPgJc0zKhoUyLA39otC0JfElsoPqURc/V66q/HFq5tdDSCU6h6sF1V9UuLIkSfLdIzQlQWrqH1tsebzVQS/WjNhNcN+GU8HvxsiHJQqy4bv1FUAXWUn8X8SK0dYxaNW0UaNAyaGA2bzVqYDf4xE1bz/03Cjkv0nVJ8lnrwDuVT0i0knsJz3bmfXPGDXiyYpqplo0A2g+V5SyEBSDh9dG4X2mSP/zJm5djFA7acVddLt8EruESLZw== Received: from BN6PR12CA0047.namprd12.prod.outlook.com (2603:10b6:405:70::33) by BL1PR12MB5191.namprd12.prod.outlook.com (2603:10b6:208:318::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Tue, 21 Jun 2022 08:09:31 +0000 Received: from BN8NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:405:70:cafe::a) by BN6PR12CA0047.outlook.office365.com (2603:10b6:405:70::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15 via Frontend Transport; Tue, 21 Jun 2022 08:09:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT030.mail.protection.outlook.com (10.13.177.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:09:30 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:09:29 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:09:27 -0700 From: Xueming Li To: Chengwen Feng CC: =?UTF-8?q?Morten=20Br=C3=B8rup?= , "Andrew Rybchenko" , dpdk stable Subject: patch 'net/axgbe: fix xstats get return if xstats is null' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:20 +0300 Message-ID: <20220621080301.2315720-75-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 193c6430-17b1-40ac-8fa4-08da535d5e20 X-MS-TrafficTypeDiagnostic: BL1PR12MB5191:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HvTpq8S2PDarmFA56Lwub61Nw6senVyRvKp3q2UuYieT9+Q09UNVm8zmRsCznV5tjO9r2oBQFbshPl7jbkakcWottJgJlXV2pec8FUCUMEbw6se3SwYJ+rpEmvNysK1u3YQyKZCjOo05quNQ8sawyT6wp0DM3aqiTd6Av5fcVDxju3hJK+tDgo4wJsM4yHoaxFxY+HghiMWaiNHEenhhidtYFqD9Tb0crG5E3yOKslGYOiCkmR6GmJYpme/sc0SxfIinXabVJsB+Mua5P/050pE1/EHS1uNE0I1+domFHsJ0VdabLiCA4xMF98K4aferXuAb5IH7Y37pSdSSXI1yy6eFzRFqMJ/Sx97kPdALiWs+jl/AmxZQKgz+hIR59ANU+WDUWm8iHWokVj0fuiampBNtTeZm/zj/dKug7PD61YGX7aGPZn9eS8aZlz2iPPPSdW4E9DV9JF+m75tdqGsDaMuV2UmOdDNUAFK4T73xanHMWldntNVEjPnVohzzmq2YE98V76ArS4J3X37uIne0puCzE65jvQ72uyFWNu24u08mtglRrCdjnMk9hcjDhkHmkoOHLdyfzDtWnUGJHitRLTdCs7jDw8E0eblYvyUlHmDFCBenZsbAkb4ubCS+GINxq5rFuwr+uYZ4NVzY1kbfVDaZek0TSMOr6Zm66mdMMK38RANL/yEGp9ed5of6eXqWcSf6hMRPER0EzOxSpnSatn9LgZTqGn9hUQvhdRyIavWliShq8NChYSdhrgLWxKRWSw5Y9DOFud89M5HtU5zUI7ODtdh648uSEZpXu0wwWZQCLHUhUgqoYkRjIop3XtLMPibyi39ot8V1/KWBClbQo2ETtsN+hrbRJZt1EmbwrBU= X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(136003)(376002)(39860400002)(396003)(346002)(46966006)(36840700001)(40470700004)(16526019)(82740400003)(26005)(1076003)(6666004)(66574015)(47076005)(186003)(426003)(336012)(7696005)(2616005)(41300700001)(53546011)(36860700001)(81166007)(83380400001)(6286002)(356005)(6916009)(8936002)(4326008)(316002)(55016003)(8676002)(5660300002)(36756003)(40480700001)(82310400005)(86362001)(2906002)(54906003)(70206006)(40460700003)(966005)(478600001)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:09:30.0884 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 193c6430-17b1-40ac-8fa4-08da535d5e20 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5191 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 Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. 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/7d17ff9a817b0cc250ee5c18f7579a09454f8e04 Thanks. Xueming Li --- >From 7d17ff9a817b0cc250ee5c18f7579a09454f8e04 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Fri, 13 May 2022 10:53:54 +0800 Subject: [PATCH] net/axgbe: fix xstats get return if xstats is null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit 93041fd5149a4f8cc795ea8ebb229415e2994e51 ] Many user (e.g. telemetry) invokes rte_eth_xstats_get(port_id, NULL, 0) to retrieve the required number of elements, but currently axgbe PMD returns zero when xstats is null. Remove the logic of "return zero when xstats is NULL", and add the logic of "return the required number of entries when n is lower than the required number of entries". Fixes: 9d1ef6b2e731 ("net/axgbe: add xstats") Signed-off-by: Chengwen Feng Acked-by: Morten Brørup Reviewed-by: Andrew Rybchenko --- drivers/net/axgbe/axgbe_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 6e63d7673b..586cf6974c 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -984,18 +984,18 @@ axgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats, struct axgbe_port *pdata = dev->data->dev_private; unsigned int i; - if (!stats) - return 0; + if (n < AXGBE_XSTATS_COUNT) + return AXGBE_XSTATS_COUNT; axgbe_read_mmc_stats(pdata); - for (i = 0; i < n && i < AXGBE_XSTATS_COUNT; i++) { + for (i = 0; i < AXGBE_XSTATS_COUNT; i++) { stats[i].id = i; stats[i].value = *(u64 *)((uint8_t *)&pdata->mmc_stats + axgbe_xstats_strings[i].offset); } - return i; + return AXGBE_XSTATS_COUNT; } static int -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:52.627923176 +0800 +++ 0074-net-axgbe-fix-xstats-get-return-if-xstats-is-null.patch 2022-06-21 15:37:49.111118179 +0800 @@ -1 +1 @@ -From 93041fd5149a4f8cc795ea8ebb229415e2994e51 Mon Sep 17 00:00:00 2001 +From 7d17ff9a817b0cc250ee5c18f7579a09454f8e04 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit 93041fd5149a4f8cc795ea8ebb229415e2994e51 ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +30 @@ -index 951da5cc26..e6822fa711 100644 +index 6e63d7673b..586cf6974c 100644 @@ -31 +33 @@ -@@ -1013,18 +1013,18 @@ axgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats, +@@ -984,18 +984,18 @@ axgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats,