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 7FCC2A0C47; Tue, 12 Oct 2021 17:55:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C428C411CD; Tue, 12 Oct 2021 17:54:58 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) by mails.dpdk.org (Postfix) with ESMTP id 33AC7411CD; Tue, 12 Oct 2021 17:54:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kIvvLtPYvsuR/+wPWfcmzKIpxPKAp5Kxr2/8NIIvHzMDnwDdpHrr9Gyrh0ZKspBR0Th5mho/Bt1WI4URRPri7ryuww23ViMsvMJZhMF3W2bRzixZ8TgYg+8MYQ4rQgYjQkxzGBK4cPzvX0e8Bo0NJUU0m2u3cr3dRGkbbxzW58vDVDqrJii3XTCeuL6eph3Qd8gDf9GofBwsaCrZZMuPoA/ApC9RDoLhh2wAyRp5Qe74lFAY9uXPcVsJaIzmd5q9cPfHT8LUNH0tullpRhj1KCihBrF5d7cSZzT/CYbuKGDxzsIqIebzHX3m7r9OJuk0h5LT9CNKwATPGuVHx/xIGQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f5sdseV9FHxb9lqaC8rGm19bMvcQdzIwg584Bols4n4=; b=nPjmso7OM1lAELgk0kcWncmWnuY43NzatgfZ10qXHObSB4xZL9GpzwDABtW37DAKi22rJqSFatv1taalP9CR7i7W7Ge5nLfi1y3ALrxcl7PZQSrejDLz6IBi41zevqoFtz5S0SfErZAlVmlzAQTP6DeMwNf4D4AdPZLqUg3gqnw8m2F1j+/470GOn2XqpMdYp8mmCSEgbkYYZoaNJWf7riUYa3vgyeCMs2Bp4hTvMPyXVO3eCIeX4Y1v7RhIKk7Jp24T6kpRAl+CHo9xyytV0oA9E/0IQaN9n74BGYAAxB9gKFFS8WeCXdSMDVr60I/eHZ+F8cnsa931S2CDpYjZkw== 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=quarantine sp=quarantine 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=f5sdseV9FHxb9lqaC8rGm19bMvcQdzIwg584Bols4n4=; b=FYXhhoXD+mYTQTArYmPMdIHxJ09ydmxl7relJseiLZEHiUq0crqDg/pH7dPjgi9y0wdgkELjkucm88lCRz5sh0NV9jZpvlzPNRsXlD27EpTQsT1cD6n0H6AVmqzNxhve1w1/1hFQa8aFLs3LaJ+HdfjY/vdfR5ym5s5+bbrJOCCv/Z9I8+9sDJn50A1o1b2l6XQNRMpF+1C1L4Vo2mZot7PfCMEyZ3Pf8dCTVkZ9McvJbM3tT19tSGbeQR2/sLYHnP6936sy2FE7M6HwSKqiiAdvxrkDNBScFk54O4WsacPV1q9UCWvDX/NE/WK4H2IbQX+bkQuoy7Q0zB7FhI8qZQ== Received: from DM3PR08CA0002.namprd08.prod.outlook.com (2603:10b6:0:52::12) by SA0PR12MB4575.namprd12.prod.outlook.com (2603:10b6:806:73::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Tue, 12 Oct 2021 15:54:55 +0000 Received: from DM6NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:0:52:cafe::37) by DM3PR08CA0002.outlook.office365.com (2603:10b6:0:52::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Tue, 12 Oct 2021 15:54:55 +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 DM6NAM11FT045.mail.protection.outlook.com (10.13.173.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Tue, 12 Oct 2021 15:54:54 +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.18; Tue, 12 Oct 2021 15:54:50 +0000 From: Tal Shnaiderman To: CC: , , , , , , , , Date: Tue, 12 Oct 2021 18:53:58 +0300 Message-ID: <20211012155359.8908-5-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20211012155359.8908-1-talshn@nvidia.com> References: <20211012155359.8908-1-talshn@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92cdb321-18f9-4dd7-c58e-08d98d98a27e X-MS-TrafficTypeDiagnostic: SA0PR12MB4575: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LQsMKu3BhU70QgS7ueOUQwr3qJkomW0AJd68KkfCQnoKqm91An74kNmLbag5K9sm1L8fpIBRL7QJk4qDvZypNVA27J76pgYTCh/gE4/k9hw021gbZXr2PiZzmaqrKyfW/3mJWdbz0ZVp9aTx0LKqmssP+k4NSoZype9ukaNcJ3bHouIcCHXQ7UOBAO/AXU5OEZ7WBwm0g63w/pzGK7KxdPG6MpgQxHyInbo+WiRFU+d66EkxqIrZZ80C6o9QhZFwMQTISWdk8NWJnH9aToSRTR/bypoIb+pi0RVa/8Gr75yj/2TklIW5p6bxWK9qJJLXOXwmdASnf2+kClvUQRMzpAMdOFjqI+L3xkV3G0WQ5YnTS0mn24VfJGGjV+Ll7pDMIbKPw7bOb4BPH7tcKf0N3bj6PXbfox4Gol230GNQCBQpinyV3MJfBW0bqoH/9/58VpwZxoH1OiexU4XD7vrsLKgYrKIae2UgsP8J801L3CJW+2Yt1AxfBR3Y+LtPWLX7di7T4HP63o1tOlWeumDeiAXBvkpePQcEWQDUoJv+8tvc0Mx1mmJksni24BMdgm9J8CocV75OhK2KO8z7xEORKzZVPIbWxoXzH0rdGgFVb6N7NsnfTkCdkx9pIPBVqm70T1WBRoRRPSIbxIHqfgmQ/UXJ3082dEOo+YX9eJUxJoKznDp9QZeOVXzvSPeXwCtPj6Vo2n8fb9Pw27Xl16B9Qg== 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)(36840700001)(46966006)(316002)(7636003)(336012)(70206006)(356005)(36860700001)(508600001)(186003)(70586007)(7696005)(1076003)(2906002)(4326008)(6286002)(82310400003)(36756003)(26005)(54906003)(55016002)(83380400001)(47076005)(5660300002)(6916009)(8676002)(8936002)(86362001)(2616005)(426003)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2021 15:54:54.9339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92cdb321-18f9-4dd7-c58e-08d98d98a27e 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: DM6NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4575 Subject: [dpdk-dev] [PATCH 4/5] crypto/mlx5: fix size of UMR WQE 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 size of the UMR WQE allocated object is decided by a sizof operation on the struct, however since the struct contains a union of flexible array members this sizeof results can differ between compilers. GCC for example treats the union as 0 sized, MSVC adds a padding of 16Bits. To resolve the ambiguity the allocation size will be calculated by the sizes of the members excluding the flexible union. Fixes: a1978aa23bf4 ("crypto/mlx5: add maximum segments configuration") Cc: stable@dpdk.org Signed-off-by: Tal Shnaiderman Acked-by: Matan Azrad --- drivers/crypto/mlx5/mlx5_crypto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index 11cbc78586..7192fa661e 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -959,7 +959,9 @@ mlx5_crypto_dev_probe(struct mlx5_common_device *cdev) priv->keytag = rte_cpu_to_be_64(devarg_prms.keytag); priv->max_segs_num = devarg_prms.max_segs_num; priv->umr_wqe_size = sizeof(struct mlx5_wqe_umr_bsf_seg) + - sizeof(struct mlx5_umr_wqe) + + sizeof(struct mlx5_wqe_cseg) + + sizeof(struct mlx5_wqe_umr_cseg) + + sizeof(struct mlx5_wqe_mkey_cseg) + RTE_ALIGN(priv->max_segs_num, 4) * sizeof(struct mlx5_wqe_dseg); rdmw_wqe_size = sizeof(struct mlx5_rdma_write_wqe) + -- 2.16.1.windows.4