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 7BE2CA0A0C; Thu, 1 Jul 2021 08:40:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E678412AA; Thu, 1 Jul 2021 08:40:09 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2076.outbound.protection.outlook.com [40.107.237.76]) by mails.dpdk.org (Postfix) with ESMTP id 37D7D412AA; Thu, 1 Jul 2021 08:40:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FtQnCOU6YY/q8HlauIrK3OUPHY5ARujNAglt9Gpz0Hc3QcvfZVLJQChFMrKWiy/lFalVwEShmgz19n23Zn/IWZ1sK2GEek2rl+JABQ0sWf/aaKTi2kQRMEtc2KmLT/VyXdadAGb6hZ8KYyJpGzqfHZT5APGqPVLanvnBduoN2JxgAp1PNwI4XIgpDePsfNOsCM5BZS0+iveZDBI2aohAYIoYaOAsMfDHB8I6KxuIhJDNP6uYPZ+5WPaoz1F3CAVj57byYEZ+i2uIYFB7D5KqzZ0tJ01EkSMKa56QhGnEbPK7NDrq8TpEaFoB0wtJkkGkjb4QVVuAtM1zFdVW65Fqrg== 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=YR+Lxwu5LnM+r9Yn01OUXBv/yLRZOgRmKXcYLxJRaTY=; b=QVK+A2H74lPkIpq1iC62RtxiWkuilTY2kh29wBew4mTk7MVR7L6eqLklYKHAwIFrSi5lwNuMo6xroz8J5msDTrTQv0TzstkTTqBgjtMuLPja0/9B6Kll3rmlR+foSvRZdYn/BRC3vHY+8bPXVwYSZgdosajCNocYj5TFzhSdFntN/JLCLZwgIdp9zzpA/xYpOdG9dTMJSjbLtbMu9oyHloxEpaDzjgHb1GDU5lK6CEboJCASQy7nl5CbJnZ9gxSD6GZi/Yq26faZ6o0gLZDuo7oiktCqR0TwjDoRFmN8GLz28LmVqx17evp8QDY/9ZPyRMwS937ZS50mRCWZaJWObg== 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=YR+Lxwu5LnM+r9Yn01OUXBv/yLRZOgRmKXcYLxJRaTY=; b=T6MSvtjTufTBiyvzMLDtJOw76AoOnOGNbT24B49GCFP9tOg3EeEMgdQd6g5LmRlieIlqgwqntZvJLifXFg+J+f8FSvCAV7naK+dhx30XCVogPxMlSABly0YVCvSqpqAtTmYYWdwkkRo3SmkAzA39IkMPFQq9xo3vVvVkcg6/C3JarGI7xLYVHdineq/83aIjOOvx0N8VjCsskCHFjdcmOSRUuP68EcDYajcAkWgSF/tlxguFSLd58YZ1b2mChZ6JbOx31havJ7ohczZ+lempVqpPcBWvWMgZWAJAi7WEyfaZPxSKOoZVnRHTD8sdCSj33F75HeSk3HFsiFxnNCM9pg== Received: from MWHPR17CA0083.namprd17.prod.outlook.com (2603:10b6:300:c2::21) by SN6PR12MB2637.namprd12.prod.outlook.com (2603:10b6:805:6b::23) 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:05 +0000 Received: from CO1NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:300:c2:cafe::8c) by MWHPR17CA0083.outlook.office365.com (2603:10b6:300:c2::21) 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:05 +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:05 +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:40:01 +0000 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Date: Thu, 1 Jul 2021 09:39:16 +0300 Message-ID: <20210701063916.2016763-4-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: 5074f901-c9c9-4f18-ce3e-08d93c5b0fa6 X-MS-TrafficTypeDiagnostic: SN6PR12MB2637: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eDdqoi93hZlgfKFWUWm8EoDWXDG6a9t7AGcOfay47fpI4O8KziU2Nl6bwswEP5FbR3n37Cj8b+ckvk6YcK5kfv/w8L4/8QHCVcXixYgLh33ZhA2Me80E3hfUJzH0IxooroDrex/kkdK2DrLPlxUiMmXLx4wBOjDYw0X+6puJiHf6dOysY4B3TfQKAaEpPFBY/A9MIJg0QaliUv6EpZ+AQbfNm46qOED9D+nL/FhVVndA/uGfEyePC0owcefo4bc21K/IhX1yxidEBhKDJH5geCKqFNv8pSaEYnzNuHonJSzPTj35Gw0V5ait+vEkaPADMyUZzzDieo75sApoAKoPaT6sJuWLk4CfmRHaI9w6QATU/nbadvkNfRcuWIP9tOLw4yTTAJ1BcQcgl+Rr4bAT8GwOHh5Ms/FAebrVtqJRxW7FT3x6/QuS3LvrwW+ooP/1+7c66OfpJC6UQL4J6He2jWZ42ptTJaqYcsB/aNh7RlfO38xyRxjSO3lIPtoRt6v/N6k3aW+0HE94LHy1v2O5Oae9zLIRqL3ctXBIix+re2zauAsPPOBVVp3PLzWPOYyJhsv8mAhiQ0FQGhqOGATe8UcktOa/qMSlLPgFW7zhAPxoQdaWO4hgKqxuyUulKR0YDBbxk1+mQPsXR/3ingWHvQCu8GSw+gL/pWm5j7uJDxSjTZ/cmbXYvNBE3d7+5EiCZQUbCiHB8pCsU/DI8UjKVA== 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)(136003)(396003)(39860400002)(376002)(346002)(46966006)(36840700001)(8676002)(6916009)(70206006)(54906003)(36860700001)(426003)(70586007)(316002)(2616005)(4326008)(450100002)(86362001)(1076003)(5660300002)(82740400003)(2906002)(6286002)(336012)(55016002)(8936002)(7696005)(82310400003)(7636003)(36756003)(47076005)(356005)(6666004)(478600001)(186003)(26005)(16526019)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2021 06:40:05.0817 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5074f901-c9c9-4f18-ce3e-08d93c5b0fa6 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: SN6PR12MB2637 Subject: [dpdk-dev] [PATCH v2 4/4] net/mlx5: fix constant type in MP allocation 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_mprq_alloc_mp function makes shifting to the numeric constant 1, for sending it as a parameter to rte_mempool_create function. The rte_mempool_create function expects to get void pointer (uintptr_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 the variable might lose its value even though the function might get 64-bit argument. Change the size of the numeric constant 1 to uintptr_t. Fixes: 3a22f3877c9d ("net/mlx5: replace external mbuf shared memory") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_rxq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index bb9a908087..83ee8ddb9c 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1240,7 +1240,7 @@ mlx5_mprq_alloc_mp(struct rte_eth_dev *dev) snprintf(name, sizeof(name), "port-%u-mprq", dev->data->port_id); mp = rte_mempool_create(name, obj_num, obj_size, MLX5_MPRQ_MP_CACHE_SZ, 0, NULL, NULL, mlx5_mprq_buf_init, - (void *)(uintptr_t)(1 << strd_num_n), + (void *)((uintptr_t)1 << strd_num_n), dev->device->numa_node, 0); if (mp == NULL) { DRV_LOG(ERR, -- 2.25.1