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 2F7B8A0A0C; Thu, 1 Jul 2021 08:40:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89B79412A4; Thu, 1 Jul 2021 08:40:04 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2089.outbound.protection.outlook.com [40.107.95.89]) by mails.dpdk.org (Postfix) with ESMTP id 2A2B84129C; Thu, 1 Jul 2021 08:40:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ebx1ysy6/Tzwl1Xr2vHednXAYHMHNnjT4eGK9AKqmue1PQUz9FvmiQblEvVaJ+UnMUbFIM3hXeNaLpiTY26qNypaMRsuLS5G4qRZoyMXBSfH+3kmYYQ3qcvp6ZMkLyk41OSgHT/fymvsQ3u3IHxBlSSOiBvdyErrYzPQgkhlFWEozEZINHDSTgvKk4JP9V6KtwzZmw+o0F8UZt79ZLQXu+unvcEcUucw21fyqVI4nQSZ5A7e7y/bVF1tn3gjav1HJqPSkDaG3xznz/KZjXCe11EDB+Cn6QH5V4C0lJmX5klDzyQplZ8b9QRJthU7q39q8btadBkdAQJB1epk0dyO8g== 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=DAV6b7bXyxY/N+9gYvVZOJXfPnzsebSswtX99+8DMrM=; b=Irbq/QjgqmhEiVY9siOABX9fFypNUyIPhwQ8DdBuuWeZd/Fc1V5JddQBeE3BzIm4B5lp/wUklzTv0LofEBwCTyPgqxV7WizcxBJC6Cs5bmil5yy7oeRU+Hqg7ANBv37Yvf/qdSqh47z/FSE8moxSuTsnACZk+DFDVilPS4A+3K9OMoo11OxT+kKGIRLLU96/CRaJE4wUWUkpnN+7acTzZwoq9Evzz26X4RYpLXQz5cyU+ni14uPczePXHkac1DS3nRJ5Oc+JEw96jtziquTSntpJ1M5/0nLEAu/hOnoH4P9GpaSkHbN/BF29i4gWbdOwTmX+kCj7zuPT+1ywfJ3eDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org 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=DAV6b7bXyxY/N+9gYvVZOJXfPnzsebSswtX99+8DMrM=; b=TpsDaW282CojKxhwVOgZHEvrnTz1YdWiI3Kr5gHE6ulyqQ7L684UuKlIB0rceIPnv/jOToLX1bHprmnwbn2Ae3wU503cQlBkASFDO2sdGXES/pXbqJf7xeIf4/ld6sbG3ZROe3wRqdLVnbtT8bmkxqoL+210JbVjpo5Au8PSbt+XuDPAqpTLVTeAuVCMgwJzLV1YCHXNS9bu5mQBPD0dHD1NiRNqnxmplRy6ubEcp59ibSUBZ32z/x+mFVDDUz9ADOFviwWScI1W+Hw9iRMTSWO8yoPw/4WdZ7AzF48lcHowcMPtU3xUeWJRTuBktfvhRl9lhC2kpZyTH9P7F3WLEA== Received: from MWHPR17CA0095.namprd17.prod.outlook.com (2603:10b6:300:c2::33) by CY4PR12MB1255.namprd12.prod.outlook.com (2603:10b6:903:36::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.23; Thu, 1 Jul 2021 06:40:01 +0000 Received: from CO1NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:300:c2:cafe::43) by MWHPR17CA0095.outlook.office365.com (2603:10b6:300:c2::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.21 via Frontend Transport; Thu, 1 Jul 2021 06:40:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 CO1NAM11FT056.mail.protection.outlook.com (10.13.175.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4287.22 via Frontend Transport; Thu, 1 Jul 2021 06:40:00 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 1 Jul 2021 06:39:58 +0000 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Date: Thu, 1 Jul 2021 09:39:14 +0300 Message-ID: <20210701063916.2016763-2-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210701063916.2016763-1-michaelba@nvidia.com> References: <20210601071122.1612432-1-michaelba@nvidia.com> <20210701063916.2016763-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 746a46c2-e425-4ebd-d28b-08d93c5b0cca X-MS-TrafficTypeDiagnostic: CY4PR12MB1255: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BtMFNl/lANoz0wJGtT5q9m0/zdW0xwOtgdgD7436K2sY0X/Eh3eeN4UW85RMRubiR6j4TiyqS1HVvF61Oic5sPxlEPE64ur65tLYwGqxyHKfkGMl/JA4h7aEiIY3u7faS1sgv/D/klYILNpgDoOpAlzkCoVW/SRJGyiJKijot2ZGRF+LmVrgQX3/MFlTTho97Sl9NAqc32OicTigYvYn/xrAE0dCCebZYCRy1n6Qrk97ViANy0YBosaBU9IBKleyTCf3gmbQKA6wz/fmH51Nx7Hy4mhIrKSCUbJb3qTRd6fwV9MbtKfd8Zo9mfBxrdep2GhiT2sH1SmmJXrj3J4OmYE5y8cvWkfONURaAlk8AHgX2ce2CWYfJrgBCSXb5IqCTgpGXPOSFfdp1AVpKnHmsTNI4vfvqIW4OMajHUe4wD5LwQspxWc5lj1t8KOVdPt2bxoAxMfkx/u1L6yZicHqEZ/sYXo3XGWzakvbVOjVv2V4BO2KX+yV4FNs0jwohPajyMNzicc7Fsg3upJtfTwLxRDGg0PbKx9fqPcI8/Ys9xItYNJMbd/wblIspMNufthfSzn9cgX573wW1PzMr4+d7mMS1YF5QwU7ehQr1TZcc26lmwRPaHVCkmv0VKDXHsVP+b3HVR37Pswne0Ocf7nkK1dKRWr/lzEM9EPo9g+YFY4FcFmj8cSidSMguYoDlK0lrG1dkQ46YRXZl31Tdg/x9w== 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)(376002)(39860400002)(346002)(136003)(36840700001)(46966006)(7636003)(83380400001)(54906003)(356005)(6666004)(26005)(7696005)(36860700001)(5660300002)(478600001)(1076003)(8936002)(2616005)(55016002)(6916009)(186003)(316002)(16526019)(86362001)(82740400003)(6286002)(8676002)(426003)(47076005)(70206006)(2906002)(36756003)(4326008)(70586007)(336012)(450100002)(82310400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2021 06:40:00.2765 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 746a46c2-e425-4ebd-d28b-08d93c5b0cca 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: CO1NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1255 Subject: [dpdk-dev] [PATCH v2 2/4] compress/mlx5: fix constant size in QP creation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The mlx5_compress_qp_setup function makes shifting to the numeric constant 1, then sends it as a parameter to rte_calloc function. The rte_calloc function expects to get size_t (might be 64 bit) and instead gets a 32-bit variable, because the numeric constant size is a 32-bit. In case the shift is greater than 32 bit and it 64-system, the variable will lose its value even though the function can get 64-bit argument. Change the size of the numeric constant 1 to size_t. Fixes: 8619fcd5161b ("compress/mlx5: support queue pair operations") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/compress/mlx5/mlx5_compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index 80c564f10b..f09f71ecd6 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -209,7 +209,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, return -rte_errno; } dev->data->queue_pairs[qp_id] = qp; - opaq_buf = rte_calloc(__func__, 1u << log_ops_n, + opaq_buf = rte_calloc(__func__, (size_t)1 << log_ops_n, sizeof(struct mlx5_gga_compress_opaque), sizeof(struct mlx5_gga_compress_opaque)); if (opaq_buf == NULL) { -- 2.25.1