Skip to contentSkip to conversation

nvme: use NVME_CTRL_CMIC_ANA macro

PATCH Applied Kanchan Joshi 3 participants 6 messages Mar 8, 2021 – Mar 9, 2021 1 message not in the archive NVMe

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20210308191842epcas5p2a21883eef4b6f98492987f80704d09bd@epcas5p2.samsung.com

#1 lore raw

cover cleanup and small improvement

First patch does away with hard-coded value.
Second patch is a micro-optimization for io passthrough commands.

Kanchan Joshi (2):
nvme: use NVME_CTRL_CMIC_ANA macro
nvme-core: reduce checks for zero command effects

 drivers/nvme/host/core.c | 3 ++-
 drivers/nvme/host/nvme.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 7 lines
2.25.1


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#2 lore raw

PATCH 1/2 nvme: use NVME_CTRL_CMIC_ANA macro

use the macro instead of hard-coded value.

---
 drivers/nvme/host/nvme.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/nvme.h +1 -1
index 07b34175c6ce..e82407d1ec23 100644
@@ -745,7 +745,7 @@ static inline void nvme_trace_bio_complete(struct request *req)
 static inline int nvme_mpath_init(struct nvme_ctrl *ctrl,
 		struct nvme_id_ctrl *id)
 {
-	if (ctrl->subsys->cmic & (1 << 3))
+	if (ctrl->subsys->cmic & NVME_CTRL_CMIC_ANA)
 		dev_warn(ctrl->device,
 "Please enable CONFIG_NVME_MULTIPATH for full support of multi-port devices.\n");
 	return 0;
Signature · 7 lines
2.25.1


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#4 lore raw

PATCH 2/2 nvme-core: reduce checks for zero command effects

In reply to Kanchan Joshi

For io passthrough commands, effects are exepcted to be zero. nvme_passthrough_end() does three checks in futility for this case. Bail out of function-call/checks.

---
 drivers/nvme/host/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
index e68a8c4ac5a6..ddb495dd0842 100644
@@ -1136,7 +1136,8 @@ void nvme_execute_passthru_rq(struct request *rq)
 
 	effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode);
 	blk_execute_rq(disk, rq, 0);
-	nvme_passthru_end(ctrl, effects);
+	if (effects) /* nothing to be done for zero cmd effects */
+		nvme_passthru_end(ctrl, effects);
 }
 EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);
 
Signature · 7 lines
2.25.1


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH 2/2] nvme-core: reduce checks for zero command effects

Quoted 5 lines · Kanchan Joshi

For io passthrough commands, effects are exepcted to be zero. nvme_passthrough_end() does three checks in futility for this case. Bail out of function-call/checks.

Looks good.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme