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 102EAA0A02; Tue, 4 May 2021 19:56:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED89F410F8; Tue, 4 May 2021 19:56:43 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2071.outbound.protection.outlook.com [40.107.93.71]) by mails.dpdk.org (Postfix) with ESMTP id 48EF3406A2 for ; Tue, 4 May 2021 19:56:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lbtPNrYV2xIJte6/WDLzxbQIblyNgBHO4Sih/gqfYJPDCfOHSFbYx7VhgZAGki0ouAr+omUQ1Q1cES3luyKuBG6BXyJuVAG1u7/Sz6PdJHRoI5W4mNSw+nkMr8S2QKUKXapQcMz1ZOXSTIV6VtVbULjGCccrVLkbtkBYiiDGMThLgqbZRhUNHiGOAsyv0KYGnsLAuR/OsbWXDGy/Al4T4qZcAwCTRMorKVYcsI+fNMLbi3HSmOxinE5D+qT/IccHj5AA0ZonmyJBwKEvlQ/KuSJpuPfbR6VvX9Ncid/1jPHOMMjL79xPjunP/lMNv16C5UOZiYdhnCxzapfG+f/mqg== 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=mPr5rMpTdg+eF6DreyYQLjm8SqOm1l6YttcLm5KoD2g=; b=cBGmV8e5cl0Dld52FwDylOhIEr78g0v3zkQPpG9vE9eMT6nABU+GgqgLAjjTd+0Hw4EWIgu3S4yL0I7hJcsmVFBh3uIh9hGCGBtMEzFfWJvn22O3q2GIdOgHY/lZqaGciGNKyaT89PNpiEmzqTa3aZ6JR0tMkKpFCrKf4o74Uw4NHqPQz6jM+CyY/xH1pgytApBGMTPtVyuJ2PpULhab3Ct7Iue7QVwoUKoDvNAls72OnuGZXbhs1KHbP3YFu4HrRyPnldtE2tavW0+UICzC0ndweJJRA9xxXUcv4aCXA98635Rbjx18hpOPA1cG0A1WepT6sAhq3i2dlRgbjBIoTg== 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=mPr5rMpTdg+eF6DreyYQLjm8SqOm1l6YttcLm5KoD2g=; b=tGnUiwqTuInLJ8DB2vNBgYmp4amCuVqf7fah9MGW0DqWdehRiqoBBUT4hDanDYRlWSAecg9vSmOgXX3fok4jJ+4Q/Bemrk7KVE7aKfhjHywGTXJwS8eJEo4fLio6s+rca33Tyk++nL35TR4XKKh5YpbZwb40QIVfQpWyRd/FBvzTmRFsZL59fhCI6eZf7jsOhCg0yUZngqSDuKT3NOcf8tbhFokkF0U97RdN5nMxmdoYVpnTtrGF8BdsV/UBFKM1uUO73Gsx8gWtQV4X2O48PHVeXdha9HF2xEgWWbaPCsbZAhrFmconyRAFb1Nzt4CJ4DdvIVbkfiF409ydMxv7FA== Received: from DM6PR18CA0010.namprd18.prod.outlook.com (2603:10b6:5:15b::23) by PH0PR12MB5420.namprd12.prod.outlook.com (2603:10b6:510:e8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.40; Tue, 4 May 2021 17:56:41 +0000 Received: from DM6NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:5:15b:cafe::e2) by DM6PR18CA0010.outlook.office365.com (2603:10b6:5:15b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Tue, 4 May 2021 17:56:41 +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 DM6NAM11FT037.mail.protection.outlook.com (10.13.172.122) 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:56:40 +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:56:38 +0000 From: Matan Azrad To: CC: , , , "Thomas Monjalon" , Dekel Peled Date: Tue, 4 May 2021 20:54:54 +0300 Message-ID: <20210504175500.3385811-10-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: fcd071f2-73e6-4009-d6ab-08d90f25f8af X-MS-TrafficTypeDiagnostic: PH0PR12MB5420: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2043; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OnqQhc9iLeJ57gtEKdry/Q7as25fbckofVJByLkvcBLhvM784S0OTi8/diddu7nrEEG9XshxTXs3RXiqNPPhA4rTon7XbouRMcXVCM9BIggIL7YJJGI+SzShJJ68I+on6NMjaIVyr9R1NfjcbSah1ZAATyQy1/P8h2vejk6X4YGeBWwFyKkHAA+0XLNoSuZOg7dc6yGuMyKIZXg3EjpvLZhhGiOtLDsQ/cGaOLNqhv0M+w1by9ABp1o/0mqOrltAciDxU1XHicZNWZAAZfkfiYjr/Gyjif3hiNJAwxz8abgI2xiNGXdj21ZxjnafTXIWU8egBYDq/rcmX8Y/xET/Gv4eMyFCO1zu1nNBVWQppc7FNvObWjUdwad4yd4fjehxaHCUDWbVbxXgYx84/ZI8DIF8iQ6z9NUy2AB7HF6vmOKaFSuEC3M+LLmywDDg7uX0evOE7jrpUDFOTOPdwmKIPVGp3c5pgFy1hCbzsTDqoECaxIVz2ocnxSfQgLBFsRxKy/rkyMPGDiEkIdXmNbo5a8+BqNAgN3tT2ZWYTQ4ZplFQgmMOXIWrW73PLWbUFV5UF8RXGJbZwI2DcyEYOZp3tyfKA9JQlx064lEsLt4WDZ7/fkEyd7nv2Bg5rFJEQZOG1wLVw9bXvmvxcrv2ZNYDK9eZ5k3tdUsKUq6o3XFFwdk= 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)(396003)(346002)(376002)(136003)(39860400002)(46966006)(36840700001)(186003)(1076003)(16526019)(6286002)(70206006)(107886003)(70586007)(36756003)(47076005)(7696005)(478600001)(55016002)(83380400001)(426003)(4326008)(8676002)(5660300002)(26005)(36860700001)(2616005)(86362001)(6666004)(36906005)(6916009)(316002)(8936002)(54906003)(2906002)(82740400003)(7636003)(356005)(82310400003)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 17:56:40.8916 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcd071f2-73e6-4009-d6ab-08d90f25f8af 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: DM6NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5420 Subject: [dpdk-dev] [PATCH v3 09/15] common/mlx5: add crypto BSF struct and 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: Dekel Peled This patch adds the struct defining crypto BSF segment of UMR WQE, and the related value definitions and offsets. Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_prm.h | 66 ++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index a2437faec0..a9dcbfa63c 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -1096,6 +1096,72 @@ 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