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 83EFDA0A0E for ; Mon, 10 May 2021 18:09:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DF014003E; Mon, 10 May 2021 18:09:02 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2080.outbound.protection.outlook.com [40.107.93.80]) by mails.dpdk.org (Postfix) with ESMTP id 888C8406A3 for ; Mon, 10 May 2021 18:09:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qb/yX4+s1kkCKk23h5PMtmHpZ00eQ16dLcxINKw9+q6BtoYzjnORTWvLhVCDZuha31X8ddWaFUEXaMimSDGDW/JaoMWC9kOV7U86RB3/qt6d8kSHK6zEIEBNqNpEvRMXM+MQZY3C+iJvQV+kzoOBsaSK/9myUfMYdmXAXYAGW/kKiaCgJgW2WWSnLhWXLQ7XMgcV8FroSXFnFA18EpXUFuUU8a1L/m6mykfFzZbfRBeZDC8nL5ZiFEptYWIjS/Ba/sd9+Vp6fDZXGunS5WVieW1bLndVo0kbu0UKAL3LIgQJ09G8lVs4dPFU0h8rtlPgZWhkKNClJXnJHpMKd7Isaw== 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-SenderADCheck; bh=78uB0mM1iYzBhbxOyZ5Mpwu/awA82aKtIKx8+0aVacA=; b=MpdfmNLjPn9ccwwDzxunj6PMDouZfxrmdvLkEzg6/Kga71tsbJJEI50Q3DWbwVwE81ovnvtKOA6xR5XsyVp7Va89ujWkogRBiPdxVfU5RDdGTmSUazy4oJZobw8ncEiHFHP52b8okFovx4/Tu12LHQRMLfKBcmN3+xDJ7iWN2vXTji+X+L0tedrkm6ouZeKCnK90oBVp3gZC3mpxSXKTiOvPGAV43z3TZ0qj1wh9ZXjqY5rNIVmxPdn8ZmoDUjlXDFnpKukj6i5oByen8q/l+/ypgxmuMzfL1GPbS1XrODB5vEoVdnjqupdIJAo347IufusGRJYReLN+1dROgEeHDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=broadcom.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=78uB0mM1iYzBhbxOyZ5Mpwu/awA82aKtIKx8+0aVacA=; b=MpqIluXriB8QCMA3t1G6LrETBnp9Dn1hYCcQJSvjBO9iXGNhmnRqrD/TQfqZcxF9gUnfidKttBj6ZPAEOvFwnILeTj+YM3QpYtOQMNQLKSvnob84dvdKqyI/1bLFZ2AZDDTlVDnnDFYQtqqrr/Dj5giEhx/sMzWLO2QuDzlMHpmZhxc33JbUem9L1X4F+3D3YtuZC+0Aw9bXL72Z9XcUX5aL8fmDzXZaMkxCVLgCcJPEHPP7d9QoBuALxubQUqR/3ooSLjsX3pAmGIC43APr8eENEwem5UUYaP2d9k2gQWqdnXcZ9aSg8zvRCcevpze76stZOd27q5JNuDbokMSVzA== Received: from BN6PR17CA0030.namprd17.prod.outlook.com (2603:10b6:405:75::19) by CY4PR1201MB0088.namprd12.prod.outlook.com (2603:10b6:910:1e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Mon, 10 May 2021 16:08:59 +0000 Received: from BN8NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:405:75:cafe::2) by BN6PR17CA0030.outlook.office365.com (2603:10b6:405:75::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Mon, 10 May 2021 16:08:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; broadcom.com; dkim=none (message not signed) header.d=none;broadcom.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT066.mail.protection.outlook.com (10.13.177.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:08:58 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:08:56 +0000 From: Xueming Li To: Somnath Kotur CC: Luca Boccassi , Kalesh AP , Lance Richardson , Ajit Khaparde , dpdk stable Date: Tue, 11 May 2021 00:00:08 +0800 Message-ID: <20210510160258.30982-59-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6fa8ce4e-73b2-4d11-8ac9-08d913cdeb7b X-MS-TrafficTypeDiagnostic: CY4PR1201MB0088: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lJYY0XbWicQ4MhNYat2ClyoFJ7jAvN8317KqC5XJiqjretayVK02m1C3R+Cdm/7s3KAFEgRtUaXKeM2NXubM3RxaAXyB/LvgUrTn/X46VTw9Vhlq8kPgek0bfUABDWqNNV372vuTx5oDHLm2JdjGJaa2MbQP0I94zsRi5+d9IHUydJmKBFZRyHd24I/pmEk7eJNLSs1TUQ5n2oDtSynl9JCZwI0vAa30oGGeyXCvlbgWu8eUw34zI32jSiJwlarvAYWrjGV8VkMIxrC/h3vz27vbpyoYucF/th2YzdPM8Zi5W6yafrpJiRax+IDZO+GYMbl4mqf6CPJ+swqOWPLOzVQJUz8mDsjFjTQfbyQrbatRek0k2I7/TozwAz6EO08iII+Gy9Z7K4ox+mBr0d/TIUEcizyyqqlH+CXMdZeiSgdzGBVUughBSu3PkxkG5N5BwNyUvhW1sbRX6z1AQf5z0tCv+x+x0DwQSCl0whNRPWpG2iPzJwjDeicoFwxtZCI6SkFGCeWAYKLmmOun7MhIfZuKnilBOI/wMD2c91ofpKOrn98M4iGdlkybXoj4Pt7YAcZfecg3VF/zJ2pb3nI10l0cen3COO8XOkz/y8K/9zP9A74E1uaGjc62dFmSAPXr7pWIkHyhQT7mm3p59YAJvlzCHXoraOdB5xSbsMM5J60K03fEPuR6dGwjM6n9EGhSYqBGa7XSAjrXdqpv03b+i3IQvwGPsfXc85wsXimKtAKiVbRhKHsmqXvKONei7syBdUbl/doB124aWot4mRKaGg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(136003)(376002)(39860400002)(346002)(46966006)(36840700001)(1076003)(26005)(186003)(16526019)(4326008)(356005)(82310400003)(316002)(82740400003)(36906005)(54906003)(47076005)(8936002)(6286002)(36756003)(55016002)(8676002)(83380400001)(2906002)(70586007)(966005)(70206006)(336012)(36860700001)(86362001)(478600001)(53546011)(7696005)(2616005)(6916009)(6666004)(7636003)(426003)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:08:58.7722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa8ce4e-73b2-4d11-8ac9-08d913cdeb7b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0088 Subject: [dpdk-stable] patch 'net/bnxt: fix xstats get' has been queued to stable release 20.11.2 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. 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/7c69b27093769ef70926f1735fb00c007925b837 Thanks. Xueming Li --- >From 7c69b27093769ef70926f1735fb00c007925b837 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Fri, 12 Mar 2021 10:51:08 +0530 Subject: [PATCH] net/bnxt: fix xstats get Cc: Luca Boccassi [ upstream commit eac4fc71cdaa6b68dbd0e4129e5751c712501693 ] Fix to return count in xstats get op in all cases. Driver was returning 0 if the 'xstats' parameter being passed to xstats_get_op was NULL. This won't work on some applications that rely on a valid count being passed even in this case so that it can allocate memory accordingly followed by a reissue of the xstats_get_op to get the actual stats populated by the driver. Fixes: 063e59ddd28e ("net/bnxt: fix crash in xstats get") Reviewed-by: Kalesh AP Reviewed-by: Lance Richardson Reviewed-by: Ajit Khaparde Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt_stats.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c index 3c9715f5fa..0cf3ee77e3 100644 --- a/drivers/net/bnxt/bnxt_stats.c +++ b/drivers/net/bnxt/bnxt_stats.c @@ -594,10 +594,15 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, if (rc) return rc; - if (xstats == NULL) - return 0; + stat_count = RTE_DIM(bnxt_rx_stats_strings) + + RTE_DIM(bnxt_tx_stats_strings) + + RTE_DIM(bnxt_func_stats_strings) + + RTE_DIM(bnxt_rx_ext_stats_strings) + + RTE_DIM(bnxt_tx_ext_stats_strings) + + bnxt_flow_stats_cnt(bp); - memset(xstats, 0, sizeof(*xstats)); + if (n < stat_count || xstats == NULL) + return stat_count; bnxt_hwrm_func_qstats(bp, 0xffff, NULL, &func_qstats); bnxt_hwrm_port_qstats(bp); @@ -609,17 +614,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev, (bp->fw_tx_port_stats_ext_size / stat_size)); - count = RTE_DIM(bnxt_rx_stats_strings) + - RTE_DIM(bnxt_tx_stats_strings) + - RTE_DIM(bnxt_func_stats_strings) + - RTE_DIM(bnxt_rx_ext_stats_strings) + - RTE_DIM(bnxt_tx_ext_stats_strings) + - bnxt_flow_stats_cnt(bp); - - stat_count = count; - - if (n < count) - return count; + memset(xstats, 0, sizeof(*xstats)); count = 0; for (i = 0; i < RTE_DIM(bnxt_rx_stats_strings); i++) { -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:28.190193600 +0800 +++ 0060-net-bnxt-fix-xstats-get.patch 2021-05-10 23:59:26.410000000 +0800 @@ -1 +1 @@ -From eac4fc71cdaa6b68dbd0e4129e5751c712501693 Mon Sep 17 00:00:00 2001 +From 7c69b27093769ef70926f1735fb00c007925b837 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit eac4fc71cdaa6b68dbd0e4129e5751c712501693 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index 01d90dee8d..bb4b2eee19 100644 +index 3c9715f5fa..0cf3ee77e3 100644