[PATCH V2] nvme-tcp: log TLS handshake failures at error level

Maurizio Lombardi mlombard at redhat.com
Wed Jul 2 07:06:29 PDT 2025


Update the nvme_tcp_start_tls() function to use dev_err()
instead of dev_dbg() when a TLS error is detected.
This ensures that handshake failures are visible by default,
aiding in debugging.

Signed-off-by: Maurizio Lombardi <mlombard at redhat.com>
---

 v2: Hans suggests to print a dev_dbg() message
     if handshake is succesfull

 drivers/nvme/host/tcp.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index d924008c3949..9233f088fac8 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1745,9 +1745,14 @@ static int nvme_tcp_start_tls(struct nvme_ctrl *nctrl,
 			qid, ret);
 		tls_handshake_cancel(queue->sock->sk);
 	} else {
-		dev_dbg(nctrl->device,
-			"queue %d: TLS handshake complete, error %d\n",
-			qid, queue->tls_err);
+		if (queue->tls_err) {
+			dev_err(nctrl->device,
+				"queue %d: TLS handshake complete, error %d\n",
+				qid, queue->tls_err);
+		} else {
+			dev_dbg(nctrl->device,
+				"queue %d: TLS handshake complete\n", qid);
+		}
 		ret = queue->tls_err;
 	}
 	return ret;
-- 
2.47.1




More information about the Linux-nvme mailing list