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 A5FAEA0A02; Tue, 4 May 2021 19:56:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 891B34067E; Tue, 4 May 2021 19:56:19 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2061.outbound.protection.outlook.com [40.107.236.61]) by mails.dpdk.org (Postfix) with ESMTP id 8ED4B4014E for ; Tue, 4 May 2021 19:56:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AENvXORPwSjG7SGYRP5CvAnypH5lQuFuNX2EvcoesD7IQ9Qb8Q3NiPN11PqvfgzMRk344kZsBYs6qg5O2fQwXYNFk0oHZ3BHOzGCi1/HZ+vtO5/kUIsrHAfn087uEcGIpf4phzDKdTFXQReuBzQIkxqjUGMdwm+7bCaFUpV6bWbkK2WDKDtf/0i5zGZusaeM6vK1p8Kcg617SqnUc1wiZLZMy1LBGyJnHFvTr/W1q1XlSubvAa7zaweFjGxkeDbTdQ6kwmDxnspuHfA25xi08uqIJMnLaD5ItJ218dAR7e5faXzD9vh2ZeyIRep04u3tJ9twl6eCZN+r+Apag7GEyw== 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=jltACnE23OSkVE6J/+RMwkM4GFekAT5g2pFmvcyLNDk=; b=LxC3+oWvmTepzuhzG8e8ln6JbydE9XftA7ErEyStyVbmxQC1bY1kr2TbiaGzaPzY9mty2sloseweHgTYqkT6CcEXtNLkIwXu1VDmfCWrPRkajt+Kxny97LAbpPN9uhBOA5X0mY/UINm4jjXj+FZ4bgjbBjngA9rDEQn4LbqOV74TOdXOVx9GnRS6d64LNTCqGfevqnNvt8+6nlCXs3qEEmWopKUFPD5MAD9RB9JDCaPxMAB1Y8aOt8EPFirt8fZLJ9MKkbBfaYh2ZzmW/eR9lRuqZN1bYvO4bta04L9r7oQwmTdvqka34r2Nos1Ggzy8UX1s6UScgIMszyudmgp7TQ== 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=jltACnE23OSkVE6J/+RMwkM4GFekAT5g2pFmvcyLNDk=; b=bG6BXycL/jWrjHPoj50IJU1dZMu4sTgQKQ1bneJVdNdXKArnJjj2Bsj9VuG7JiMi2ULb7bFqeVHsE7Ylyo5z1oy1Ga+y9/5i8CQsZViyU67BwmHX/02iNbBYi3Veh2mGhkwJ0fpcoSMmsZu1uAZMa9ZxDo7M1Q/lYQp0mtMbeHs+FS+0e6kS9dqmbSS07kX6gxAqeTo7Qr7OS2qPfC9oNF3IFf7sXCfL36YLKPwNUPkb7Qx3Qe3PtONme4iqjxBE7CqGGHPzJqdK0qjIUd0M09FJDWc4eGIh90uyZhwZL3zPpt7Rj2n7yxdlN/CXqxBW9tA3+9yqFWILHjD+fv3JJQ== Received: from DS7PR03CA0194.namprd03.prod.outlook.com (2603:10b6:5:3b6::19) by MWHPR1201MB0093.namprd12.prod.outlook.com (2603:10b6:301:54::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.26; Tue, 4 May 2021 17:56:17 +0000 Received: from DM6NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b6:cafe::aa) by DS7PR03CA0194.outlook.office365.com (2603:10b6:5:3b6::19) 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:56:17 +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 DM6NAM11FT065.mail.protection.outlook.com (10.13.172.109) 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:17 +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:15 +0000 From: Matan Azrad To: CC: , , , "Thomas Monjalon" , Dekel Peled Date: Tue, 4 May 2021 20:54:51 +0300 Message-ID: <20210504175500.3385811-7-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: 550acdd8-cb44-4d47-9f78-08d90f25ea81 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0093: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tPCNdUCPFsUpzeG8g3Y1dH5XSPvPMPMVbqCd9hyAtf546Ui0nlq5VI/HOkDtcMGo/qOw5MY3eoUWJU61FhdW3ZkGDTZ7MWx+Rbfxv6/26XPKIzD1NagmKS34247meQzRkULK2D2fAOJnV9OqRDvVwBmwmjYq6DPpYqpchcAz/cGXzpMlHYnO4VzLU/zlujvgEP53o4tHRSrnkcA+5M3Uzi0BzCvyXHLyI6axNLODYQzWwS9XyWHLC3UTQNR5LXFUO51U36wOBo4WDVuubU+2eKgfNbYC5C2QCg9iBKx4joNCjhfajJX0jkCah9EQ93uUt5EPzApnnP5UA5DjLryvzygyWpiZpgC9uIJ8B7YtPW9LzMxNVwWMbX1DSFWbPgt1Ah8PXDte7Y+yUENkVsMaU81KDiI6j9ntdhd/z2hFd0ffwkmG1eu/3mRxIWYY0kcegn8S7k/fOl39wOt0DhQzz9RE7zXTPx4LzmVxUKepIr9JUgiB3j8kW6rHIJADpyO7cFOrUSnO8K8u96YD1LO5+IvNsqdYm5qpP6+57FjAv4fT/fOooL4qePYfrznhvQLbQywL48x1+Dk+r+jcndiLIq0VrtTYvp6E0pFsUiaDw4+G1tC58SmRcRBQEjpU/1r25vSiNbSzKIaN4BVigDZ97QYYjgmHQQp4su4BcoTp6Vc= 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)(39850400004)(396003)(346002)(376002)(136003)(46966006)(36840700001)(55016002)(83380400001)(426003)(356005)(6286002)(478600001)(6916009)(107886003)(336012)(36906005)(316002)(54906003)(2616005)(26005)(16526019)(4326008)(186003)(2906002)(86362001)(82740400003)(6666004)(7696005)(5660300002)(8676002)(70586007)(36756003)(47076005)(82310400003)(36860700001)(1076003)(8936002)(7636003)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2021 17:56:17.1046 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 550acdd8-cb44-4d47-9f78-08d90f25ea81 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: DM6NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0093 Subject: [dpdk-dev] [PATCH v3 06/15] common/mlx5: adjust DevX MKEY fields for crypto 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 MKEY that will be used for crypto purposes must be created with crypto_en and remote access attributes. This patch adds support for them in the DevX MKEY context. Signed-off-by: Dekel Peled Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_devx_cmds.c | 9 +++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/mlx5_prm.h | 10 +++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 742c82cca4..7e3c8b55fa 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -263,6 +263,10 @@ mlx5_devx_cmd_mkey_create(void *ctx, MLX5_SET(create_mkey_in, in, pg_access, attr->pg_access); MLX5_SET(mkc, mkc, lw, 0x1); MLX5_SET(mkc, mkc, lr, 0x1); + if (attr->set_remote_rw) { + MLX5_SET(mkc, mkc, rw, 0x1); + MLX5_SET(mkc, mkc, rr, 0x1); + } MLX5_SET(mkc, mkc, qpn, 0xffffff); MLX5_SET(mkc, mkc, pd, attr->pd); MLX5_SET(mkc, mkc, mkey_7_0, attr->umem_id & 0xFF); @@ -273,6 +277,11 @@ mlx5_devx_cmd_mkey_create(void *ctx, MLX5_SET(mkc, mkc, relaxed_ordering_read, attr->relaxed_ordering_read); MLX5_SET64(mkc, mkc, start_addr, attr->addr); MLX5_SET64(mkc, mkc, len, attr->size); + MLX5_SET(mkc, mkc, crypto_en, attr->crypto_en); + if (attr->crypto_en) { + MLX5_SET(mkc, mkc, bsf_en, attr->crypto_en); + MLX5_SET(mkc, mkc, bsf_octword_size, 4); + } mkey->obj = mlx5_glue->devx_obj_create(ctx, in, in_size_dw * 4, out, sizeof(out)); if (!mkey->obj) { diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index b9ff7ab87d..600577f18a 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -32,6 +32,8 @@ struct mlx5_devx_mkey_attr { uint32_t relaxed_ordering_write:1; uint32_t relaxed_ordering_read:1; uint32_t umr_en:1; + uint32_t crypto_en:2; + uint32_t set_remote_rw:1; struct mlx5_klm *klm_array; int klm_num; }; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index bc9f58ad03..25f6f8ff00 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -1059,7 +1059,15 @@ struct mlx5_ifc_mkc_bits { u8 relaxed_ordering_read[0x1]; u8 reserved_at_1da[0x1]; u8 log_page_size[0x5]; - u8 reserved_at_1e0[0x20]; + u8 reserved_at_1e0[0x3]; + u8 crypto_en[0x2]; + u8 reserved_at_1e5[0x1b]; +}; + +/* Range of values for MKEY context crypto_en field. */ +enum { + MLX5_MKEY_CRYPTO_DISABLED = 0x0, + MLX5_MKEY_CRYPTO_ENABLED = 0x1, }; struct mlx5_ifc_create_mkey_out_bits { -- 2.25.1