nvme-fc: clean up error messages
Subsystems (2)
PATCH v2 1/1 nvme-fc: clean up error messages
Some of the error messages are inconsistent, and one of them is wrong (i.e. "queue_size 128 > ctrl maxcmd 32, reducing to queue_size"). Make them more clear and distinguishable for log analysis.
--- drivers/nvme/host/fc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/nvme/host/fc.c +9 -7
@@ -1259,7 +1259,7 @@ nvme_fc_connect_admin_queue(struct nvme_fc_ctrl *ctrl,if (fcret) { ret = -EBADF ;dev_err (ctrl->dev, -"q %d connect failed: %s\n" , +"queue %d connect admin queue failed: %s\n" , queue->qnum, validation_errors[fcret]); }else { ctrl->association_id =
@@ -1358,7 +1358,7 @@ nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,if (fcret) { ret = -EBADF ;dev_err (ctrl->dev, -"q %d connect failed: %s\n" , +"queue %d connect queue failed: %s\n" , queue->qnum, validation_errors[fcret]); }else { queue->connection_id =
@@ -1371,7 +1371,7 @@ nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue, out_no_memory:if (ret)dev_err (ctrl->dev, -"queue %d connect command failed (%d).\n" , +"queue %d connect queue failed (%d).\n" , queue->qnum, ret);return ret; }
@@ -2678,16 +2678,18 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)/* warn if maxcmd is lower than queue_size */ dev_warn (ctrl->ctrl.device,"queue_size %zu > ctrl maxcmd %u, reducing " -"to queue_size\n" , - opts->queue_size, ctrl->ctrl.maxcmd); +"queue_size to %u\n" , + opts->queue_size, ctrl->ctrl.maxcmd, ctrl->ctrl.maxcmd); opts->queue_size = ctrl->ctrl.maxcmd; }if (opts->queue_size > ctrl->ctrl.sqsize +1 ) {/* warn if sqsize is lower than queue_size */ dev_warn (ctrl->ctrl.device, -"queue_size %zu > ctrl sqsize %u, clamping down\n" , - opts->queue_size, ctrl->ctrl.sqsize +1 ); +"queue_size %zu > ctrl sqsize %u, reducing " +"queue_size to %u\n" , + opts->queue_size, ctrl->ctrl.sqsize +1 , + ctrl->ctrl.sqsize +1 ); opts->queue_size = ctrl->ctrl.sqsize +1 ; }
Signature · 1 line
2.18.1
PATCH v2 1/1 nvme-fc: clean up error messages
Quoted 14 lines · Ewan D. Milne
Some of the error messages are inconsistent, and one of them is wrong (i.e. "
queue_size128 > ctrl maxcmd 32, reducing toqueue_size"). Make them more clear and distinguishable for log analysis.Signed-off-by Ewan D. Milne <emilne at redhat.com>--- drivers/nvme/host/fc.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)drivers/nvme/host/fc.c +0
-0
drivers/nvme/host/fc.c nvme_fc_connect_admin_queue(struct nvme_fc_ctrl *ctrl, · line 1265
Quoted 8 lines
drivers/nvme/host/fc.c +1
-1@@ -1259,7 +1259,7 @@ nvme_fc_connect_admin_queue(struct nvme_fc_ctrl *ctrl,if (fcret) { ret = -EBADF ;dev_err (ctrl->dev, -"q %d connect failed: %s\n" , +"queue %d connect admin queue failed: %s\n" , queue->qnum, validation_errors[fcret]); }else { ctrl->association_id =
Since we're changing them...
how about "queue %d Create Association LS failed: %s"
drivers/nvme/host/fc.c nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue, · line 1361
Quoted 6 lines
drivers/nvme/host/fc.c +1
-1@@ -1358,7 +1358,7 @@ nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,if (fcret) { ret = -EBADF ; dev_err(ctrl->dev, - "q %d connect failed: %s\n", + "queue %d connect queue failed: %s\n",
how about "queue %d Create Connection LS failed: %s"
Quoted 25 lines
drivers/nvme/host/fc.c +3
-3queue->qnum, validation_errors[fcret]); }else { queue->connection_id =@@ -1371,7 +1371,7 @@ nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue, out_no_memory:if (ret)dev_err (ctrl->dev, -"queue %d connect command failed (%d).\n" , +"queue %d connect queue failed (%d).\n" , queue->qnum, ret);return ret; }@@ -2678,16 +2678,18 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)/* warn if maxcmd is lower than queue_size */ dev_warn (ctrl->ctrl.device,"queue_size %zu > ctrl maxcmd %u, reducing " -"to queue_size\n" , - opts->queue_size, ctrl->ctrl.maxcmd); +"queue_size to %u\n" , + opts->queue_size, ctrl->ctrl.maxcmd, ctrl->ctrl.maxcmd); opts->queue_size = ctrl->ctrl.maxcmd; }if (opts->queue_size > ctrl->ctrl.sqsize +1 ) {/* warn if sqsize is lower than queue_size */
drivers/nvme/host/fc.c nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) · line 2695
Quoted 10 lines
drivers/nvme/host/fc.c +4
-2dev_warn (ctrl->ctrl.device, -"queue_size %zu > ctrl sqsize %u, clamping down\n" , - opts->queue_size, ctrl->ctrl.sqsize +1 ); +"queue_size %zu > ctrl sqsize %u, reducing " +"queue_size to %u\n" , + opts->queue_size, ctrl->ctrl.sqsize +1 , + ctrl->ctrl.sqsize +1 ); opts->queue_size = ctrl->ctrl.sqsize +1 ; }
Given these last two came from a template in the rdma transport - you may want to consider using the same wording in all the transports.
-- james
PATCH v2 1/1 nvme-fc: clean up error messages
Quoted 15 lines · James Smart
drivers/nvme/host/fc.c nvme_fc_connect_admin_queue(struct nvme_fc_ctrl *ctrl, · line 1265
Quoted 10 lines
drivers/nvme/host/fc.c +1
-1@@ -1259,7 +1259,7 @@ nvme_fc_connect_admin_queue(struct nvme_fc_ctrl *ctrl,if (fcret) { ret = -EBADF ;dev_err (ctrl->dev, -"q %d connect failed: %s\n" , +"queue %d connect admin queue failed: %s\n" , queue->qnum, validation_errors[fcret]); }else { ctrl->association_id =Since we're changing them...
how about "queue %d Create Association LS failed: %s"
Quoted 8 lines
drivers/nvme/host/fc.c nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue, · line 1361
Quoted 6 lines
drivers/nvme/host/fc.c +1
-1@@ -1358,7 +1358,7 @@ nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue,if (fcret) { ret = -EBADF ; dev_err(ctrl->dev, - "q %d connect failed: %s\n", + "queue %d connect queue failed: %s\n",how about "queue %d Create Connection LS failed: %s"
Sure.
Quoted 12 lines
Quoted 12 lines
drivers/nvme/host/fc.c +2
-2@@ -2678,16 +2678,18 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)/* warn if maxcmd is lower than queue_size */ dev_warn (ctrl->ctrl.device,"queue_size %zu > ctrl maxcmd %u, reducing " -"to queue_size\n" , - opts->queue_size, ctrl->ctrl.maxcmd); +"queue_size to %u\n" , + opts->queue_size, ctrl->ctrl.maxcmd, ctrl->ctrl.maxcmd); opts->queue_size = ctrl->ctrl.maxcmd; }
Quoted 15 lines
drivers/nvme/host/fc.c nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) · line 2695
Quoted 12 lines
drivers/nvme/host/fc.c +4
-2if (opts->queue_size > ctrl->ctrl.sqsize +1 ) {/* warn if sqsize is lower than queue_size */ dev_warn (ctrl->ctrl.device, -"queue_size %zu > ctrl sqsize %u, clamping down\n" , - opts->queue_size, ctrl->ctrl.sqsize +1 ); +"queue_size %zu > ctrl sqsize %u, reducing " +"queue_size to %u\n" , + opts->queue_size, ctrl->ctrl.sqsize +1 , + ctrl->ctrl.sqsize +1 ); opts->queue_size = ctrl->ctrl.sqsize +1 ; }Given these last two came from a template in the rdma transport - you may want to consider using the same wording in all the transports.
Hmm. The RDMA and TCP transports do not appear to actually change opts->queue_size if > maxcmd, here, despite the warning message, but they use sqsize when allocating the tagset.
And they both reduce the sqsize if > maxcmd, not if queue_size > sqsize as in FC, (which does not change sqsize).
commit 5e77d61cbc7e766778037127dab69e6410a8fc48
Author: Sagi Grimberg <sagi at grimberg.me> Date: Tue Jun 19 15:34:13 2018 +0300
nvme-rdma: don't override opts->queue_size
So should FC be using the same logic?
-Ewan
Quoted 4 lines
-- james
PATCH v2 1/1 nvme-fc: clean up error messages
Quoted 7 lines · Ewan D. Milne
commit
5e77d61cbc7e766778037127dab69e6410a8fc48Author: Sagi Grimberg<sagi at grimberg.me> Date: Tue Jun 19 15:34:13 2018 +0300nvme-rdma: don't override opts->queue_sizeSo should FC be using the same logic?
not sure - I'll have to look why Sagi reverted it.
-- james
Sagi Grimberg
maintainerPATCH v2 1/1 nvme-fc: clean up error messages
Quoted 10 lines
Quoted 8 lines
commit
5e77d61cbc7e766778037127dab69e6410a8fc48
Author: Sagi Grimberg<sagi at grimberg.me>
Date:?? Tue Jun 19 15:34:13 2018 +0300???? nvme-rdma: don't override
opts->queue_sizeSo should FC be using the same logic?
not sure - I'll have to look why Sagi reverted it.
I reverted it because its a user parameter which we should try to avoid modifying.
And maxcmd or other limits can theoretically change over resets.