From: Tariq Toukan Date: Sun, 17 Jan 2021 15:15:38 +0000 (+0200) Subject: net: Disable NETIF_F_HW_TLS_RX when RXCSUM is disabled X-Git-Tag: v5.4.93~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ff64094dc71823938acb595cab27a4b07d6a6cd1;p=thirdparty%2Fkernel%2Fstable.git net: Disable NETIF_F_HW_TLS_RX when RXCSUM is disabled commit a3eb4e9d4c9218476d05c52dfd2be3d6fdce6b91 upstream. 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 Reviewed-by: Boris Pismenny Link: https://lore.kernel.org/r/20210117151538.9411-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/dev.c b/net/core/dev.c index 20c7fd7b8b4bc..ec66d13d2bdad 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -8692,6 +8692,11 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, } } + if ((features & NETIF_F_HW_TLS_RX) && !(features & NETIF_F_RXCSUM)) { + netdev_dbg(dev, "Dropping TLS RX HW offload feature since no RXCSUM feature.\n"); + features &= ~NETIF_F_HW_TLS_RX; + } + return features; }