Skip to contentSkip to conversation

nvmet: use unlikely for req status check

PATCH New Chaitanya Kulkarni 3 participants 3 messages Nov 19, 2018 – Nov 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmet: use unlikely for req status check

This patch adds unlikely in the nvmet request completion path for the status check in the low level function __nvmet_req_complete. This is helpful in the scenario where host and target connection is working smoothly.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 drivers/nvme/target/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/core.c +1 -1
index e3e158ff207a..ac98e9212274 100644
@@ -602,7 +602,7 @@ static void __nvmet_req_complete(struct nvmet_req *req, u16 status)
 	u32 old_sqhd, new_sqhd;
 	u16 sqhd;
 
-	if (status)
+	if (unlikely(status))
 		nvmet_set_status(req, status);
 
 	if (req->sq->size) {
Signature · 1 line
2.17.0
maintainer
#1 lore raw

PATCH 1/1 nvmet: use unlikely for req status check

Reviewed-by Sagi Grimberg <sagi at grimberg.me>