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 EE0DAA0A02; Tue, 4 May 2021 19:57:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF44041101; Tue, 4 May 2021 19:57:30 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2089.outbound.protection.outlook.com [40.107.243.89]) by mails.dpdk.org (Postfix) with ESMTP id 2F8CD410FF for ; Tue, 4 May 2021 19:57:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZPrsKDRLL9BBqbHPJgynJkE8KY9t+jLCQn0uGD6lFV+d5KTkv9T8/x1DPJku38dCzTOUlCtJuUS9HHf5jPdX+yW/hebThxSWBDr0UyHjQJhYGBQcSOdDidJ0omz+3gAl6dhHoMZYbWuAcFfOK64LEfwvxntuQxxIoOp+pt3Jqm6yg8OIanKEKbF8kQ71/M50KOisIUm2cKcn1/KiW0IgbxTpWpTEjs7o3oDQ8BlvKQyX1KnkmBw11f1IyONBl/DDfYNI8y+1aAOrfdcr9Q0IHUD6Mq8V55s+bUu9GlxJXJkv5EZii8IOOCxXbMvjh9+Io6txnpZYDWwrMfMzf4Wy5g== 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=rp6vOSaAuzukWT2OIVUyLyZCxGX1gmWEL71A566xJz4=; b=LLDxtUbCrs66xUIaoW86xmQ3L4RLw4N6zHjcpYm/kwifkgsgguC5HhVEJNooaWJhLkyk6e9uS3EqzBIT+bavJ3en1mpiIAmQUmLFCjgADldagWlHpitu/25qHkv1Q/WET9HnXol6+YU0bnDZLuoGumeZj/aiMK0e59jVd6iqgKXueVmSV0cC5IfnnoACNoHb+gpVBbB/UzaL4M/ZjHQPI8uAmcz9opgns69LJLZi4QIAtsXJptnhTqUNFPtbACDgBf7tXv+fiKMjidZNR1pnc0LKJqte1DK0kRfqkN5OxPimxQlKGn6q9uvJpYdj2bURBcVHUYCNzJDuts31veGY5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net 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=rp6vOSaAuzukWT2OIVUyLyZCxGX1gmWEL71A566xJz4=; b=I3BWBkmB6IgbVemj+nWE08LhMJrWDDA60ueZXkSv3QHnyqYtcZcS1mgZYG8G8aigyQdn7iTYvGyTreVNIFwdBhe3r5ewTmkr974JYJ2AEbO/qw3gQIhb0Ms46YpBfOCeZKzO6JFTSDNwHWXLWMa6Vh24czKcZHKnufzeSt/bV8Hoo/HWRHA6hHbDFyCR1/f858VaOTgBoIhNBoef0XZjmE6b6twMekLhYeqUgP77yxmF6IZoZQgbp6M/SI6CUDacQU8u7GfDO5/sOFI41saVDoOJIeDoq5E46zezOiWsHtqQB+cL/DdjxSO9o6ZZa++lbM+BWkCTa7A+uIs3+0Mecg== Received: from DM5PR18CA0068.namprd18.prod.outlook.com (2603:10b6:3:22::30) by DM6PR12MB2924.namprd12.prod.outlook.com (2603:10b6:5:183::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.35; Tue, 4 May 2021 17:57:27 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:3:22:cafe::a6) by DM5PR18CA0068.outlook.office365.com (2603:10b6:3:22::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 4 May 2021 17:57:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; 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 DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4087.27 via Frontend Transport; Tue, 4 May 2021 17:57:27 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 4 May 2021 17:57:25 +0000 From: Matan Azrad To: CC: , , , "Thomas Monjalon" Date: Tue, 4 May 2021 20:55:00 +0300 Message-ID: <20210504175500.3385811-16-matan@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210504175500.3385811-1-matan@nvidia.com> References: <20210429154335.2820028-1-matan@nvidia.com> <20210504175500.3385811-1-matan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.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: e7d80591-2c59-4193-4d4a-08d90f261444 X-MS-TrafficTypeDiagnostic: DM6PR12MB2924: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7JDbybyGQjfA0x5UEF2lblK/iNlgv8+scswGeLpI8R+G03utc1W3Hq8xmDknj0Bnu9IJLnGattTCzLxLK0JJGNqWwBF0R+P4kkUW4vsY6qOpFmhJgOOHMZd6P5gJGb8WVV0DCGWDLdHb5EZiozGuGKqwaW/L+pJ1hRmj8sVtaVoHAcFxziR2CCCMeqsuz3+eWd2fMdoCsI14o5r8BLezBFDekBwwEPytqGUiit5AcrR4nM6RKW8elQY3JhTIMXhvERplGLHv2co66zyNPOhDto6QCwdPSGFAK+q42edt7gNNYC/StB2Xm/LVl77N0HNilXXfImdeR/XCgFeTQhpUgEHTumNKomsbxUHCOOXpbwaFkJUSnsoLztVDLltwrYCgTmI6vZVpshP8e9e2tqKtVNiZxPsT1c2RwoZT7XZYPXg/VhQHnR3CMp8/KahdXE2zAr0h0lCaDuIpLKabZo5ksQg80IikUmaTDsnZZeb20hGxehVSzScomQKjpEwM4hXZG9a93gli6GO/g2hWG//ur2f8r5AGPMIzslyiOa0nM/ShM1QL/dBe+/vQDR5HprQZ3zIz7tn0PRYA5hMd/QZk5orfGjcR18VMXwnkcYzMfWexl3mgkrEJgkySo0vxYI4aF9w+v2/+UGuvIltVwReHafOIvMXLoKnlzjEZx4+lz7k= 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)(346002)(39860400002)(396003)(376002)(46966006)(36840700001)(7696005)(186003)(16526019)(47076005)(82740400003)(356005)(82310400003)(36756003)(2616005)(6286002)(1076003)(5660300002)(36860700001)(7636003)(26005)(316002)(54906003)(86362001)(6916009)(336012)(6666004)(426003)(478600001)(36906005)(2906002)(55016002)(83380400001)(70586007)(8676002)(4326008)(70206006)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 17:57:27.1760 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7d80591-2c59-4193-4d4a-08d90f261444 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: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2924 Subject: [dpdk-dev] [PATCH v3 15/15] common/mlx5: add UMR and RDMA write WQE defines 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" From: Suanming Mou This patch adds the struct defining UMR and RDMA write WQEs. Signed-off-by: Suanming Mou Signed-off-by: Matan Azrad --- drivers/common/mlx5/mlx5_prm.h | 187 +++++++++++++++++++++------------ 1 file changed, 121 insertions(+), 66 deletions(-) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index c2cd2d9f70..1ffee5fd56 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -412,6 +412,127 @@ struct mlx5_cqe_ts { uint8_t op_own; }; +struct mlx5_wqe_rseg { + uint64_t raddr; + uint32_t rkey; + uint32_t reserved; +} __rte_packed; + +#define MLX5_UMRC_IF_OFFSET 31u +#define MLX5_UMRC_KO_OFFSET 16u +#define MLX5_UMRC_TO_BS_OFFSET 0u + +struct mlx5_wqe_umr_cseg { + uint32_t if_cf_toe_cq_res; + uint32_t ko_to_bs; + uint64_t mkey_mask; + uint32_t rsvd1[8]; +} __rte_packed; + +struct mlx5_wqe_mkey_cseg { + uint32_t fr_res_af_sf; + uint32_t qpn_mkey; + uint32_t reserved2; + uint32_t flags_pd; + uint64_t start_addr; + uint64_t len; + uint32_t bsf_octword_size; + uint32_t reserved3[4]; + uint32_t translations_octword_size; + uint32_t res4_lps; + uint32_t reserved; +} __rte_packed; + +enum { + MLX5_BSF_SIZE_16B = 0x0, + MLX5_BSF_SIZE_32B = 0x1, + MLX5_BSF_SIZE_64B = 0x2, + MLX5_BSF_SIZE_128B = 0x3, +}; + +enum { + MLX5_BSF_P_TYPE_SIGNATURE = 0x0, + MLX5_BSF_P_TYPE_CRYPTO = 0x1, +}; + +enum { + MLX5_ENCRYPTION_ORDER_ENCRYPTED_WIRE_SIGNATURE = 0x0, + MLX5_ENCRYPTION_ORDER_ENCRYPTED_MEMORY_SIGNATURE = 0x1, + MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_WIRE = 0x2, + MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_MEMORY = 0x3, +}; + +enum { + MLX5_ENCRYPTION_STANDARD_AES_XTS = 0x0, +}; + +enum { + MLX5_BLOCK_SIZE_512B = 0x1, + MLX5_BLOCK_SIZE_520B = 0x2, + MLX5_BLOCK_SIZE_4096B = 0x3, + MLX5_BLOCK_SIZE_4160B = 0x4, + MLX5_BLOCK_SIZE_1MB = 0x5, + MLX5_BLOCK_SIZE_4048B = 0x6, +}; + +#define MLX5_BSF_SIZE_OFFSET 30 +#define MLX5_BSF_P_TYPE_OFFSET 24 +#define MLX5_ENCRYPTION_ORDER_OFFSET 16 +#define MLX5_BLOCK_SIZE_OFFSET 24 + +struct mlx5_wqe_umr_bsf_seg { + /* + * bs_bpt_eo_es contains: + * bs bsf_size 2 bits at MLX5_BSF_SIZE_OFFSET + * bpt bsf_p_type 2 bits at MLX5_BSF_P_TYPE_OFFSET + * eo encryption_order 4 bits at MLX5_ENCRYPTION_ORDER_OFFSET + * es encryption_standard 4 bits at offset 0 + */ + uint32_t bs_bpt_eo_es; + uint32_t raw_data_size; + /* + * bsp_res contains: + * bsp crypto_block_size_pointer 8 bits at MLX5_BLOCK_SIZE_OFFSET + * res reserved 24 bits + */ + uint32_t bsp_res; + uint32_t reserved0; + uint8_t xts_initial_tweak[16]; + /* + * res_dp contains: + * res reserved 8 bits + * dp dek_pointer 24 bits at offset 0 + */ + uint32_t res_dp; + uint32_t reserved1; + uint64_t keytag; + uint32_t reserved2[4]; +} __rte_packed; + +#ifdef PEDANTIC +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +struct mlx5_umr_wqe { + struct mlx5_wqe_cseg ctr; + struct mlx5_wqe_umr_cseg ucseg; + struct mlx5_wqe_mkey_cseg mkc; + union { + struct mlx5_wqe_dseg kseg[0]; + struct mlx5_wqe_umr_bsf_seg bsf[0]; + }; +} __rte_packed; + +struct mlx5_rdma_write_wqe { + struct mlx5_wqe_cseg ctr; + struct mlx5_wqe_rseg rseg; + struct mlx5_wqe_dseg dseg[0]; +} __rte_packed; + +#ifdef PEDANTIC +#pragma GCC diagnostic error "-Wpedantic" +#endif + /* GGA */ /* MMO metadata segment */ @@ -1096,72 +1217,6 @@ struct mlx5_ifc_create_mkey_in_bits { u8 klm_pas_mtt[][0x20]; }; -enum { - MLX5_BSF_SIZE_16B = 0x0, - MLX5_BSF_SIZE_32B = 0x1, - MLX5_BSF_SIZE_64B = 0x2, - MLX5_BSF_SIZE_128B = 0x3, -}; - -enum { - MLX5_BSF_P_TYPE_SIGNATURE = 0x0, - MLX5_BSF_P_TYPE_CRYPTO = 0x1, -}; - -enum { - MLX5_ENCRYPTION_ORDER_ENCRYPTED_WIRE_SIGNATURE = 0x0, - MLX5_ENCRYPTION_ORDER_ENCRYPTED_MEMORY_SIGNATURE = 0x1, - MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_WIRE = 0x2, - MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_MEMORY = 0x3, -}; - -enum { - MLX5_ENCRYPTION_STANDARD_AES_XTS = 0x0, -}; - -enum { - MLX5_BLOCK_SIZE_512B = 0x1, - MLX5_BLOCK_SIZE_520B = 0x2, - MLX5_BLOCK_SIZE_4096B = 0x3, - MLX5_BLOCK_SIZE_4160B = 0x4, - MLX5_BLOCK_SIZE_1MB = 0x5, - MLX5_BLOCK_SIZE_4048B = 0x6, -}; - -#define MLX5_BSF_SIZE_OFFSET 30 -#define MLX5_BSF_P_TYPE_OFFSET 24 -#define MLX5_ENCRYPTION_ORDER_OFFSET 16 -#define MLX5_BLOCK_SIZE_OFFSET 24 - -struct mlx5_wqe_umr_bsf_seg { - /* - * bs_bpt_eo_es contains: - * bs bsf_size 2 bits at MLX5_BSF_SIZE_OFFSET - * bpt bsf_p_type 2 bits at MLX5_BSF_P_TYPE_OFFSET - * eo encryption_order 4 bits at MLX5_ENCRYPTION_ORDER_OFFSET - * es encryption_standard 4 bits at offset 0 - */ - uint32_t bs_bpt_eo_es; - uint32_t raw_data_size; - /* - * bsp_res contains: - * bsp crypto_block_size_pointer 8 bits at MLX5_BLOCK_SIZE_OFFSET - * res reserved 24 bits - */ - uint32_t bsp_res; - uint32_t reserved0; - uint8_t xts_initial_tweak[16]; - /* - * res_dp contains: - * res reserved 8 bits - * dp dek_pointer 24 bits at offset 0 - */ - uint32_t res_dp; - uint32_t reserved1; - uint64_t keytag; - uint32_t reserved2[4]; -} __rte_packed; - enum { MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE = 0x0 << 1, MLX5_GET_HCA_CAP_OP_MOD_ETHERNET_OFFLOAD_CAPS = 0x1 << 1, -- 2.25.1