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 C5B10A0A0C for ; Thu, 1 Jul 2021 08:40:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE0CC412B1; Thu, 1 Jul 2021 08:40:05 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2068.outbound.protection.outlook.com [40.107.95.68]) by mails.dpdk.org (Postfix) with ESMTP id B8839412A8; Thu, 1 Jul 2021 08:40:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FdyJZTKmCH9UB0k66UD6F44DPbsS8uVP1vI1/xeghLHuwnABOe2GJxLBbB5YWTQrNNQFAN7SVSGyzjf57jQwPKCHbCNtzVUch7IC1DAdqp6RBh7IbHOasSsHy8fUsuGp1N7oYItvIsCMbnPZaPlH00HuCoILIl5qfXGiI5lMQTIaefc2Z8XmCHIHUvwg+BhJbLnBQdnC54tmA5E/3LNEDrKTS88XEEapZh5WGgTLH/dH/OYafFGO6UQ30wq7IalApHGLRxHwrmgrZdc3er0NEzpwDZN0wLQ2OFgwt3HnlJPcjeUh/mvXyaJRc7sPi66AWxTwPj6NAFDMtZdioQLCgA== 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=iMoEMLCY1WUF0dg/GO0QEn3cHzjzwALGXw55jTfKD00=; b=j3bMYZj4ENcq+j3dYHixDiYvg0lgyBysidcsQdtgYMlKY8PAJ9dtvHuRTr71Il+Mm2vONvC/TSW9++/9+c3D8jIabWUUSCm7karT2lzp080XAA8G4aa5+pfpBcHl4lWNev09bQvmTxZv82+f88GEshbNTj2f4xOwXfG+Uu4GA3dNuab079iOyPOfhVy/rfst+ZCLfUL9IbHQqtGooQBi+Eqz+Y2FoaCPfFAatJ6rtTx/+GgovFHcLe/TkzwZ0QmRWeDv+UhMt9zVj4yNLxvceCDhmBf9CsR1ujhhwtOxXHLQc13KdOFh4pbmy9ae6pxU0cU1gmg2bPM1cu2en8wlMA== 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=iMoEMLCY1WUF0dg/GO0QEn3cHzjzwALGXw55jTfKD00=; b=NbxIVusUSF1bO4P1PahOpOgjxhMmB4vSEN4OiqbdlQEL3gZDFeXCmNaUe4KKaMxvMsoKe0O/ag+sZyAu3sIS1Alpk3diydFceX761QheBhH/bUpywpw/Ps3TiAzHDIn4IPU4FjtksVZUAL524BdX1MmbuLbaVU2aowSbq6ojFqXrXqeflxj9bEHoFo9nfrMf5CfpgRgWE69/fKVQCSD5XrkoS7drhlrJIyTXIazG5F/s1pzvjDmNhWA0UC0O7SZO2oEkdpO+mW4fghodlA45W/lF7oTPRhRaNZ4XzqB0f2loVZmGPeHF4nqy1VRhAIdN8WKDu+/nC5C4c1VPn30umQ== Received: from MWHPR17CA0087.namprd17.prod.outlook.com (2603:10b6:300:c2::25) by DM6PR12MB4894.namprd12.prod.outlook.com (2603:10b6:5:209::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18; Thu, 1 Jul 2021 06:40:03 +0000 Received: from CO1NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:300:c2:cafe::9e) by MWHPR17CA0087.outlook.office365.com (2603:10b6:300:c2::25) 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:03 +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:02 +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:59 +0000 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Date: Thu, 1 Jul 2021 09:39:15 +0300 Message-ID: <20210701063916.2016763-3-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: 85df34fe-ae5f-434a-08b0-08d93c5b0e3a X-MS-TrafficTypeDiagnostic: DM6PR12MB4894: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jwS8YSAnm60pCB++QalICUqibVV3y2bLnHeJqhTJgDDJtDuvw8qe836rsjm6AmsLXngJ4AvsRhN1CQNL8K24LT2NmxGwnocqjdKBNsW5zp1MMtMaTnBcIuM5tht6bYLAmAyIuOetCL61cXZt991DTW2yjqSlLG/8yVvCkqeXl4QtAeThlnOzh4ztCDlhK5sPaWs6iPhrgGTJJoskHq679RCrc/IRd1XjF6v/9/I6Ruvyo2SGAVnMOYWCyUveWlNcivEs8WTP1Z8bcMIKf9uWaIeA9K6XROOvg9khz8VwGeUN7cmziudr/uiiuw2N2H1AoiSf9sz1XOdvpBN3SaV+1kFfOdGbabP4oLfwodZwgpES4IiOCrcMCFE+JL+u/TibdUvOAIipjNd7s7Y9433I/kcAGkQOrpAWGcUb5EgeywLfOc6BY8JcfZ9fY1Yh9w9Ufx0vJvHbASkrowJm8r9ZQZMrj66pu4OABpJ0tsbZQsFmIiBS7Nlc13U7Vc86vIYEfvCEDPneiVbCd/24Wg9FrDwPea68riEhhjKHAevkq3/GdShP86+/QXq+ACS5AV249zueTHNqi9q25mK55r833QkFtOX1aOPGkfhGpGXowXJnOCRIl+w/Mys9hEPW4HYORwj0PutUX8W6+JCPfIrB+Vc2P4t4z3gVcZsa2Ex8PUAawndAkiuHZ/cRZyEKjhK6HJl4E8y24QudkRaT1s1JGg== 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)(346002)(396003)(39860400002)(136003)(376002)(36840700001)(46966006)(336012)(426003)(6916009)(7696005)(316002)(7636003)(5660300002)(356005)(70206006)(70586007)(55016002)(2906002)(54906003)(6666004)(478600001)(4326008)(26005)(82310400003)(186003)(83380400001)(16526019)(8936002)(1076003)(2616005)(82740400003)(86362001)(36756003)(47076005)(450100002)(6286002)(8676002)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2021 06:40:02.6891 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85df34fe-ae5f-434a-08b0-08d93c5b0e3a 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: DM6PR12MB4894 Subject: [dpdk-stable] [PATCH v2 3/4] vdpa/mlx5: fix constant type in QP creation 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" The mlx5_vdpa_event_qp_create function makes shifting to the numeric constant 1, then multiplies it by another constant and finally assigns it into a uint64_t variable. The numeric constant type is an int with a 32-bit sign. if after shifting , its MSB (bit of sign) will change, the uint64 variable will get into it a different value than what the function intended it to get. Set the numeric constant 1 to be uint64_t in the first place. Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c index 88f6a4256d..3541c652ce 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c @@ -629,8 +629,8 @@ mlx5_vdpa_event_qp_create(struct mlx5_vdpa_priv *priv, uint16_t desc_n, attr.wq_umem_id = eqp->umem_obj->umem_id; attr.wq_umem_offset = 0; attr.dbr_umem_id = eqp->umem_obj->umem_id; - attr.dbr_address = (1 << log_desc_n) * MLX5_WSEG_SIZE; attr.ts_format = mlx5_ts_format_conv(priv->qp_ts_format); + attr.dbr_address = RTE_BIT64(log_desc_n) * MLX5_WSEG_SIZE; eqp->sw_qp = mlx5_devx_cmd_create_qp(priv->ctx, &attr); if (!eqp->sw_qp) { DRV_LOG(ERR, "Failed to create SW QP(%u).", rte_errno); -- 2.25.1