Skip to content

Commit d680063

Browse files
hreineckekeithbusch
authored andcommitted
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: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202310120733.TlPOVeJm-lkp@intel.com/ Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 70525e5 commit d680063

7 files changed

Lines changed: 19 additions & 20 deletions

File tree

drivers/nvme/common/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@ config NVME_COMMON
66
config NVME_KEYRING
77
bool
88
select KEYS
9+
10+
config NVME_AUTH
11+
bool
12+
select CRYPTO
13+
select CRYPTO_HMAC
14+
select CRYPTO_SHA256
15+
select CRYPTO_SHA512
16+
select CRYPTO_DH
17+
select CRYPTO_DH_RFC7919_GROUPS

drivers/nvme/host/Kconfig

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,11 @@ config NVME_TCP_TLS
107107

108108
If unsure, say N.
109109

110-
config NVME_AUTH
110+
config NVME_HOST_AUTH
111111
bool "NVM Express over Fabrics In-Band Authentication"
112112
depends on NVME_CORE
113113
select NVME_COMMON
114-
select CRYPTO
115-
select CRYPTO_HMAC
116-
select CRYPTO_SHA256
117-
select CRYPTO_SHA512
118-
select CRYPTO_DH
119-
select CRYPTO_DH_RFC7919_GROUPS
114+
select NVME_AUTH
120115
help
121116
This provides support for NVMe over Fabrics In-Band Authentication.
122117

drivers/nvme/host/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ nvme-core-$(CONFIG_NVME_MULTIPATH) += multipath.o
1717
nvme-core-$(CONFIG_BLK_DEV_ZONED) += zns.o
1818
nvme-core-$(CONFIG_FAULT_INJECTION_DEBUG_FS) += fault_inject.o
1919
nvme-core-$(CONFIG_NVME_HWMON) += hwmon.o
20-
nvme-core-$(CONFIG_NVME_AUTH) += auth.o
20+
nvme-core-$(CONFIG_NVME_HOST_AUTH) += auth.o
2121

2222
nvme-y += pci.o
2323

drivers/nvme/host/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void nvme_complete_rq(struct request *req)
421421
nvme_failover_req(req);
422422
return;
423423
case AUTHENTICATE:
424-
#ifdef CONFIG_NVME_AUTH
424+
#ifdef CONFIG_NVME_HOST_AUTH
425425
queue_work(nvme_wq, &ctrl->dhchap_auth_work);
426426
nvme_retry_req(req);
427427
#else

drivers/nvme/host/nvme.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ struct nvme_ctrl {
349349
struct work_struct ana_work;
350350
#endif
351351

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

1052-
#ifdef CONFIG_NVME_AUTH
1052+
#ifdef CONFIG_NVME_HOST_AUTH
10531053
int __init nvme_init_auth(void);
10541054
void __exit nvme_exit_auth(void);
10551055
int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl);

drivers/nvme/host/sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static ssize_t dctype_show(struct device *dev,
409409
}
410410
static DEVICE_ATTR_RO(dctype);
411411

412-
#ifdef CONFIG_NVME_AUTH
412+
#ifdef CONFIG_NVME_HOST_AUTH
413413
static ssize_t nvme_ctrl_dhchap_secret_show(struct device *dev,
414414
struct device_attribute *attr, char *buf)
415415
{
@@ -563,7 +563,7 @@ static struct attribute *nvme_dev_attrs[] = {
563563
&dev_attr_kato.attr,
564564
&dev_attr_cntrltype.attr,
565565
&dev_attr_dctype.attr,
566-
#ifdef CONFIG_NVME_AUTH
566+
#ifdef CONFIG_NVME_HOST_AUTH
567567
&dev_attr_dhchap_secret.attr,
568568
&dev_attr_dhchap_ctrl_secret.attr,
569569
#endif
@@ -593,7 +593,7 @@ static umode_t nvme_dev_attrs_are_visible(struct kobject *kobj,
593593
return 0;
594594
if (a == &dev_attr_fast_io_fail_tmo.attr && !ctrl->opts)
595595
return 0;
596-
#ifdef CONFIG_NVME_AUTH
596+
#ifdef CONFIG_NVME_HOST_AUTH
597597
if (a == &dev_attr_dhchap_secret.attr && !ctrl->opts)
598598
return 0;
599599
if (a == &dev_attr_dhchap_ctrl_secret.attr && !ctrl->opts)

drivers/nvme/target/Kconfig

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,7 @@ config NVME_TARGET_AUTH
103103
bool "NVMe over Fabrics In-band Authentication support"
104104
depends on NVME_TARGET
105105
select NVME_COMMON
106-
select CRYPTO
107-
select CRYPTO_HMAC
108-
select CRYPTO_SHA256
109-
select CRYPTO_SHA512
110-
select CRYPTO_DH
111-
select CRYPTO_DH_RFC7919_GROUPS
106+
select NVME_AUTH
112107
help
113108
This enables support for NVMe over Fabrics In-band Authentication
114109

0 commit comments

Comments
 (0)