Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: Disable NETIF_F_HW_TLS_RX when RXCSUM is disabled

With NETIF_F_HW_TLS_RX packets are decrypted in HW. This cannot be
logically done when RXCSUM offload is off.

Fixes: 14136564c8ee ("net: Add TLS RX offload feature")
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Boris Pismenny <borisp@nvidia.com>
Link: https://lore.kernel.org/r/20210117151538.9411-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Tariq Toukan and committed by
Jakub Kicinski
a3eb4e9d 2565ff4e

+8
+3
Documentation/networking/tls-offload.rst
··· 534 534 Disabling the latter implies clearing the former. Disabling TX checksum offload 535 535 should not affect old connections, and drivers should make sure checksum 536 536 calculation does not break for them. 537 + Similarly, device-offloaded TLS decryption implies doing RXCSUM. If the user 538 + does not want to enable RX csum offload, TLS RX device feature is disabled 539 + as well.
+5
net/core/dev.c
··· 9672 9672 } 9673 9673 } 9674 9674 9675 + if ((features & NETIF_F_HW_TLS_RX) && !(features & NETIF_F_RXCSUM)) { 9676 + netdev_dbg(dev, "Dropping TLS RX HW offload feature since no RXCSUM feature.\n"); 9677 + features &= ~NETIF_F_HW_TLS_RX; 9678 + } 9679 + 9675 9680 return features; 9676 9681 } 9677 9682