From: Gal Pressman Date: Mon, 12 Mar 2018 09:48:49 +0000 (+0200) Subject: net: Make RX-FCS and HW GRO mutually exclusive X-Git-Tag: v5.15~9146^2~214 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de8d5ab2ff6edc8e26822965a30b6aa4e9332025;p=platform%2Fkernel%2Flinux-starfive.git net: Make RX-FCS and HW GRO mutually exclusive Same as LRO, hardware GRO cannot be enabled with RX-FCS. When both are requested, hardware GRO will be dropped. Suggested-by: David Miller Signed-off-by: Gal Pressman Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 259abb1..12a9aad 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -7549,10 +7549,17 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, } } - /* LRO feature cannot be combined with RX-FCS */ - if ((features & NETIF_F_LRO) && (features & NETIF_F_RXFCS)) { - netdev_dbg(dev, "Dropping LRO feature since RX-FCS is requested.\n"); - features &= ~NETIF_F_LRO; + /* LRO/HW-GRO features cannot be combined with RX-FCS */ + if (features & NETIF_F_RXFCS) { + if (features & NETIF_F_LRO) { + netdev_dbg(dev, "Dropping LRO feature since RX-FCS is requested.\n"); + features &= ~NETIF_F_LRO; + } + + if (features & NETIF_F_GRO_HW) { + netdev_dbg(dev, "Dropping HW-GRO feature since RX-FCS is requested.\n"); + features &= ~NETIF_F_GRO_HW; + } } return features;