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 A1F2EA0547; Sun, 17 Oct 2021 11:42:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DBB24113C; Sun, 17 Oct 2021 11:42:18 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2066.outbound.protection.outlook.com [40.107.100.66]) by mails.dpdk.org (Postfix) with ESMTP id 5E4D34111E; Sun, 17 Oct 2021 11:42:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fIXVGX29FWb5G32zMLec1K4H3A3nnaH+094sEUTnp5y6q7C/b2hNRit0FnA5cVGlHj9QYkfMr+L5/MMe6DGYVS9GCfY/AIS6V7/7MaL2hYIVHa4PDr170tffopmW5IHp/ii34OeYMd1m33+bEfCng2NC34jmh2sUN7Q5OxM9/EjhzSYADdDe9hXFdRFUj9MWsiXH4qjm3i7DlgxmbTfOkEDxGtNzRWhlUTtdVp3Pf0pq4nkcteJ5mUiE5vpIuN4k7X5HqLDbqhu1sZxkDKqf6wxBsYUjadbL2vkHPzGlI5kvubcJd/4Sq3NlvOaHZQqP7u2BxNVwPOejlsInQDiXAQ== 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=VKgfzAWtB0jbzv6cSI6JtS0/qJrTANTi86ktRAI8qjBxZlqosvSrnvYdSaRYiDAV+PamYMvs2JhTQAeiq47NLp8pZSryLePETnYiXFXF3nVGCzHQziE8mY0Fi+E6avhI9sI7D75uVVIniZ+NINiqR46WSDZ0g5Z/1Z2zPUuiapmRayt+D0P0auH85zxqCGT01l2Us6MkUuHzLy6caZ+JRdV8o0pghmCuUe6270XCF+cpaz1AOBseZFCFnWucZ/QuC1YhOvTQao4oYtZyoIwLX1Yi+H3J4/FujM9Wwz94LnQWdRFIgtSaai5ylZb2y6IdQFYyboY3n8c5PUu1Qp8tew== 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=sGN3G29iEx/1eXTohh8Dj2+dwtJsdbU2pBsyrkCEKvRF6sKobVQEzts+U9SZLQ3kN5FBroi1jsbt5LktgACgvCaKkkDxbYEI360qfnyLjPCf4OhKtKYmaYpaPKCVs1gtzTZKXRJM7DEIclnEHIEqbDDr9M3Sdqu02UYLVYEoSFmGIt3bQk6d4TR49cO1J8ZTkbJfX1TjafQyTr47rK9RaWHGDJ2ytOdeUNnP8f4rWjm8jYyPpe4GxXJmSJC7OBUVnfOiyldGQ83ZSiHv0KxXVmb1kUoeQcu7pZSQGxfqIg5Al/J6IBttK5P5xq5V4Zbk0W+KUaukBCwP/e6TxznwVA== Received: from BN9PR03CA0416.namprd03.prod.outlook.com (2603:10b6:408:111::31) by DM6PR12MB2843.namprd12.prod.outlook.com (2603:10b6:5:48::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Sun, 17 Oct 2021 09:42:14 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:111:cafe::b2) by BN9PR03CA0416.outlook.office365.com (2603:10b6:408:111::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16 via Frontend Transport; Sun, 17 Oct 2021 09:42:14 +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 BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Sun, 17 Oct 2021 09:42:13 +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; Sun, 17 Oct 2021 09:42:10 +0000 From: Tal Shnaiderman To: CC: , , , , , , , , Date: Sun, 17 Oct 2021 12:41:30 +0300 Message-ID: <20211017094133.18988-5-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20211017094133.18988-1-talshn@nvidia.com> References: <20211017094133.18988-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: 214cc9b5-62d9-4c2f-5e39-08d991526651 X-MS-TrafficTypeDiagnostic: DM6PR12MB2843: 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: AoUr1z8IbRD7nclZS2uqoYKVRcNsurVVNvY4XepJiZt3amgFI1CAkRWYgUtetKU1kfkBpgzMb59UYWztQrRQr7Q8jehrRjv4oVw4nV51iff0ASgOIN6gFupCuRIC+B35a1+KCp3bWzuRa4C8snVs+uQLUfafzlmfDp4axN0QYVVPowlI8dSdYvvViXjm7Vxfp7dGjBQspoG6n2ozn61kACuYha1duFIjy7yeuBNr+K1eVlgJoBfu5HYcaWSosmzPBHm1YC527hQS9ejV8tleH11iCqfr8A0yn0wXgP1aOG/KNc/Fj49Wknn/o1iHCb/39qmUVeDArqIhgh3+fbZamuunnvju65NwujZsWAfyYTUKYb183GvinBg79Dd16OgLtT+bP6RSY0jGPlxRmnAil4O+4lEproHHaYsdrJdrJEZAhD75xClXsxASrASb+gRePC472w/qLKV5mrFGCS6DD42X6yMwAsdLHNxWvyGkijuVKyYTpQznPcBYE+TfZ9N4pFsSivWKZIAoo0j9BPFAWByhRQq53xn2TNBp4RJ3kLdORt1mPDteEISgCvdj6t+jm6U9D7RJ1xYZtgDpPWiDNMGr/T7Sjw7XgUba6mT59cd5XeWQNf8tuhuA5aDbOKjn1IlV5LB63TAjT6It/8adfwIqkyfUsaA9VLODziFzCk00YhyeIkUZaSgYFlTIRg2tNIjxUxYpPtSi8jX6WN0Rdg== 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)(356005)(70586007)(7636003)(7696005)(55016002)(82310400003)(6286002)(86362001)(36906005)(36860700001)(70206006)(316002)(8936002)(426003)(336012)(6916009)(5660300002)(2906002)(2616005)(83380400001)(8676002)(508600001)(36756003)(54906003)(1076003)(6666004)(4326008)(16526019)(186003)(26005)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2021 09:42:13.6551 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 214cc9b5-62d9-4c2f-5e39-08d991526651 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: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2843 Subject: [dpdk-dev] [PATCH v2 4/6] 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