diff options
author | Hannes Reinecke <hare@suse.de> | 2021-06-02 11:56:31 +0200 |
---|---|---|
committer | Hannes Reinecke <hare@suse.de> | 2022-08-16 14:06:18 +0200 |
commit | 388423632e16b796319993010b03906f066c9ea3 (patch) | |
tree | 20fbb4a8a29b26c1e9f2f108a4e5a0ff1e3ceec3 | |
parent | 5028a4fb85423dde06b36f3a26a1e8b2dd84b504 (diff) | |
download | scsi-devel-virtual-subsys.v4.tar.gz |
nvme: enable dispersed namespace host featurevirtual-subsys.v4
Enable the dispersed namespace (HDISNS) host feature if the
per-namespace subsystem 'ns-subsys' module option is set.
Signed-off-by: Hannes Reinecke <hare@suse.de>
-rw-r--r-- | drivers/nvme/host/core.c | 7 | ||||
-rw-r--r-- | include/linux/nvme.h | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 8e74d2b131d438..66ae23e9cb0e37 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2399,7 +2399,7 @@ static int nvme_configure_timestamp(struct nvme_ctrl *ctrl) static int nvme_configure_host_options(struct nvme_ctrl *ctrl) { struct nvme_feat_host_behavior *host; - u8 acre = 0, lbafee = 0; + u8 acre = 0, lbafee = 0, hdisns = 0; int ret; /* Don't bother enabling the feature if retry delay is not reported */ @@ -2407,8 +2407,10 @@ static int nvme_configure_host_options(struct nvme_ctrl *ctrl) acre = NVME_ENABLE_ACRE; if (ctrl->ctratt & NVME_CTRL_ATTR_ELBAS) lbafee = NVME_ENABLE_LBAFEE; + if (ns_subsys) + hdisns = NVME_ENABLE_HDISNS; - if (!acre && !lbafee) + if (!acre && !lbafee && !hdisns) return 0; host = kzalloc(sizeof(*host), GFP_KERNEL); @@ -2417,6 +2419,7 @@ static int nvme_configure_host_options(struct nvme_ctrl *ctrl) host->acre = acre; host->lbafee = lbafee; + host->hdisns = hdisns; ret = nvme_set_features(ctrl, NVME_FEAT_HOST_BEHAVIOR, 0, host, sizeof(*host), NULL); kfree(host); diff --git a/include/linux/nvme.h b/include/linux/nvme.h index ae53d74f3696a8..705b5cf0c0e6c2 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -1083,12 +1083,14 @@ struct nvme_feat_host_behavior { __u8 acre; __u8 etdas; __u8 lbafee; - __u8 resv1[509]; + __u8 hdisns; + __u8 resv1[508]; }; enum { NVME_ENABLE_ACRE = 1, NVME_ENABLE_LBAFEE = 1, + NVME_ENABLE_HDISNS = 1, }; /* Admin commands */ |