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 DD077A0C3F for ; Sat, 12 Jun 2021 01:14:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6B884003F; Sat, 12 Jun 2021 01:14:59 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2054.outbound.protection.outlook.com [40.107.244.54]) by mails.dpdk.org (Postfix) with ESMTP id 2DE9E4003F for ; Sat, 12 Jun 2021 01:14:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FfVf2CNXdkSj7JuZV7gmjdlcNNmt4+V+kAlTanlOWIAwbMR3A2mT5/jybyVhf18aA2qed7vOBOnTMGmHEF5tq0kLsFAwt13vOIxlctaqJIM81tptzyiPt0sksM/cbSSOeo+G9g1vlgAZnS1zZBoBacHAzirobGpxg78GM3jmr4nu1Thmw1o4/wrmCRt+Peq2tOkCuxZb09DPkTcjR0UVa9Y7f5Yli61zw+Z206PiQBgDSC5hSCm+yFO683BcnpOHlcDfTcRbIouRPLJrVQitKFvJeLTGQ4fSgt0PCqoDO9AvJqKiiDNDbxw7LR48rEBO8Boa+zXDhcaOBQ/OHuz+sA== 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=RoF2E2Jq4imrww1Sc5bUKFdmqLXK4FcD8fe1be5jgrA=; b=OQvMWfWIkCQtioiUttsYEa168dodcWpJBTxdazFPV3/cK2o6Uz0oIJNqwrZ0g2jXwHdythur+lsaDQ7PaPjE7aDZJWv0VdAmU0xKPXDLkYegdlslRSec4xaoDMmkwbdyPvnSzDKXPTe9Gro7tL90SNYLUAqgwTrhgb45JKMv+C5ZHzKNK7gk35SkGLGrzrPwOlLG2zp3krjgMhXg2RJxI5JmHhMpZEGEBjra23a/gXbPLopoywDFXJYJo6XW/c3Qe0LY1BoeGpte8ZeBvrs3vv5HN0p+HjHJaEhekt8X5dVN37xQs66VSdqN6k3p5KdnW111Du+oZ4IqRkK4sVpJJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.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=RoF2E2Jq4imrww1Sc5bUKFdmqLXK4FcD8fe1be5jgrA=; b=hZbn+9RmlEkzlo5AEflJWlQrmz3XtjvKg5vDwTp3jT2GqTPC3VnT9GstUnOGgJvWPs+tes1RayCVIuY8lreUlsqUT4OksEqjw8q4KqkxRJAn8OX9Z7l2eFiMCiPxeHmAulPip30htpNQo4eierJwu0oozBNCDe9ujqEzbySUjMP0ayuxVjYdhgESCuN1L46dG4TzC5poNWn/g8CWCQSpU7wu84plQHLqBu26AAEjwKpw/m81bJg4f3OgAcw1GlVPF/JF8qhtO7On+u8r3ZbmL1SljC9JWzmHN++1w8b8qtXBwKNhi8NhUiYGfBohz10Uzsxb3QMnPvDWUfA6eytrNQ== Received: from BN6PR18CA0005.namprd18.prod.outlook.com (2603:10b6:404:121::15) by DM8PR12MB5397.namprd12.prod.outlook.com (2603:10b6:8:38::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Fri, 11 Jun 2021 23:14:57 +0000 Received: from BN8NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:404:121:cafe::63) by BN6PR18CA0005.outlook.office365.com (2603:10b6:404:121::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 23:14:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.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 BN8NAM11FT035.mail.protection.outlook.com (10.13.177.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 23:14:56 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 11 Jun 2021 23:14:55 +0000 From: Xueming Li To: David Marchand CC: Luca Boccassi , Qi Zhang , dpdk stable Date: Sat, 12 Jun 2021 07:03:20 +0800 Message-ID: <20210611230433.8208-106-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210611230433.8208-1-xuemingl@nvidia.com> References: <20210510160258.30982-229-xuemingl@nvidia.com> <20210611230433.8208-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d2b1f07-120f-4ebc-b271-08d92d2eba65 X-MS-TrafficTypeDiagnostic: DM8PR12MB5397: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SemEUM3K/4kCsp0iP1GN4Q5ILU6yNZAcNyDg2FnQv5yNy0W5s7XiNxDV19rpKZhdee8jAVPnkgDXHuGmZhBchoBhnAQte64YsX7FVtmiOdPW5PYbeoJKltv0ixS0jAVPk54dTPQfSeFSftt7/0lzHxLBTnDWckRi+pSCLxQJmLHeKC5WI1dSsrFLGRz3x6vxRPxILonUI0CBHaxJJGYR85v/OmxDeKK2Vt2suChd677FwVIvCwMInG4OHyCO1wMBWQeM85h/2yA8BQixKaRkScnze+uCQWNuWREL8YRgCUr/hg9JaS6aDSbs8JlCFXL8iaFifDOEMaOxUfGTNMku80FMIQi3PZCewJylWRSBvNVfHopwLZV6Itd03YRosEoptsinNmE/webnxY7lGkyI//UVirgcaOYHwvRKNzEGw0mSvRuCLvqHdNCgi2k/UP03N+N0chw0ZVH8xX+IQq/gxYhwxV+xmBM8lwms3rNDwRWH/oU0IeBHAAbqC04NLgZqRSD2U3BqBsdZVTFa5g6G1+45FYQKnj4BPVzLXEL7x5HTNDK+xEF2lVKJNIQXWRZuFoesBikpdNCymoDjI0QqGJNcIeJ2KuCDi5bpphz6HPQ8bEHD2tNJnYcLXTRgkGx1jbkYOZda8R+fikpWfmVHP2knvINWU4Ezb3DzvxwpvTiXGirxKPEraFPi3q4uNLpW/fV8Yi7t6x9UWSQs1hlP2RDof0n/zc4IRpivXtfAZOgC4D31IQlANguT5rKGI4r5Blbe4vDSDRfuwqD5YM0jHI1EePXGg71/vroWw7JjgbgQ8/QWRycX6b29ipolNRSu 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)(376002)(396003)(39860400002)(346002)(136003)(36840700001)(46966006)(2906002)(5660300002)(53546011)(86362001)(83380400001)(26005)(2616005)(82740400003)(36756003)(336012)(7636003)(4326008)(8676002)(6286002)(82310400003)(8936002)(426003)(356005)(478600001)(6666004)(1076003)(70206006)(966005)(6916009)(186003)(16526019)(36906005)(70586007)(54906003)(316002)(7696005)(55016002)(36860700001)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 23:14:56.6849 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d2b1f07-120f-4ebc-b271-08d92d2eba65 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: BN8NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5397 Subject: [dpdk-stable] patch 'net/ice/base: fix memory allocation wrapper' 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 06/14/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/6db31e330446f6830e8a4dc4c29f2f13622252e1 Thanks. Xueming Li --- >From 6db31e330446f6830e8a4dc4c29f2f13622252e1 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Thu, 6 May 2021 12:07:02 +0200 Subject: [PATCH] net/ice/base: fix memory allocation wrapper Cc: Luca Boccassi [ upstream commit 35f9cb006534018b6f69dce8f0d22684fe98e812 ] This is reported by our internal covscan: 1. dpdk-20.11/drivers/net/ice/base/ice_switch.c:4214: sign_extension: Suspicious implicit sign extension: "s_rule_size" with type "u16" (16 bits, unsigned) is promoted in "num_unicast * s_rule_size" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "num_unicast * s_rule_size" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1. # 4212| s_rule_size = ICE_SW_RULE_RX_TX_ETH_HDR_SIZE; # 4213| s_rule = (struct ice_aqc_sw_rules_elem *) # 4214|-> ice_calloc(hw, num_unicast, s_rule_size); # 4215| if (!s_rule) { # 4216| status = ICE_ERR_NO_MEMORY; Even if this condition is not likely to happen, in any case, it is more straightforward to rely on the existing rte_calloc. Fixes: 5f0978e96220 ("net/ice/base: add OS specific implementation") Signed-off-by: David Marchand Acked-by: Qi Zhang --- drivers/net/ice/base/ice_osdep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h index c0f1e77257..818bfa3b89 100644 --- a/drivers/net/ice/base/ice_osdep.h +++ b/drivers/net/ice/base/ice_osdep.h @@ -192,7 +192,7 @@ struct ice_virt_mem { } __rte_packed; #define ice_malloc(h, s) rte_zmalloc(NULL, s, 0) -#define ice_calloc(h, c, s) rte_zmalloc(NULL, (c) * (s), 0) +#define ice_calloc(h, c, s) rte_calloc(NULL, c, s, 0) #define ice_free(h, m) rte_free(m) #define ice_memset(a, b, c, d) memset((a), (b), (c)) -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-06-12 06:53:59.334385400 +0800 +++ 0106-net-ice-base-fix-memory-allocation-wrapper.patch 2021-06-12 06:53:56.460000000 +0800 @@ -1 +1 @@ -From 35f9cb006534018b6f69dce8f0d22684fe98e812 Mon Sep 17 00:00:00 2001 +From 6db31e330446f6830e8a4dc4c29f2f13622252e1 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 35f9cb006534018b6f69dce8f0d22684fe98e812 ] @@ -26 +28,0 @@ -Cc: stable@dpdk.org @@ -35 +37 @@ -index f4cc762e99..878c5597d4 100644 +index c0f1e77257..818bfa3b89 100644 @@ -38 +40 @@ -@@ -207,7 +207,7 @@ struct ice_virt_mem { +@@ -192,7 +192,7 @@ struct ice_virt_mem {