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 89B39A0543 for ; Tue, 21 Jun 2022 10:09:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5830142BBD; Tue, 21 Jun 2022 10:09:35 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2074.outbound.protection.outlook.com [40.107.92.74]) by mails.dpdk.org (Postfix) with ESMTP id 8762842BBD for ; Tue, 21 Jun 2022 10:09:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FcuypiE21mz3wUdmuntXdg/eMRLLVQZ7cN0kme+FbH0y9BMvOsZ/MJ38sLlqeU6kifYnvG8vOvzlV/gaaqkDA0Hxh9Ej2wjRhCRPH7jskXmEpAcSfS5WDl34c/nkaacAVCsjh9soosINmNwAffxqfrCXKF1j9dkq3PbarQ0ljRuU2rCGwaNs7Z7ixyAI0psatkHEiUBQbOAquYqsKcraVWNa9Ej2y7RgCg2A4vq3zmsG/YaDMB7wesjcFwqCILI44XLMkQ1GtiulwfT9nwTrQTf7qyOMBbE0EEE1B+E2B9iCK/kmrmI4IUQuhNXEpQhPpEsaUMPxeLzBr72+PIkDzw== 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=wDlr/Y9U6GU+xMnJPb4fYjo6rcPUdO9gywkGo9CuK24=; b=YHfBmXkeSVEUvTuxGDA3icu0cC/hkbp6nrNLeTbfRNhZLfr/LH4xjQezaPQH39/2bWZtrcLbK81x9ZjgoRmzt1I5yB5O3MlzMASssy2Igj3l4nZyLbQ/KxU5HhF8vuk+v91cMdSY+YaPSpw25bqtjs3o+f0OMQRlbgnofaPN1wTY2HZFGoGP647lCmndLWvXphSCyMuP8fwwd9H1ckBhIfUjk+FECR3csEF27PA5EIbhEZ4PRaYmP/uCXvKHlW510gxhQEA9PYy+COHSlLQOtYihwV03tSuWQ6/oFhyjMtY0uTu/5pn5yPLdsPtyQCsmaY/36hKnklmUjUvj0VYgTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=wDlr/Y9U6GU+xMnJPb4fYjo6rcPUdO9gywkGo9CuK24=; b=IKntgwtNFw+0X6tpJxoIDlgzt0YKgAaWjta5Xwp5y3lzMG/NKXcwU2IhSQzppqZksh+veWNoYFOJYTYIgIw4gnMx0eAUSF9n10cnOcICEm9y24ucVJRVyyVx3TR+RZ64xxu8bVLUEUgs/Iy9Il+XmBursVdZgdBh09b2Y3CH2PBA0/AEbiCSCpdCOYUrzaCBVAf6jV25NAi9k3UOldxT5D3sWPbyD6bpi/Jz5Bn6v/cjBXYmhkfy8Oc/dhPs/LhilIWk1aWiL9pC2xSFv4yIqySIBjW7DKeZow8UjGpY2Ou3yCDWgiNYay0KtoElvJ57NdWqZ9PdF6/CpeITxrJJJQ== Received: from MWHPR22CA0060.namprd22.prod.outlook.com (2603:10b6:300:12a::22) by BYAPR12MB2934.namprd12.prod.outlook.com (2603:10b6:a03:13b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14; Tue, 21 Jun 2022 08:09:29 +0000 Received: from CO1NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:300:12a:cafe::1c) by MWHPR22CA0060.outlook.office365.com (2603:10b6:300:12a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22 via Frontend Transport; Tue, 21 Jun 2022 08:09:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT029.mail.protection.outlook.com (10.13.174.214) 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:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:09:27 +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:25 -0700 From: Xueming Li To: Chengwen Feng CC: =?UTF-8?q?Morten=20Br=C3=B8rup?= , "Andrew Rybchenko" , dpdk stable Subject: patch 'net/mvpp2: fix xstats get return if xstats is null' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:19 +0300 Message-ID: <20220621080301.2315720-74-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: 18e59593-9a07-4184-38bf-08da535d5cf3 X-MS-TrafficTypeDiagnostic: BYAPR12MB2934: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: vAxlSWHL/ZGq6ty46sdDrSpXLCJ+H/imwr2iBXHGYOzUITalOFvrS81uoKmO0esYlm5tGAx4gjyKJle1PTBqjYlekxOpl9+gKeiZYy6FwjiwEAfGky6/ZF7GYRXZm0dL/G+6sqcD5gLHyBVgPUHl/YGtUe3IJZvsliDyevUHd3bH8yWrnjO9TbSTvnGiq4oBRfqRk1sgmvRCTOxriTnbyAgu4wUpjRpL3BVUGRGZ3RGRmKkkbZVkSTjK0K62rA6sLSbJzI1chzRNuJPhmitUYrGBmqsXvKMfPUoPianPMU45remHFrlyD0DGYlaf/Ksqp//IccfUc5e2aTDBHEaZfc00+U6N+ANC81hneTe6BWsz7bhuQFyS5rvgrnxWcTRHBJwYS2KQNHvX2WiCGHyVEeexaFo3cp8sXix1WDs4IoxLU/IMox0g6vOsQvs8kbnEcAjDdc2/3XSCvw4X3hEj6VYBBTw72hiMNvgh7wXHlFklgxFaWsbNYjHtlbG0+YHxKwIH34OFAZwseziyEmmbXntfuroiRo8a9tDmXOy2oYXcq7PKS04PJ6mjWjSnjEftS8fGtrXJLCo7f3R5vsgiE/hbl+xkJKDyHbTC0bdL50YuL6Ed90aAN/TueyM3I3aXUxRmnEWsNIQJawsE/a72q9valpAfPl9ZjTCKGNNJbdHApTRirz0ZOQNQBybb5sP6wmnxMtfwjqaiSvXdXjJKPu3MWGe81rva+Ge40Va+Kkaza3Vttg0UfvSMPo54WGdMDFc4lOQ6fXzfgrl/H3dRD2QIUBWMG+eYLbYiASFc/q9+A3gbinScNEqN6r5o6NH1AFghDDPGxNbF3tKSSRKXuxNx4sEi6gC+mf/ek7zVt7s= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(376002)(346002)(39860400002)(136003)(396003)(46966006)(36840700001)(40470700004)(5660300002)(40480700001)(36756003)(55016003)(478600001)(36860700001)(8936002)(356005)(2616005)(82740400003)(81166007)(83380400001)(186003)(426003)(47076005)(16526019)(40460700003)(336012)(66574015)(41300700001)(966005)(54906003)(6286002)(7696005)(26005)(86362001)(2906002)(53546011)(82310400005)(70206006)(70586007)(8676002)(4326008)(6666004)(6916009)(1076003)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:09:28.1760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18e59593-9a07-4184-38bf-08da535d5cf3 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2934 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/2b88b790c13c872f1de308ccf9ea120b27dc5666 Thanks. Xueming Li --- >From 2b88b790c13c872f1de308ccf9ea120b27dc5666 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Fri, 13 May 2022 10:53:53 +0800 Subject: [PATCH] net/mvpp2: 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 d853d24b27d6524f26a2a830c7ef678ba739cfce ] Many user (e.g. telemetry) invokes rte_eth_xstats_get(port_id, NULL, 0) to retrieve the required number of elements, but currently mvpp2 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: a77b5378cd41 ("net/mrvl: add extended statistics") Signed-off-by: Chengwen Feng Acked-by: Morten Brørup Reviewed-by: Andrew Rybchenko --- drivers/net/mvpp2/mrvl_ethdev.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index ce077c4ecd..09af452abe 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -1376,13 +1376,14 @@ mrvl_xstats_get(struct rte_eth_dev *dev, { struct mrvl_priv *priv = dev->data->dev_private; struct pp2_ppio_statistics ppio_stats; - unsigned int i; + unsigned int i, count; - if (!stats) - return 0; + count = RTE_DIM(mrvl_xstats_tbl); + if (n < count) + return count; pp2_ppio_get_statistics(priv->ppio, &ppio_stats, 0); - for (i = 0; i < n && i < RTE_DIM(mrvl_xstats_tbl); i++) { + for (i = 0; i < count; i++) { uint64_t val; if (mrvl_xstats_tbl[i].size == sizeof(uint32_t)) @@ -1398,7 +1399,7 @@ mrvl_xstats_get(struct rte_eth_dev *dev, stats[i].value = val; } - return n; + return count; } /** -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:52.589867491 +0800 +++ 0073-net-mvpp2-fix-xstats-get-return-if-xstats-is-null.patch 2022-06-21 15:37:49.111118179 +0800 @@ -1 +1 @@ -From d853d24b27d6524f26a2a830c7ef678ba739cfce Mon Sep 17 00:00:00 2001 +From 2b88b790c13c872f1de308ccf9ea120b27dc5666 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit d853d24b27d6524f26a2a830c7ef678ba739cfce ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +30 @@ -index f86701d248..735efb6cfc 100644 +index ce077c4ecd..09af452abe 100644 @@ -31 +33 @@ -@@ -1626,13 +1626,14 @@ mrvl_xstats_get(struct rte_eth_dev *dev, +@@ -1376,13 +1376,14 @@ mrvl_xstats_get(struct rte_eth_dev *dev, @@ -50 +52 @@ -@@ -1648,7 +1649,7 @@ mrvl_xstats_get(struct rte_eth_dev *dev, +@@ -1398,7 +1399,7 @@ mrvl_xstats_get(struct rte_eth_dev *dev,