Commit d6800634 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Keith Busch
Browse files

nvme: rework NVME_AUTH Kconfig selection



Having a single Kconfig symbol NVME_AUTH conflates the selection
of the authentication functions from nvme/common and nvme/host,
causing kbuild robot to complain when building the nvme target
only. So introduce a Kconfig symbol NVME_HOST_AUTH for the nvme
host bits and use NVME_AUTH for the common functions only.
And move the CRYPTO selection into nvme/common to make it
easier to read.

Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310120733.TlPOVeJm-lkp@intel.com/


Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 70525e5d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -6,3 +6,12 @@ config NVME_COMMON
config NVME_KEYRING
       bool
       select KEYS

config NVME_AUTH
	bool
	select CRYPTO
	select CRYPTO_HMAC
	select CRYPTO_SHA256
	select CRYPTO_SHA512
	select CRYPTO_DH
	select CRYPTO_DH_RFC7919_GROUPS
+2 −7
Original line number Diff line number Diff line
@@ -107,16 +107,11 @@ config NVME_TCP_TLS

	  If unsure, say N.

config NVME_AUTH
config NVME_HOST_AUTH
	bool "NVM Express over Fabrics In-Band Authentication"
	depends on NVME_CORE
	select NVME_COMMON
	select CRYPTO
	select CRYPTO_HMAC
	select CRYPTO_SHA256
	select CRYPTO_SHA512
	select CRYPTO_DH
	select CRYPTO_DH_RFC7919_GROUPS
	select NVME_AUTH
	help
	  This provides support for NVMe over Fabrics In-Band Authentication.

+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ nvme-core-$(CONFIG_NVME_MULTIPATH) += multipath.o
nvme-core-$(CONFIG_BLK_DEV_ZONED)	+= zns.o
nvme-core-$(CONFIG_FAULT_INJECTION_DEBUG_FS)	+= fault_inject.o
nvme-core-$(CONFIG_NVME_HWMON)		+= hwmon.o
nvme-core-$(CONFIG_NVME_AUTH)		+= auth.o
nvme-core-$(CONFIG_NVME_HOST_AUTH)	+= auth.o

nvme-y					+= pci.o

+1 −1
Original line number Diff line number Diff line
@@ -421,7 +421,7 @@ void nvme_complete_rq(struct request *req)
		nvme_failover_req(req);
		return;
	case AUTHENTICATE:
#ifdef CONFIG_NVME_AUTH
#ifdef CONFIG_NVME_HOST_AUTH
		queue_work(nvme_wq, &ctrl->dhchap_auth_work);
		nvme_retry_req(req);
#else
+2 −2
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ struct nvme_ctrl {
	struct work_struct ana_work;
#endif

#ifdef CONFIG_NVME_AUTH
#ifdef CONFIG_NVME_HOST_AUTH
	struct work_struct dhchap_auth_work;
	struct mutex dhchap_auth_mutex;
	struct nvme_dhchap_queue_context *dhchap_ctxs;
@@ -1049,7 +1049,7 @@ static inline bool nvme_ctrl_sgl_supported(struct nvme_ctrl *ctrl)
	return ctrl->sgls & ((1 << 0) | (1 << 1));
}

#ifdef CONFIG_NVME_AUTH
#ifdef CONFIG_NVME_HOST_AUTH
int __init nvme_init_auth(void);
void __exit nvme_exit_auth(void);
int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl);
Loading