diff options
author | Ben Ben-ishay <benishay@nvidia.com> | 2020-12-16 12:32:24 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2021-10-26 19:30:38 -0700 |
commit | 54b2b3eccab63e0c359aad562498cd9f49a1547d (patch) | |
tree | 98dd4c021c072d51a58b6590a69c707b3fe9959a /net | |
parent | 7529cc7fbd9c02eda6851f3260416cbe198a321d (diff) |
net: Prevent HW-GRO and LRO features operate together
LRO and HW-GRO are mutually exclusive, this commit adds this restriction
in netdev_fix_feature. HW-GRO is preferred, that means in case both
HW-GRO and LRO features are requested, LRO is cleared.
Signed-off-by: Ben Ben-ishay <benishay@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
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 4e3d19a06de4..e8754560e641 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9922,6 +9922,11 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, } } + if ((features & NETIF_F_GRO_HW) && (features & NETIF_F_LRO)) { + netdev_dbg(dev, "Dropping LRO feature since HW-GRO is requested.\n"); + features &= ~NETIF_F_LRO; + } + if (features & NETIF_F_HW_TLS_TX) { bool ip_csum = (features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) == (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); |