aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-01-24 18:45:15 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-24 18:45:15 -0500
commitacd1130e8793fb150fb522da8ec51675839eb4b1 (patch)
tree0da6f9f8f7690b426ff069f95bb28bf9e692d534 /net/core/dev.c
parent04ed3e741d0f133e02bed7fa5c98edba128f90e7 (diff)
net: reduce and unify printk level in netdev_fix_features()
Reduce printk() levels to KERN_INFO in netdev_fix_features() as this will be used by ethtool and might spam dmesg unnecessarily. This converts the function to use netdev_info() instead of plain printk(). As a side effect, bonding and bridge devices will now log dropped features on every slave device change. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 7103f89fde0..1b4c07fe295 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5213,58 +5213,49 @@ static void rollback_registered(struct net_device *dev)
5213 rollback_registered_many(&single); 5213 rollback_registered_many(&single);
5214} 5214}
5215 5215
5216u32 netdev_fix_features(u32 features, const char *name) 5216u32 netdev_fix_features(struct net_device *dev, u32 features)
5217{ 5217{
5218 /* Fix illegal checksum combinations */ 5218 /* Fix illegal checksum combinations */
5219 if ((features & NETIF_F_HW_CSUM) && 5219 if ((features & NETIF_F_HW_CSUM) &&
5220 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { 5220 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
5221 if (name) 5221 netdev_info(dev, "mixed HW and IP checksum settings.\n");
5222 printk(KERN_NOTICE "%s: mixed HW and IP checksum settings.\n",
5223 name);
5224 features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM); 5222 features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM);
5225 } 5223 }
5226 5224
5227 if ((features & NETIF_F_NO_CSUM) && 5225 if ((features & NETIF_F_NO_CSUM) &&
5228 (features & (NETIF_F_HW_CSUM|NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { 5226 (features & (NETIF_F_HW_CSUM|NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
5229 if (name) 5227 netdev_info(dev, "mixed no checksumming and other settings.\n");
5230 printk(KERN_NOTICE "%s: mixed no checksumming and other settings.\n",
5231 name);
5232 features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM); 5228 features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM);
5233 } 5229 }
5234 5230
5235 /* Fix illegal SG+CSUM combinations. */ 5231 /* Fix illegal SG+CSUM combinations. */
5236 if ((features & NETIF_F_SG) && 5232 if ((features & NETIF_F_SG) &&
5237 !(features & NETIF_F_ALL_CSUM)) { 5233 !(features & NETIF_F_ALL_CSUM)) {
5238 if (name) 5234 netdev_info(dev,
5239 printk(KERN_NOTICE "%s: Dropping NETIF_F_SG since no " 5235 "Dropping NETIF_F_SG since no checksum feature.\n");
5240 "checksum feature.\n", name);
5241 features &= ~NETIF_F_SG; 5236 features &= ~NETIF_F_SG;
5242 } 5237 }
5243 5238
5244 /* TSO requires that SG is present as well. */ 5239 /* TSO requires that SG is present as well. */
5245 if ((features & NETIF_F_TSO) && !(features & NETIF_F_SG)) { 5240 if ((features & NETIF_F_TSO) && !(features & NETIF_F_SG)) {
5246 if (name) 5241 netdev_info(dev, "Dropping NETIF_F_TSO since no SG feature.\n");
5247 printk(KERN_NOTICE "%s: Dropping NETIF_F_TSO since no "
5248 "SG feature.\n", name);
5249 features &= ~NETIF_F_TSO; 5242 features &= ~NETIF_F_TSO;
5250 } 5243 }
5251 5244
5245 /* UFO needs SG and checksumming */
5252 if (features & NETIF_F_UFO) { 5246 if (features & NETIF_F_UFO) {
5253 /* maybe split UFO into V4 and V6? */ 5247 /* maybe split UFO into V4 and V6? */
5254 if (!((features & NETIF_F_GEN_CSUM) || 5248 if (!((features & NETIF_F_GEN_CSUM) ||
5255 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM)) 5249 (features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))
5256 == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) { 5250 == (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))) {
5257 if (name) 5251 netdev_info(dev,
5258 printk(KERN_ERR "%s: Dropping NETIF_F_UFO " 5252 "Dropping NETIF_F_UFO since no checksum offload features.\n");
5259 "since no checksum offload features.\n",
5260 name);
5261 features &= ~NETIF_F_UFO; 5253 features &= ~NETIF_F_UFO;
5262 } 5254 }
5263 5255
5264 if (!(features & NETIF_F_SG)) { 5256 if (!(features & NETIF_F_SG)) {
5265 if (name) 5257 netdev_info(dev,
5266 printk(KERN_ERR "%s: Dropping NETIF_F_UFO " 5258 "Dropping NETIF_F_UFO since no NETIF_F_SG feature.\n");
5267 "since no NETIF_F_SG feature.\n", name);
5268 features &= ~NETIF_F_UFO; 5259 features &= ~NETIF_F_UFO;
5269 } 5260 }
5270 } 5261 }
@@ -5407,7 +5398,7 @@ int register_netdevice(struct net_device *dev)
5407 if (dev->iflink == -1) 5398 if (dev->iflink == -1)
5408 dev->iflink = dev->ifindex; 5399 dev->iflink = dev->ifindex;
5409 5400
5410 dev->features = netdev_fix_features(dev->features, dev->name); 5401 dev->features = netdev_fix_features(dev, dev->features);
5411 5402
5412 /* Enable software GSO if SG is supported. */ 5403 /* Enable software GSO if SG is supported. */
5413 if (dev->features & NETIF_F_SG) 5404 if (dev->features & NETIF_F_SG)