aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2005-11-09 13:34:57 -0500
committerJohn W. Linville <linville@tuxdriver.com>2005-11-13 14:48:18 -0500
commit4e0952c74ee450ded86e8946ce58ea8dfd05b007 (patch)
tree07e10c7adaf8f95d11d5e2181e2adce30c47d3ba /drivers/net/bonding/bond_main.c
parentc2373ee98982a1c842dfb213c398f388d4227e63 (diff)
[PATCH] bonding: add bond name to all error messages
Add the bond name to all error messages so we can tell which one is complaining. Also reformats some error messages to be more consistent. Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Acked-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c89
1 files changed, 48 insertions, 41 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 94cec3cf2a13..7838522d5093 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -910,7 +910,7 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
910 res = bond_add_vlan(bond, vid); 910 res = bond_add_vlan(bond, vid);
911 if (res) { 911 if (res) {
912 printk(KERN_ERR DRV_NAME 912 printk(KERN_ERR DRV_NAME
913 ": %s: Failed to add vlan id %d\n", 913 ": %s: Error: Failed to add vlan id %d\n",
914 bond_dev->name, vid); 914 bond_dev->name, vid);
915 } 915 }
916} 916}
@@ -944,7 +944,7 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid)
944 res = bond_del_vlan(bond, vid); 944 res = bond_del_vlan(bond, vid);
945 if (res) { 945 if (res) {
946 printk(KERN_ERR DRV_NAME 946 printk(KERN_ERR DRV_NAME
947 ": %s: Failed to remove vlan id %d\n", 947 ": %s: Error: Failed to remove vlan id %d\n",
948 bond_dev->name, vid); 948 bond_dev->name, vid);
949 } 949 }
950} 950}
@@ -1644,8 +1644,8 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
1644 if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && 1644 if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL &&
1645 slave_dev->do_ioctl == NULL) { 1645 slave_dev->do_ioctl == NULL) {
1646 printk(KERN_WARNING DRV_NAME 1646 printk(KERN_WARNING DRV_NAME
1647 ": Warning : no link monitoring support for %s\n", 1647 ": %s: Warning: no link monitoring support for %s\n",
1648 slave_dev->name); 1648 bond_dev->name, slave_dev->name);
1649 } 1649 }
1650 1650
1651 /* bond must be initialized by bond_open() before enslaving */ 1651 /* bond must be initialized by bond_open() before enslaving */
@@ -1666,17 +1666,17 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
1666 dprintk("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name); 1666 dprintk("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name);
1667 if (!list_empty(&bond->vlan_list)) { 1667 if (!list_empty(&bond->vlan_list)) {
1668 printk(KERN_ERR DRV_NAME 1668 printk(KERN_ERR DRV_NAME
1669 ": Error: cannot enslave VLAN " 1669 ": %s: Error: cannot enslave VLAN "
1670 "challenged slave %s on VLAN enabled " 1670 "challenged slave %s on VLAN enabled "
1671 "bond %s\n", slave_dev->name, 1671 "bond %s\n", bond_dev->name, slave_dev->name,
1672 bond_dev->name); 1672 bond_dev->name);
1673 return -EPERM; 1673 return -EPERM;
1674 } else { 1674 } else {
1675 printk(KERN_WARNING DRV_NAME 1675 printk(KERN_WARNING DRV_NAME
1676 ": Warning: enslaved VLAN challenged " 1676 ": %s: Warning: enslaved VLAN challenged "
1677 "slave %s. Adding VLANs will be blocked as " 1677 "slave %s. Adding VLANs will be blocked as "
1678 "long as %s is part of bond %s\n", 1678 "long as %s is part of bond %s\n",
1679 slave_dev->name, slave_dev->name, 1679 bond_dev->name, slave_dev->name, slave_dev->name,
1680 bond_dev->name); 1680 bond_dev->name);
1681 bond_dev->features |= NETIF_F_VLAN_CHALLENGED; 1681 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
1682 } 1682 }
@@ -1706,12 +1706,11 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
1706 1706
1707 if (slave_dev->set_mac_address == NULL) { 1707 if (slave_dev->set_mac_address == NULL) {
1708 printk(KERN_ERR DRV_NAME 1708 printk(KERN_ERR DRV_NAME
1709 ": Error: The slave device you specified does " 1709 ": %s: Error: The slave device you specified does "
1710 "not support setting the MAC address.\n"); 1710 "not support setting the MAC address. "
1711 printk(KERN_ERR 1711 "Your kernel likely does not support slave "
1712 "Your kernel likely does not support slave devices.\n"); 1712 "devices.\n", bond_dev->name);
1713 1713 res = -EOPNOTSUPP;
1714 res = -EOPNOTSUPP;
1715 goto err_undo_flags; 1714 goto err_undo_flags;
1716 } 1715 }
1717 1716
@@ -1827,21 +1826,21 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
1827 * the messages for netif_carrier. 1826 * the messages for netif_carrier.
1828 */ 1827 */
1829 printk(KERN_WARNING DRV_NAME 1828 printk(KERN_WARNING DRV_NAME
1830 ": Warning: MII and ETHTOOL support not " 1829 ": %s: Warning: MII and ETHTOOL support not "
1831 "available for interface %s, and " 1830 "available for interface %s, and "
1832 "arp_interval/arp_ip_target module parameters " 1831 "arp_interval/arp_ip_target module parameters "
1833 "not specified, thus bonding will not detect " 1832 "not specified, thus bonding will not detect "
1834 "link failures! see bonding.txt for details.\n", 1833 "link failures! see bonding.txt for details.\n",
1835 slave_dev->name); 1834 bond_dev->name, slave_dev->name);
1836 } else if (link_reporting == -1) { 1835 } else if (link_reporting == -1) {
1837 /* unable get link status using mii/ethtool */ 1836 /* unable get link status using mii/ethtool */
1838 printk(KERN_WARNING DRV_NAME 1837 printk(KERN_WARNING DRV_NAME
1839 ": Warning: can't get link status from " 1838 ": %s: Warning: can't get link status from "
1840 "interface %s; the network driver associated " 1839 "interface %s; the network driver associated "
1841 "with this interface does not support MII or " 1840 "with this interface does not support MII or "
1842 "ETHTOOL link status reporting, thus miimon " 1841 "ETHTOOL link status reporting, thus miimon "
1843 "has no effect on this interface.\n", 1842 "has no effect on this interface.\n",
1844 slave_dev->name); 1843 bond_dev->name, slave_dev->name);
1845 } 1844 }
1846 } 1845 }
1847 1846
@@ -1868,15 +1867,15 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
1868 if (bond_update_speed_duplex(new_slave) && 1867 if (bond_update_speed_duplex(new_slave) &&
1869 (new_slave->link != BOND_LINK_DOWN)) { 1868 (new_slave->link != BOND_LINK_DOWN)) {
1870 printk(KERN_WARNING DRV_NAME 1869 printk(KERN_WARNING DRV_NAME
1871 ": Warning: failed to get speed and duplex from %s, " 1870 ": %s: Warning: failed to get speed and duplex from %s, "
1872 "assumed to be 100Mb/sec and Full.\n", 1871 "assumed to be 100Mb/sec and Full.\n",
1873 new_slave->dev->name); 1872 bond_dev->name, new_slave->dev->name);
1874 1873
1875 if (bond->params.mode == BOND_MODE_8023AD) { 1874 if (bond->params.mode == BOND_MODE_8023AD) {
1876 printk(KERN_WARNING 1875 printk(KERN_WARNING DRV_NAME
1877 "Operation of 802.3ad mode requires ETHTOOL " 1876 ": %s: Warning: Operation of 802.3ad mode requires ETHTOOL "
1878 "support in base driver for proper aggregator " 1877 "support in base driver for proper aggregator "
1879 "selection.\n"); 1878 "selection.\n", bond_dev->name);
1880 } 1879 }
1881 } 1880 }
1882 1881
@@ -2010,7 +2009,7 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
2010 if (!(slave_dev->flags & IFF_SLAVE) || 2009 if (!(slave_dev->flags & IFF_SLAVE) ||
2011 (slave_dev->master != bond_dev)) { 2010 (slave_dev->master != bond_dev)) {
2012 printk(KERN_ERR DRV_NAME 2011 printk(KERN_ERR DRV_NAME
2013 ": Error: %s: cannot release %s.\n", 2012 ": %s: Error: cannot release %s.\n",
2014 bond_dev->name, slave_dev->name); 2013 bond_dev->name, slave_dev->name);
2015 return -EINVAL; 2014 return -EINVAL;
2016 } 2015 }
@@ -2031,11 +2030,12 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
2031 ETH_ALEN); 2030 ETH_ALEN);
2032 if (!mac_addr_differ && (bond->slave_cnt > 1)) { 2031 if (!mac_addr_differ && (bond->slave_cnt > 1)) {
2033 printk(KERN_WARNING DRV_NAME 2032 printk(KERN_WARNING DRV_NAME
2034 ": Warning: the permanent HWaddr of %s " 2033 ": %s: Warning: the permanent HWaddr of %s "
2035 "- %02X:%02X:%02X:%02X:%02X:%02X - is " 2034 "- %02X:%02X:%02X:%02X:%02X:%02X - is "
2036 "still in use by %s. Set the HWaddr of " 2035 "still in use by %s. Set the HWaddr of "
2037 "%s to a different address to avoid " 2036 "%s to a different address to avoid "
2038 "conflicts.\n", 2037 "conflicts.\n",
2038 bond_dev->name,
2039 slave_dev->name, 2039 slave_dev->name,
2040 slave->perm_hwaddr[0], 2040 slave->perm_hwaddr[0],
2041 slave->perm_hwaddr[1], 2041 slave->perm_hwaddr[1],
@@ -2111,19 +2111,20 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
2111 bond_dev->features |= NETIF_F_VLAN_CHALLENGED; 2111 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
2112 } else { 2112 } else {
2113 printk(KERN_WARNING DRV_NAME 2113 printk(KERN_WARNING DRV_NAME
2114 ": Warning: clearing HW address of %s while it " 2114 ": %s: Warning: clearing HW address of %s while it "
2115 "still has VLANs.\n", 2115 "still has VLANs.\n",
2116 bond_dev->name); 2116 bond_dev->name, bond_dev->name);
2117 printk(KERN_WARNING DRV_NAME 2117 printk(KERN_WARNING DRV_NAME
2118 ": When re-adding slaves, make sure the bond's " 2118 ": %s: When re-adding slaves, make sure the bond's "
2119 "HW address matches its VLANs'.\n"); 2119 "HW address matches its VLANs'.\n",
2120 bond_dev->name);
2120 } 2121 }
2121 } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) && 2122 } else if ((bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
2122 !bond_has_challenged_slaves(bond)) { 2123 !bond_has_challenged_slaves(bond)) {
2123 printk(KERN_INFO DRV_NAME 2124 printk(KERN_INFO DRV_NAME
2124 ": last VLAN challenged slave %s " 2125 ": %s: last VLAN challenged slave %s "
2125 "left bond %s. VLAN blocking is removed\n", 2126 "left bond %s. VLAN blocking is removed\n",
2126 slave_dev->name, bond_dev->name); 2127 bond_dev->name, slave_dev->name, bond_dev->name);
2127 bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED; 2128 bond_dev->features &= ~NETIF_F_VLAN_CHALLENGED;
2128 } 2129 }
2129 2130
@@ -2274,12 +2275,13 @@ static int bond_release_all(struct net_device *bond_dev)
2274 bond_dev->features |= NETIF_F_VLAN_CHALLENGED; 2275 bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
2275 } else { 2276 } else {
2276 printk(KERN_WARNING DRV_NAME 2277 printk(KERN_WARNING DRV_NAME
2277 ": Warning: clearing HW address of %s while it " 2278 ": %s: Warning: clearing HW address of %s while it "
2278 "still has VLANs.\n", 2279 "still has VLANs.\n",
2279 bond_dev->name); 2280 bond_dev->name, bond_dev->name);
2280 printk(KERN_WARNING DRV_NAME 2281 printk(KERN_WARNING DRV_NAME
2281 ": When re-adding slaves, make sure the bond's " 2282 ": %s: When re-adding slaves, make sure the bond's "
2282 "HW address matches its VLANs'.\n"); 2283 "HW address matches its VLANs'.\n",
2284 bond_dev->name);
2283 } 2285 }
2284 2286
2285 printk(KERN_INFO DRV_NAME 2287 printk(KERN_INFO DRV_NAME
@@ -2596,8 +2598,11 @@ static void bond_mii_monitor(struct net_device *bond_dev)
2596 break; 2598 break;
2597 default: 2599 default:
2598 /* Should not happen */ 2600 /* Should not happen */
2599 printk(KERN_ERR "bonding: Error: %s Illegal value (link=%d)\n", 2601 printk(KERN_ERR DRV_NAME
2600 slave->dev->name, slave->link); 2602 ": %s: Error: %s Illegal value (link=%d)\n",
2603 bond_dev->name,
2604 slave->dev->name,
2605 slave->link);
2601 goto out; 2606 goto out;
2602 } /* end of switch (slave->link) */ 2607 } /* end of switch (slave->link) */
2603 2608
@@ -4397,8 +4402,9 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
4397 struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); 4402 struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
4398 if (!skb2) { 4403 if (!skb2) {
4399 printk(KERN_ERR DRV_NAME 4404 printk(KERN_ERR DRV_NAME
4400 ": Error: bond_xmit_broadcast(): " 4405 ": %s: Error: bond_xmit_broadcast(): "
4401 "skb_clone() failed\n"); 4406 "skb_clone() failed\n",
4407 bond_dev->name);
4402 continue; 4408 continue;
4403 } 4409 }
4404 4410
@@ -4467,7 +4473,8 @@ static inline void bond_set_mode_ops(struct bonding *bond, int mode)
4467 default: 4473 default:
4468 /* Should never happen, mode already checked */ 4474 /* Should never happen, mode already checked */
4469 printk(KERN_ERR DRV_NAME 4475 printk(KERN_ERR DRV_NAME
4470 ": Error: Unknown bonding mode %d\n", 4476 ": %s: Error: Unknown bonding mode %d\n",
4477 bond_dev->name,
4471 mode); 4478 mode);
4472 break; 4479 break;
4473 } 4480 }
@@ -4670,7 +4677,7 @@ static int bond_check_params(struct bond_params *params)
4670 if (max_bonds < 1 || max_bonds > INT_MAX) { 4677 if (max_bonds < 1 || max_bonds > INT_MAX) {
4671 printk(KERN_WARNING DRV_NAME 4678 printk(KERN_WARNING DRV_NAME
4672 ": Warning: max_bonds (%d) not in range %d-%d, so it " 4679 ": Warning: max_bonds (%d) not in range %d-%d, so it "
4673 "was reset to BOND_DEFAULT_MAX_BONDS (%d)", 4680 "was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
4674 max_bonds, 1, INT_MAX, BOND_DEFAULT_MAX_BONDS); 4681 max_bonds, 1, INT_MAX, BOND_DEFAULT_MAX_BONDS);
4675 max_bonds = BOND_DEFAULT_MAX_BONDS; 4682 max_bonds = BOND_DEFAULT_MAX_BONDS;
4676 } 4683 }