diff options
author | Tariq Toukan <tariqt@nvidia.com> | 2021-01-17 18:15:38 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-20 02:58:05 +0300 |
commit | a3eb4e9d4c9218476d05c52dfd2be3d6fdce6b91 (patch) | |
tree | b872ed28ca6a97f8820df9fcf7b069aa31396d84 /net | |
parent | 2565ff4eef34e03af67b7447c232c858f46b6e3b (diff) | |
download | linux-a3eb4e9d4c9218476d05c52dfd2be3d6fdce6b91.tar.xz |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index c360bb5367e2..a979b86dbacd 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9672,6 +9672,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; } |