aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/dev.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 92009440d28b..b624fe4d9bd7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5186,27 +5186,27 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
5186 /* Fix illegal checksum combinations */ 5186 /* Fix illegal checksum combinations */
5187 if ((features & NETIF_F_HW_CSUM) && 5187 if ((features & NETIF_F_HW_CSUM) &&
5188 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { 5188 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
5189 netdev_info(dev, "mixed HW and IP checksum settings.\n"); 5189 netdev_warn(dev, "mixed HW and IP checksum settings.\n");
5190 features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM); 5190 features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM);
5191 } 5191 }
5192 5192
5193 if ((features & NETIF_F_NO_CSUM) && 5193 if ((features & NETIF_F_NO_CSUM) &&
5194 (features & (NETIF_F_HW_CSUM|NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { 5194 (features & (NETIF_F_HW_CSUM|NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
5195 netdev_info(dev, "mixed no checksumming and other settings.\n"); 5195 netdev_warn(dev, "mixed no checksumming and other settings.\n");
5196 features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM); 5196 features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM);
5197 } 5197 }
5198 5198
5199 /* Fix illegal SG+CSUM combinations. */ 5199 /* Fix illegal SG+CSUM combinations. */
5200 if ((features & NETIF_F_SG) && 5200 if ((features & NETIF_F_SG) &&
5201 !(features & NETIF_F_ALL_CSUM)) { 5201 !(features & NETIF_F_ALL_CSUM)) {
5202 netdev_info(dev, 5202 netdev_dbg(dev,
5203 "Dropping NETIF_F_SG since no checksum feature.\n"); 5203 "Dropping NETIF_F_SG since no checksum feature.\n");
5204 features &= ~NETIF_F_SG; 5204 features &= ~NETIF_F_SG;
5205 } 5205 }
5206 5206
5207 /* TSO requires that SG is present as well. */ 5207 /* TSO requires that SG is present as well. */
5208 if ((features & NETIF_F_ALL_TSO) && !(features & NETIF_F_SG)) { 5208 if ((features & NETIF_F_ALL_TSO) && !(features & NETIF_F_SG)) {
5209 netdev_info(dev, "Dropping TSO features since no SG feature.\n"); 5209 netdev_dbg(dev, "Dropping TSO features since no SG feature.\n");
5210 features &= ~NETIF_F_ALL_TSO; 5210 features &= ~NETIF_F_ALL_TSO;
5211 } 5211 }
5212 5212
@@ -5216,7 +5216,7 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
5216 5216
5217 /* Software GSO depends on SG. */ 5217 /* Software GSO depends on SG. */
5218 if ((features & NETIF_F_GSO) && !(features & NETIF_F_SG)) { 5218 if ((features & NETIF_F_GSO) && !(features & NETIF_F_SG)) {
5219 netdev_info(dev, "Dropping NETIF_F_GSO since no SG feature.\n"); 5219 netdev_dbg(dev, "Dropping NETIF_F_GSO since no SG feature.\n");
5220 features &= ~NETIF_F_GSO; 5220 features &= ~NETIF_F_GSO;
5221 } 5221 }
5222 5222
@@ -5226,13 +5226,13 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
5226 if (!((features & NETIF_F_GEN_CSUM) || 5226 if (!((features & NETIF_F_GEN_CSUM) ||
5227 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM)) 5227 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))
5228 == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { 5228 == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
5229 netdev_info(dev, 5229 netdev_dbg(dev,
5230 "Dropping NETIF_F_UFO since no checksum offload features.\n"); 5230 "Dropping NETIF_F_UFO since no checksum offload features.\n");
5231 features &= ~NETIF_F_UFO; 5231 features &= ~NETIF_F_UFO;
5232 } 5232 }
5233 5233
5234 if (!(features & NETIF_F_SG)) { 5234 if (!(features & NETIF_F_SG)) {
5235 netdev_info(dev, 5235 netdev_dbg(dev,
5236 "Dropping NETIF_F_UFO since no NETIF_F_SG feature.\n"); 5236 "Dropping NETIF_F_UFO since no NETIF_F_SG feature.\n");
5237 features &= ~NETIF_F_UFO; 5237 features &= ~NETIF_F_UFO;
5238 } 5238 }
@@ -5414,12 +5414,6 @@ int register_netdevice(struct net_device *dev)
5414 dev->features |= NETIF_F_SOFT_FEATURES; 5414 dev->features |= NETIF_F_SOFT_FEATURES;
5415 dev->wanted_features = dev->features & dev->hw_features; 5415 dev->wanted_features = dev->features & dev->hw_features;
5416 5416
5417 /* Avoid warning from netdev_fix_features() for GSO without SG */
5418 if (!(dev->wanted_features & NETIF_F_SG)) {
5419 dev->wanted_features &= ~NETIF_F_GSO;
5420 dev->features &= ~NETIF_F_GSO;
5421 }
5422
5423 /* Enable GRO and NETIF_F_HIGHDMA for vlans by default, 5417 /* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
5424 * vlan_dev_init() will do the dev->features check, so these features 5418 * vlan_dev_init() will do the dev->features check, so these features
5425 * are enabled only if supported by underlying device. 5419 * are enabled only if supported by underlying device.