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 16C2BA0543 for ; Tue, 21 Jun 2022 10:09:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0B6F42BB6; Tue, 21 Jun 2022 10:09:29 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2057.outbound.protection.outlook.com [40.107.223.57]) by mails.dpdk.org (Postfix) with ESMTP id 1857B42B94 for ; Tue, 21 Jun 2022 10:09:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fNuoTbztKSscexwJ5ebEF9cC29tsMp/Q8ZQU9z4tYVkebHf5TR62XAsSYSxl6MjZD/3N/cXiFQ8MChsW5X4FmqZNo32XwLRemKC4ADgUNg8CTtf1rNNR/1MZoL2qfjrbXldBJNSFaM6C0ye8Bqw4aqKIgzVqfwGdhB0QNQ9hYuBofKCdYzKL8Hy5BQrwXdneV+AUlcMK5fuzix3NgUyJIx09NvbDYLygDW5wgvG5dTaewqHzOqUOy2bBE0OPXH9dCE/Y5GFLO/4vqN8a96bMHrnPPPLcoJqXkT+JV4LrQzbLzYkfrMiiA5baM1Ds8ewiH6FC0WTFiV6YcAYYzxLeJQ== 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=m3lcAxAFyaS2Jtra8x74mvLyLNUFhE1mibOX3UdIyk4=; b=oRPlT2H4qh+y/+Sb1KLq72P7q4TAf5DjJJLBIm1b3hxwk+KoTTd8sj42YJ2KnBekiudsAHB2usNsTZ2oBKybu2hSYZHeBAoptWPJnaCPAwg14dxhGsMB7KvWmyKm/phtgySx7Qym/g0MU7ogPPQnegqUTYdvW5EFdmrH5aiVZBvfeaVBfE3KlDzEYp/YuhFSPNJS9OcJI1KmA5fTd/xxsvFwNVw+HrsLCMOB6ecHYQmHMu2ZUjloxSwgIxeY3etlrZpN0VnLwW7ciBX3Mz7fZp6gVwgGcVDSq/2MOJTQtlYyJN9envSFzJHH519BMDLq4iao0382wGl5XYY6r1eq2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=m3lcAxAFyaS2Jtra8x74mvLyLNUFhE1mibOX3UdIyk4=; b=jk7BGz88roxM4fSJyIMIy7j73jzn6odjpzu7dlj8MWpXTuINDnm292rLAOBS9iLRyu0mBGuyQSIEaqwPoCmgCnV0AXS0OmRX6IkIGnzIRE855jOLWHFblzgIY/3Ic0TmkoGb/Rv2DgoROq5tMxNv9fvjTuLJkCVCZKti/fQJ9KmEnZZTylVdUhnyI4zV8j6yH3Rk19vkB03SR3fpSaC/B4nYBxVg0vjrIPPub37pQxdnQldv3VvcCqBSfFAnnJfM026xTwqpXGkVNMWNRE/0Xx3pzO58ROWTxfQm9y9JK5q3q8cjoh+XSk6BJlsup+4zSM1Qo5UxKV6fw4FQFC/1WA== Received: from BN6PR13CA0012.namprd13.prod.outlook.com (2603:10b6:404:10a::22) by DM6PR12MB3322.namprd12.prod.outlook.com (2603:10b6:5:119::25) 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:25 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:404:10a:cafe::89) by BN6PR13CA0012.outlook.office365.com (2603:10b6:404:10a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15 via Frontend Transport; Tue, 21 Jun 2022 08:09:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) 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:24 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:09:23 +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:21 -0700 From: Xueming Li To: Chengwen Feng CC: =?UTF-8?q?Morten=20Br=C3=B8rup?= , "Andrew Rybchenko" , dpdk stable Subject: patch 'net/hns3: fix xstats get return if xstats is null' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:17 +0300 Message-ID: <20220621080301.2315720-72-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: 7fea5aef-b584-40fe-b201-08da535d5aa3 X-MS-TrafficTypeDiagnostic: DM6PR12MB3322: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: 0OojzT+ZyD4NMAKlNK7jSl5gqwOFGEiye5e1hs6WOl8XYrA0kjMGCPByhFjyzOt8TvsNxCR4fsdC63hGNtw7qmCGDUijjQ6kzjumZpM4rMUi1Y3flmCumkvZkp9xTBt2v2WsnEqkKh2hcFrmayjU9I01LyFs6ayMo0olAtgMbJiSIaroz8jFTpojixsnY100OwUQkm4hBn548uaQk5uELafVakSIWznSr0VCuP6z41a8IxN2CILYsEjHrwTTGjzM7itMEp2fJjXNS+sXI5EoGG83dAnLV1NH+2mOviSDVxlToalRX54xfYSv3F4ZXkCy0I6GhZYQbqCPYa+1cCWnbt+BueL0W1enUepqtLBZx/G5PsBZ0HU6uBo2cxO8UeshSiU9TJEZEtLdVVL3A4b8NX15pwXUXIv9rcBidDy16RwFpj6rr9VCRYhfoLSTYo6cknPdBNOTOHOPkcXQ3LaY2X1rSNPCSc9CrBzhAGE4HShRHklYPFJ5bpmmPpC/5vxMw+SECD7tbFkeabzJlSzeZOfBV5l8//KhmjZA8uKOPdiHFjeF8hJ4jpGAR/7IFNh/6bRswn7YuCFO0+Y7KuRgFS2+gNCsLPuDm0M3MbTqrPTqEGHTs+f5mDCczgpl88gYr+tOZLD0t7nhAeWvu9bzxYYhzSsgic7Ud4K7ZY5P/xMObJG9o0PMOAuC0UTtLs08G0ZwlrZKjXBHTkCuovjRpVL0+2bDuDKOWKZv/oq7/P2U/Iv25CiB+SvYDD8xf7VSl14bgso6DViJcKowQtHwmeaedaia0kxdUQlKUe2XbnpDYddEDM1DOqRTB0e0cEg+lIZYdoD5WMCNKEdwV9K8sByTiwKxrx/oYmh/hM3lquY= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(136003)(376002)(346002)(39860400002)(396003)(46966006)(40470700004)(36840700001)(81166007)(478600001)(966005)(82740400003)(86362001)(426003)(186003)(7696005)(356005)(66574015)(6286002)(336012)(36756003)(53546011)(6666004)(316002)(70206006)(70586007)(6916009)(54906003)(47076005)(16526019)(1076003)(2616005)(41300700001)(40480700001)(55016003)(26005)(4326008)(5660300002)(8676002)(83380400001)(2906002)(82310400005)(36860700001)(40460700003)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:09:24.2525 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7fea5aef-b584-40fe-b201-08da535d5aa3 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.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3322 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/17467579f79a4f9825a307a189d86c123b29d259 Thanks. Xueming Li --- >From 17467579f79a4f9825a307a189d86c123b29d259 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Fri, 13 May 2022 10:53:51 +0800 Subject: [PATCH] net/hns3: 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 e15401f362779dba8623b4ee3db388fdf79dca7f ] Many user (e.g. telemetry) invokes rte_eth_xstats_get(port_id, NULL, 0) to retrieve the required number of elements, but currently hns3 PMD returns zero when xstats is null. Dedicated check for xstats vs null is not required, since ethdev layer guarantees that it may be null only if number of entries n is 0 (which is definitely smaller than total xstats count). Fixes: 8839c5e202f3 ("net/hns3: support device stats") Signed-off-by: Chengwen Feng Acked-by: Morten Brørup Reviewed-by: Andrew Rybchenko --- drivers/net/hns3/hns3_stats.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 04702f17d1..3cb1e4cac1 100644 --- a/drivers/net/hns3/hns3_stats.c +++ b/drivers/net/hns3/hns3_stats.c @@ -694,9 +694,13 @@ hns3_error_int_stats_add(struct hns3_adapter *hns, const char *err) * @praram xstats * A pointer to a table of structure of type *rte_eth_xstat* * to be filled with device statistics ids and values. - * This parameter can be set to NULL if n is 0. + * This parameter can be set to NULL if and only if n is 0. * @param n * The size of the xstats array (number of elements). + * If lower than the required number of elements, the function returns the + * required number of elements. + * If equal to zero, the xstats parameter must be NULL, the function returns + * the required number of elements. * @return * 0 on fail, count(The size of the statistics elements) on success. */ @@ -716,9 +720,6 @@ hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, int count; int ret; - if (xstats == NULL) - return 0; - count = hns3_xstats_calc_num(dev); if ((int)n < count) 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.511593306 +0800 +++ 0071-net-hns3-fix-xstats-get-return-if-xstats-is-null.patch 2022-06-21 15:37:49.107784833 +0800 @@ -1 +1 @@ -From e15401f362779dba8623b4ee3db388fdf79dca7f Mon Sep 17 00:00:00 2001 +From 17467579f79a4f9825a307a189d86c123b29d259 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit e15401f362779dba8623b4ee3db388fdf79dca7f ] @@ -18 +20,0 @@ -Cc: stable@dpdk.org @@ -28 +30 @@ -index 2799ff4432..07fad03485 100644 +index 04702f17d1..3cb1e4cac1 100644 @@ -31 +33 @@ -@@ -1031,9 +1031,13 @@ hns3_imissed_stats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, +@@ -694,9 +694,13 @@ hns3_error_int_stats_add(struct hns3_adapter *hns, const char *err) @@ -46 +48 @@ -@@ -1052,9 +1056,6 @@ hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, +@@ -716,9 +720,6 @@ hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,