Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3202676rwb; Mon, 16 Jan 2023 05:12:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXsVQGAuvIbct8JtdYmhdQ5jn1dNld7hdhUmo9S0rTbb4MDGB0OJOqPgQfCfXnNDLN7p/1Fy X-Received: by 2002:aa7:c948:0:b0:48e:9afd:de66 with SMTP id h8-20020aa7c948000000b0048e9afdde66mr43572777edt.34.1673874766113; Mon, 16 Jan 2023 05:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673874766; cv=none; d=google.com; s=arc-20160816; b=FEDV9hyPRzDNMYQwyJszs1IcywpqD/AkpUxD0h+F1DpeQhJqCwajv9QONTgivMXIMc w0P9AvNFh5xSgyBbhbmeflJqAkQ+JSIcrOuu8slavDaSH8d4o/qMAkN0U66+7Y09hBb5 up+1NCJSf4uy26HiYrnPg29tTWO1AtwWdhnpIp66paWayPzlbLwZsLcoeJi4ov5SVtd3 DQ/eyVCJLsaOU7gxmoh4qeNcaF0jhy2F6pSZ/YC2M0Ib9Xo/1/pwHCEUZ77jq3yNn4k4 8T8NOlN06EZGSn/VLFdCU9NeFP1Pc3w3GuATI66RNRcds0jnPSnn3H0cnLMur0NiZc64 HWhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GHboVp4/n8dg/1mTqeVNMq07d7i55rvCp5cMprWstb8=; b=09MaEvV9MULMrTYHrUcvfpPOeBe9lq19gE4kv6ntUfbC85BuKnsCp+o65mCytcrDxR fRwR43wFGq4xI8qRqCcTwFkgPj3X1ejbM7Y3bCKmvTbKhvZZ7HOqJ6b+8HgTWidP8Od6 mx2dNl2dDgX2M/3bDIPuelLr9nCAnqrtgsFFKasdw9KPY/tdPW9a3GvQ9XyxkhdgSKha eYRHMnYQGBKPhy/tOyc2bI9a+tzCoCednrWQRSEwo7xy58JbEsWh3a0JcA/SiFMBsf40 FNCvdWaRg0T3mp2H31Iw4D5m+FgLAYMUpAYsOxDKGqlkBYUW+GiTww3csTGmplmIGItN xK3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OPeQnGdM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v2-20020a056402348200b0049e29ce0a51si560279edc.17.2023.01.16.05.12.33; Mon, 16 Jan 2023 05:12:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OPeQnGdM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231518AbjAPNHg (ORCPT + 51 others); Mon, 16 Jan 2023 08:07:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231420AbjAPNHB (ORCPT ); Mon, 16 Jan 2023 08:07:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAA661710; Mon, 16 Jan 2023 05:07:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 645F660F9B; Mon, 16 Jan 2023 13:07:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA0DFC433F1; Mon, 16 Jan 2023 13:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673874419; bh=Z9+KomyeN4vAjModCpaAbKOjkyqP4m8dRccCmgRLn8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OPeQnGdMKL0qvPIWYWzLqm//vIJ6xVrQ+zSrw9NRNMJnbSzuJa9VEEYupUejVnt06 HRNhIbjJVVOzzBSXSeoUjnDrYIDLqtF3CjSOmEgHFu37MIVWOwUbq/DFyGfdnJ++Yg BvhvBUhhKztQYlOb92vy7VS8Uiq44148kyxwVg4auh30C5QonsBIXdBs6dnWQlVAaH p/08idib6ImCyqQwz1xJ8CyMsMgn2pwOnLcSRdNel6waQkTHTGQTYUJsOWFJsf4Ywz ++JUX3bjsvRlVxxLqSrPNBs7farZKtwyKf2xjpumDEoLbmQvbxXcM2CM0TkhY3sduc 8JxubTZg4TsUw== From: Leon Romanovsky To: Jason Gunthorpe Cc: Israel Rukshin , Bryan Tan , Christoph Hellwig , Eric Dumazet , Jakub Kicinski , Jens Axboe , Keith Busch , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Max Gurtovoy , netdev@vger.kernel.org, Paolo Abeni , Saeed Mahameed , Sagi Grimberg , Selvin Xavier , Steven Rostedt , Vishnu Dasa , Yishai Hadas Subject: [PATCH rdma-next 12/13] nvme: Add crypto profile at nvme controller Date: Mon, 16 Jan 2023 15:05:59 +0200 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Israel Rukshin The crypto profile will be filled by the transport drivers. This is a preparation patch for adding support of inline encryption at nvme-rdma driver. Signed-off-by: Israel Rukshin Signed-off-by: Leon Romanovsky --- drivers/nvme/host/core.c | 3 +++ drivers/nvme/host/nvme.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 51a9880db6ce..f09e4e0216b3 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1928,6 +1928,9 @@ static void nvme_update_disk_info(struct gendisk *disk, capacity = 0; } + if (ctrl->crypto_enable) + blk_crypto_register(&ctrl->crypto_profile, disk->queue); + set_capacity_and_notify(disk, capacity); nvme_config_discard(disk, ns); diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 424c8a467a0c..591380f53744 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -374,6 +375,9 @@ struct nvme_ctrl { enum nvme_ctrl_type cntrltype; enum nvme_dctype dctype; + + bool crypto_enable; + struct blk_crypto_profile crypto_profile; }; enum nvme_iopolicy { -- 2.39.0