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 155CB457A1 for ; Mon, 12 Aug 2024 14:56:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C8EB40665; Mon, 12 Aug 2024 14:56:26 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2046.outbound.protection.outlook.com [40.107.243.46]) by mails.dpdk.org (Postfix) with ESMTP id 69B494029C for ; Mon, 12 Aug 2024 14:56:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=T/bdRn+RXOmVVs1h9gR+os7BLzTh2CM0wdbsGsvj3tbRIz0/DRLl+NTVGzbd7+czXGxMrV0s/cVfa8eayGzNuG99j1GxnX1D1pguBhanfuM+4DOnNBP5Ybbkf2a5iKRF6Px7KSKyVpOXND6UeAGFh7W8jtOMVa7nICiRxl8Fn/WhK47Gnsl0MerrsaBcHCI9aJZvdKubbkg+GLfKg5Z5xfiA32Xhfzzk4dRqyMpPVfkAo0Wj5perxhYTrqVlwhc2xmZ6TiV8CDTWI3cbqSYqXcmamEWYsB/DYZGV0vfmG2aNMZMixVi70SytkzBWatBDlv3+qbfhVVd+8z7hHE/pTQ== 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=fncaK0negPb+0Ic6upDpvF0fWgNKe4HlAPjz0npj9Aw=; b=GJJPbrdX6It6iCvJydSrLRnz1rxvauDjJu20hxCMmSB8788SqGywsQoZDqP+/NFKL/wIH/9lYKGNVh+1MuRUamOYVd0+vRweNymy0RNVBaFHdhNhG3tgv1Jv95QwAz5izr50WbAy2nILRJYAza2lihMaCmvoX5UiT0xAWkKowOS/6J/Omprqa5nHiu78/ukA1AOk+2BSJqo++V0GGZY5F1SB6WBeXGzlBuXwkOuNflGcmXHiNSmd6OOOLwIJTG3x2ZIwz37dAjppjj+uu6KtMPBLjyG/hkaNw5owo70n5NqoWa5oyZqu5RSjEqeVvg3CR/EBnGkkgUuSA+oQybFKHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com 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=fncaK0negPb+0Ic6upDpvF0fWgNKe4HlAPjz0npj9Aw=; b=MooFYHM4q3RU7iitjXBDWHioWURIYw7kS8TdSFJc4HqA6MRUfacJrT0+t/vdJE0bWJpPQPWj0qejR0WoyCBMdBmyes6AC4u3dDqznKYevjCUCEe6r82KW3DTUYgCaVl2walQ7MByXZeKsQo4pqBgDFJHnHzhDLXjz/6xEUm8/8aySUONWGcSUhMFR9QnQzk5/DNCQwfrNIqYJK0qg+z93l6N4y9fLlyq0wAyKsUGKtC3sT4/CIdx175HP+/2AD2M0I+q93kq1aLYPtL3HOL0of6E632Pk8GzvcwxV1RmP3LveTFJZNFz1B9R3BxP9xajxhF2PenAaRXHs0o7u/Jhzw== Received: from SA1P222CA0034.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::7) by DM6PR12MB4057.namprd12.prod.outlook.com (2603:10b6:5:213::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug 2024 12:56:21 +0000 Received: from SA2PEPF00003F64.namprd04.prod.outlook.com (2603:10b6:806:2d0:cafe::a0) by SA1P222CA0034.outlook.office365.com (2603:10b6:806:2d0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Mon, 12 Aug 2024 12:56:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SA2PEPF00003F64.mail.protection.outlook.com (10.167.248.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Mon, 12 Aug 2024 12:56:21 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 12 Aug 2024 05:56:09 -0700 Received: from nvidia.com (10.126.231.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.1544.4; Mon, 12 Aug 2024 05:56:07 -0700 From: Xueming Li To: Jacob Keller CC: , Ian Stokes , Bruce Richardson , dpdk stable Subject: patch 'net/ice/base: fix size when allocating children arrays' has been queued to stable release 23.11.2 Date: Mon, 12 Aug 2024 20:48:52 +0800 Message-ID: <20240812125035.389667-56-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240812125035.389667-1-xuemingl@nvidia.com> References: <20240712110153.309690-23-xuemingl@nvidia.com> <20240812125035.389667-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003F64:EE_|DM6PR12MB4057:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d16d151-0a51-4994-e15d-08dcbace2a70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Df+RKa4+BTZmhIDgd0zQKdVX7ucAlrhJWomziN9SgWWl5N82dA0CaoKCyc78?= =?us-ascii?Q?bd0TOkVcn0gW6h8yz9xHqZJ6qEejFZWJ5UUcKljyKTf2DVLniFKeS5mF9RP+?= =?us-ascii?Q?+kmryW7hXoql/aYRzmTBHhRAjC0TubQldZ44goGikj/raNw3qbnUy/YIPzIC?= =?us-ascii?Q?i3iVPn3ELH8TZrxWVBJOQP1r64022L7yUdHWtFELEcNi5WbuzosRhuq1oVJ6?= =?us-ascii?Q?KC5IU/5D0U7jVuwsZ1x6/tF09k+e3A5/j+rFuHVV6tq2xAfKG9b31J0++SBH?= =?us-ascii?Q?hHu4pWsc8hxPgWxqWA+i/N3CXbhU14BCO+7s+XP/qNgTt7UdhL+1NhDmcDWW?= =?us-ascii?Q?RRMI3u6lG2EE+jkgO/DhpgnX72gojIrqsC95OSnVAX4lD088vS6lQaDfz1Vd?= =?us-ascii?Q?72x0KAAlcH6I7FseFmCMGbXmhl9kOJHuyI+lOMlqhjhrK3QhAx5stldcRv/S?= =?us-ascii?Q?DuFXZL6lz9NBv0ppbHR6hlhKzGbTlbgZM8tW8yyR51FIdkqm4fa+zGkRWR1z?= =?us-ascii?Q?bWeEENZzWWJWa/mYnv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?Q?NWU7r+nVo/AmR4SHqcq38xKOPziqZ1A9?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 12:56:21.6431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d16d151-0a51-4994-e15d-08dcbace2a70 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00003F64.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4057 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 23.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 08/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=8bc9ae6b59c2a6a3bb4783a9d3b604195831347f Thanks. Xueming Li --- >From 8bc9ae6b59c2a6a3bb4783a9d3b604195831347f Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Wed, 26 Jun 2024 12:41:08 +0100 Subject: [PATCH] net/ice/base: fix size when allocating children arrays Cc: Xueming Li [ upstream commit 3072e5e2da9870d8cb119f15482eae9d9fb51e98 ] The ice_sched_add_root_node() and ice_sched_add_node() functions have comments to suppress Coverity warnings about a suspicious sizeof used when allocating the children array of an struct ice_sched_node. The size is calculated using the size of the scheduler node, which overallocates the array by a significant amount. Fix the code to correctly calculate the size by using *root->children and *node->children respectively. This saves some memory and allows us to drop the Coverity suppression comments. Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler") Signed-off-by: Jacob Keller Signed-off-by: Ian Stokes Acked-by: Bruce Richardson --- drivers/net/ice/base/ice_sched.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index 75dd15c3f3..21cfe53a6d 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -28,9 +28,8 @@ ice_sched_add_root_node(struct ice_port_info *pi, if (!root) return ICE_ERR_NO_MEMORY; - /* coverity[suspicious_sizeof] */ root->children = (struct ice_sched_node **) - ice_calloc(hw, hw->max_children[0], sizeof(*root)); + ice_calloc(hw, hw->max_children[0], sizeof(*root->children)); if (!root->children) { ice_free(hw, root); return ICE_ERR_NO_MEMORY; @@ -186,9 +185,9 @@ ice_sched_add_node(struct ice_port_info *pi, u8 layer, if (!node) return ICE_ERR_NO_MEMORY; if (hw->max_children[layer]) { - /* coverity[suspicious_sizeof] */ node->children = (struct ice_sched_node **) - ice_calloc(hw, hw->max_children[layer], sizeof(*node)); + ice_calloc(hw, hw->max_children[layer], + sizeof(*node->children)); if (!node->children) { ice_free(hw, node); return ICE_ERR_NO_MEMORY; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-08-12 20:44:04.378657751 +0800 +++ 0055-net-ice-base-fix-size-when-allocating-children-array.patch 2024-08-12 20:44:02.085069292 +0800 @@ -1 +1 @@ -From 3072e5e2da9870d8cb119f15482eae9d9fb51e98 Mon Sep 17 00:00:00 2001 +From 8bc9ae6b59c2a6a3bb4783a9d3b604195831347f Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 3072e5e2da9870d8cb119f15482eae9d9fb51e98 ] @@ -20 +22,0 @@ -Cc: stable@dpdk.org @@ -30 +32 @@ -index c9d70fb043..74d57329da 100644 +index 75dd15c3f3..21cfe53a6d 100644