Skip to content

Commit a3eb4e9

Browse files
Tariq Toukankuba-moo
authored andcommitted
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: 1413656 ("net: Add TLS RX offload feature") Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Boris Pismenny <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2565ff4 commit a3eb4e9

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Documentation/networking/tls-offload.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,3 +534,6 @@ offload. Hence, TLS TX device feature flag requires TX csum offload being set.
534534
Disabling the latter implies clearing the former. Disabling TX checksum offload
535535
should not affect old connections, and drivers should make sure checksum
536536
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.

net/core/dev.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9672,6 +9672,11 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
96729672
}
96739673
}
96749674

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+
96759680
return features;
96769681
}
96779682

0 commit comments

Comments
 (0)