[PATCH v12 12/26] nvme-tcp: Only enable offload with TLS if the driver supports it

Aurelien Aptel aaptel at nvidia.com
Wed Jul 12 09:14:59 PDT 2023


Check if ULP offload driver supports ULP-over-TLS before enabling the
offload with tls.

Signed-off-by: Aurelien Aptel <aaptel at nvidia.com>
Signed-off-by: Shai Malin <smalin at nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy at nvidia.com>
---
 drivers/nvme/host/tcp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index e560bdf3a023..afb3dedcbc0c 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -367,6 +367,10 @@ static inline bool is_netdev_ulp_offload_active(struct net_device *netdev,
 	if (!nvme_tcp_ddp_query_limits(netdev, queue))
 		return false;
 
+	/* If we are using TLS and netdev doesn't support it, do not offload */
+	if (queue->ctrl->ctrl.opts->tls && !queue->ddp_limits.tls)
+		return false;
+
 	/* If netdev supports nvme-tcp ddp offload, we can offload */
 	if (test_bit(ULP_DDP_C_NVME_TCP_BIT, netdev->ulp_ddp_caps.active))
 		return true;
-- 
2.34.1




More information about the Linux-nvme mailing list