summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@nvidia.com>2020-12-13 16:39:29 +0200
committerJakub Kicinski <kuba@kernel.org>2020-12-14 19:31:36 -0800
commitae0b04b238e283cafd906cdc3489cf5dc9a825cf (patch)
tree2c4c8941f0f01d238f913ce8f4236bf151ccbd0e /net
parentc31b70c9968fe9c4194d1b5d06d07596a3b680de (diff)
downloadlinux-ae0b04b238e283cafd906cdc3489cf5dc9a825cf.tar.bz2
net: Disable NETIF_F_HW_TLS_TX when HW_CSUM is disabled
With NETIF_F_HW_TLS_TX packets are encrypted in HW. This cannot be logically done when HW_CSUM offload is off. Fixes: 2342a8512a1e ("net: Add TLS TX offload features") Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Boris Pismenny <borisp@nvidia.com> Link: https://lore.kernel.org/r/20201213143929.26253-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index bde98cfd166f..0fd0d4eb678c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9643,6 +9643,11 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
}
}
+ if ((features & NETIF_F_HW_TLS_TX) && !(features & NETIF_F_HW_CSUM)) {
+ netdev_dbg(dev, "Dropping TLS TX HW offload feature since no CSUM feature.\n");
+ features &= ~NETIF_F_HW_TLS_TX;
+ }
+
return features;
}