mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
nvme updates for Linux 5.17
- increment request genctr on completion (Keith Busch, Geliang Tang)
- add a 'iopolicy' module parameter (Hannes Reinecke)
- print out valid arguments when reading from /dev/nvme-fabrics
(Hannes Reinecke)
-----BEGIN PGP SIGNATURE-----
iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmHMlM8LHGhjaEBsc3Qu
ZGUACgkQD55TZVIEUYN9CRAAyeQkp0Y6e88tTQGwCbYJVCnjR4zhgM7Jsv53d3Er
bYzsOHGagHia9MW1NgHUduv7sg0hTqiLHvlYQ37GBKxUPdRMHjLdUfsru8q0O89b
9318o5XpvyhlEQXq64WJtmtQRd7cIIGhLnMv07X6sUvHCrFxdThM3rZDIz0KrlB6
+FCpqaDMMPYa5HK5LhN9FrWGnyeqZeB/lraLN5DTSBfmUvZAKR6BXwlmc/YpHM/X
O36x19o2NHNuqVJSEYAiiVHtVfEaeR0rMwbxp0C9cy8cQm8QnH/UnohF+dDn4AQT
9yEAzW3DZdzZUu8mjbBj16v8HjUdXULavy7s45RKLTxuRFZwxIe5hvy67dEIYeJ7
MlJUv5McNAC+JxVsGdPiIz/fvSpCIYwV6Fl2ZJMTYcRL3HjcS6JZRBPouN5SqqZA
r+yHBqXeuyhrOIYnjf7Vr2ZkCbbyOwdIh+29btA55jjMYmHYF3bbS+mPnHSd31Fg
GJLDj4Px4pWxSMaYIBzityDg0ifiSW5kgnvrSHzmFB2cxSf2Cb+6hqKMe7L2Caqu
9HjhHg2ibrENYdT5q5kWv/NfZ5Qfxwbi0lela2itDas0silIjUjzQ1OtuNb3utG0
aHYD7CSAeQ25BEo8sJJbpg6h2xbERiwCyBjtiXwWvlwbC6N06z4dcM5WmtXZ6rIN
Y7E=
=XxlA
-----END PGP SIGNATURE-----
Merge tag 'nvme-5.17-2021-12-29' of git://git.infradead.org/nvme into for-5.17/drivers
Pull NVMe updates from Christoph:
"nvme updates for Linux 5.17
- increment request genctr on completion (Keith Busch, Geliang Tang)
- add a 'iopolicy' module parameter (Hannes Reinecke)
- print out valid arguments when reading from /dev/nvme-fabrics
(Hannes Reinecke)"
* tag 'nvme-5.17-2021-12-29' of git://git.infradead.org/nvme:
nvme: add 'iopolicy' module parameter
nvme: drop unused variable ctrl in nvme_setup_cmd
nvme: increment request genctr on completion
nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics
This commit is contained in:
commit
498860df8e
|
|
@ -990,7 +990,6 @@ EXPORT_SYMBOL_GPL(nvme_cleanup_cmd);
|
|||
blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
|
||||
{
|
||||
struct nvme_command *cmd = nvme_req(req)->cmd;
|
||||
struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
|
||||
blk_status_t ret = BLK_STS_OK;
|
||||
|
||||
if (!(req->rq_flags & RQF_DONTPREP))
|
||||
|
|
@ -1037,8 +1036,6 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
|
|||
return BLK_STS_IOERR;
|
||||
}
|
||||
|
||||
if (!(ctrl->quirks & NVME_QUIRK_SKIP_CID_GEN))
|
||||
nvme_req(req)->genctr++;
|
||||
cmd->common.command_id = nvme_cid(req);
|
||||
trace_nvme_setup_cmd(req, cmd);
|
||||
return ret;
|
||||
|
|
@ -2749,9 +2746,7 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
|
|||
return -EINVAL;
|
||||
}
|
||||
subsys->awupf = le16_to_cpu(id->awupf);
|
||||
#ifdef CONFIG_NVME_MULTIPATH
|
||||
subsys->iopolicy = NVME_IOPOLICY_NUMA;
|
||||
#endif
|
||||
nvme_mpath_default_iopolicy(subsys);
|
||||
|
||||
subsys->dev.class = nvme_subsys_class;
|
||||
subsys->dev.release = nvme_release_subsystem;
|
||||
|
|
|
|||
|
|
@ -1069,6 +1069,26 @@ static ssize_t nvmf_dev_write(struct file *file, const char __user *ubuf,
|
|||
return ret ? ret : count;
|
||||
}
|
||||
|
||||
static void __nvmf_concat_opt_tokens(struct seq_file *seq_file)
|
||||
{
|
||||
const struct match_token *tok;
|
||||
int idx;
|
||||
|
||||
/*
|
||||
* Add dummy entries for instance and cntlid to
|
||||
* signal an invalid/non-existing controller
|
||||
*/
|
||||
seq_puts(seq_file, "instance=-1,cntlid=-1");
|
||||
for (idx = 0; idx < ARRAY_SIZE(opt_tokens); idx++) {
|
||||
tok = &opt_tokens[idx];
|
||||
if (tok->token == NVMF_OPT_ERR)
|
||||
continue;
|
||||
seq_puts(seq_file, ",");
|
||||
seq_puts(seq_file, tok->pattern);
|
||||
}
|
||||
seq_puts(seq_file, "\n");
|
||||
}
|
||||
|
||||
static int nvmf_dev_show(struct seq_file *seq_file, void *private)
|
||||
{
|
||||
struct nvme_ctrl *ctrl;
|
||||
|
|
@ -1077,7 +1097,7 @@ static int nvmf_dev_show(struct seq_file *seq_file, void *private)
|
|||
mutex_lock(&nvmf_dev_mutex);
|
||||
ctrl = seq_file->private;
|
||||
if (!ctrl) {
|
||||
ret = -EINVAL;
|
||||
__nvmf_concat_opt_tokens(seq_file);
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,42 @@ module_param(multipath, bool, 0444);
|
|||
MODULE_PARM_DESC(multipath,
|
||||
"turn on native support for multiple controllers per subsystem");
|
||||
|
||||
static const char *nvme_iopolicy_names[] = {
|
||||
[NVME_IOPOLICY_NUMA] = "numa",
|
||||
[NVME_IOPOLICY_RR] = "round-robin",
|
||||
};
|
||||
|
||||
static int iopolicy = NVME_IOPOLICY_NUMA;
|
||||
|
||||
static int nvme_set_iopolicy(const char *val, const struct kernel_param *kp)
|
||||
{
|
||||
if (!val)
|
||||
return -EINVAL;
|
||||
if (!strncmp(val, "numa", 4))
|
||||
iopolicy = NVME_IOPOLICY_NUMA;
|
||||
else if (!strncmp(val, "round-robin", 11))
|
||||
iopolicy = NVME_IOPOLICY_RR;
|
||||
else
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nvme_get_iopolicy(char *buf, const struct kernel_param *kp)
|
||||
{
|
||||
return sprintf(buf, "%s\n", nvme_iopolicy_names[iopolicy]);
|
||||
}
|
||||
|
||||
module_param_call(iopolicy, nvme_set_iopolicy, nvme_get_iopolicy,
|
||||
&iopolicy, 0644);
|
||||
MODULE_PARM_DESC(iopolicy,
|
||||
"Default multipath I/O policy; 'numa' (default) or 'round-robin'");
|
||||
|
||||
void nvme_mpath_default_iopolicy(struct nvme_subsystem *subsys)
|
||||
{
|
||||
subsys->iopolicy = iopolicy;
|
||||
}
|
||||
|
||||
void nvme_mpath_unfreeze(struct nvme_subsystem *subsys)
|
||||
{
|
||||
struct nvme_ns_head *h;
|
||||
|
|
@ -706,11 +742,6 @@ void nvme_mpath_stop(struct nvme_ctrl *ctrl)
|
|||
struct device_attribute subsys_attr_##_name = \
|
||||
__ATTR(_name, _mode, _show, _store)
|
||||
|
||||
static const char *nvme_iopolicy_names[] = {
|
||||
[NVME_IOPOLICY_NUMA] = "numa",
|
||||
[NVME_IOPOLICY_RR] = "round-robin",
|
||||
};
|
||||
|
||||
static ssize_t nvme_subsys_iopolicy_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -614,6 +614,10 @@ static inline bool nvme_try_complete_req(struct request *req, __le16 status,
|
|||
union nvme_result result)
|
||||
{
|
||||
struct nvme_request *rq = nvme_req(req);
|
||||
struct nvme_ctrl *ctrl = rq->ctrl;
|
||||
|
||||
if (!(ctrl->quirks & NVME_QUIRK_SKIP_CID_GEN))
|
||||
rq->genctr++;
|
||||
|
||||
rq->status = le16_to_cpu(status) >> 1;
|
||||
rq->result = result;
|
||||
|
|
@ -763,6 +767,7 @@ static inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl)
|
|||
void nvme_mpath_unfreeze(struct nvme_subsystem *subsys);
|
||||
void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys);
|
||||
void nvme_mpath_start_freeze(struct nvme_subsystem *subsys);
|
||||
void nvme_mpath_default_iopolicy(struct nvme_subsystem *subsys);
|
||||
bool nvme_mpath_set_disk_name(struct nvme_ns *ns, char *disk_name, int *flags);
|
||||
void nvme_failover_req(struct request *req);
|
||||
void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl);
|
||||
|
|
@ -860,6 +865,9 @@ static inline void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys)
|
|||
static inline void nvme_mpath_start_freeze(struct nvme_subsystem *subsys)
|
||||
{
|
||||
}
|
||||
static inline void nvme_mpath_default_iopolicy(struct nvme_subsystem *subsys)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_NVME_MULTIPATH */
|
||||
|
||||
int nvme_revalidate_zones(struct nvme_ns *ns);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user