diff mbox series

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

Message ID 20230712161513.134860-13-aaptel@nvidia.com (mailing list archive)
State RFC
Headers show
Series nvme-tcp receive offloads | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply, async

Commit Message

Aurelien Aptel July 12, 2023, 4:14 p.m. UTC
Check if ULP offload driver supports ULP-over-TLS before enabling the
offload with tls.

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

Comments

Sagi Grimberg Aug. 9, 2023, 8:05 a.m. UTC | #1
On 7/12/23 19:14, Aurelien Aptel wrote:
> Check if ULP offload driver supports ULP-over-TLS before enabling the
> offload with tls.
> 
> Signed-off-by: Aurelien Aptel <aaptel@nvidia.com>
> Signed-off-by: Shai Malin <smalin@nvidia.com>
> Reviewed-by: Max Gurtovoy <mgurtovoy@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;

Same for this, fold to the first patch.

Other than that I had a question on one of my other responses.
I don't think that tls_device supports 1.3, so what does tls
here mean? That any device that enables this supports _all_
tls versions?
Aurelien Aptel Aug. 10, 2023, 2:52 p.m. UTC | #2
Sagi Grimberg <sagi@grimberg.me> writes:
>> +     /* 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;
>
> Same for this, fold to the first patch.

Ok

> Other than that I had a question on one of my other responses.
> I don't think that tls_device supports 1.3, so what does tls
> here mean? That any device that enables this supports _all_
> tls versions?

This is a catch-all for all TLS versions.
We can split the logic between TLS version once a HW device will allow it.

Thanks
diff mbox series

Patch

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;