diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/bonding/bond_alb.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/bonding/bond_alb.c')
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 9b5936f072dc..40fdc41446cc 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
23 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
24 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
25 | #include <linux/etherdevice.h> | 27 | #include <linux/etherdevice.h> |
@@ -201,8 +203,7 @@ static int tlb_initialize(struct bonding *bond) | |||
201 | 203 | ||
202 | new_hashtbl = kzalloc(size, GFP_KERNEL); | 204 | new_hashtbl = kzalloc(size, GFP_KERNEL); |
203 | if (!new_hashtbl) { | 205 | if (!new_hashtbl) { |
204 | pr_err(DRV_NAME | 206 | pr_err("%s: Error: Failed to allocate TLB hash table\n", |
205 | ": %s: Error: Failed to allocate TLB hash table\n", | ||
206 | bond->dev->name); | 207 | bond->dev->name); |
207 | return -1; | 208 | return -1; |
208 | } | 209 | } |
@@ -355,9 +356,6 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct | |||
355 | struct arp_pkt *arp = (struct arp_pkt *)skb->data; | 356 | struct arp_pkt *arp = (struct arp_pkt *)skb->data; |
356 | int res = NET_RX_DROP; | 357 | int res = NET_RX_DROP; |
357 | 358 | ||
358 | if (dev_net(bond_dev) != &init_net) | ||
359 | goto out; | ||
360 | |||
361 | while (bond_dev->priv_flags & IFF_802_1Q_VLAN) | 359 | while (bond_dev->priv_flags & IFF_802_1Q_VLAN) |
362 | bond_dev = vlan_dev_real_dev(bond_dev); | 360 | bond_dev = vlan_dev_real_dev(bond_dev); |
363 | 361 | ||
@@ -517,8 +515,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
517 | client_info->slave->dev->dev_addr, | 515 | client_info->slave->dev->dev_addr, |
518 | client_info->mac_dst); | 516 | client_info->mac_dst); |
519 | if (!skb) { | 517 | if (!skb) { |
520 | pr_err(DRV_NAME | 518 | pr_err("%s: Error: failed to create an ARP packet\n", |
521 | ": %s: Error: failed to create an ARP packet\n", | ||
522 | client_info->slave->dev->master->name); | 519 | client_info->slave->dev->master->name); |
523 | continue; | 520 | continue; |
524 | } | 521 | } |
@@ -528,8 +525,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) | |||
528 | if (client_info->tag) { | 525 | if (client_info->tag) { |
529 | skb = vlan_put_tag(skb, client_info->vlan_id); | 526 | skb = vlan_put_tag(skb, client_info->vlan_id); |
530 | if (!skb) { | 527 | if (!skb) { |
531 | pr_err(DRV_NAME | 528 | pr_err("%s: Error: failed to insert VLAN tag\n", |
532 | ": %s: Error: failed to insert VLAN tag\n", | ||
533 | client_info->slave->dev->master->name); | 529 | client_info->slave->dev->master->name); |
534 | continue; | 530 | continue; |
535 | } | 531 | } |
@@ -559,7 +555,7 @@ static void rlb_update_rx_clients(struct bonding *bond) | |||
559 | } | 555 | } |
560 | } | 556 | } |
561 | 557 | ||
562 | /* do not update the entries again untill this counter is zero so that | 558 | /* do not update the entries again until this counter is zero so that |
563 | * not to confuse the clients. | 559 | * not to confuse the clients. |
564 | */ | 560 | */ |
565 | bond_info->rlb_update_delay_counter = RLB_UPDATE_DELAY; | 561 | bond_info->rlb_update_delay_counter = RLB_UPDATE_DELAY; |
@@ -612,9 +608,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) | |||
612 | client_info = &(bond_info->rx_hashtbl[hash_index]); | 608 | client_info = &(bond_info->rx_hashtbl[hash_index]); |
613 | 609 | ||
614 | if (!client_info->slave) { | 610 | if (!client_info->slave) { |
615 | pr_err(DRV_NAME | 611 | pr_err("%s: Error: found a client with no channel in the client's hash table\n", |
616 | ": %s: Error: found a client with no channel in " | ||
617 | "the client's hash table\n", | ||
618 | bond->dev->name); | 612 | bond->dev->name); |
619 | continue; | 613 | continue; |
620 | } | 614 | } |
@@ -809,8 +803,7 @@ static int rlb_initialize(struct bonding *bond) | |||
809 | 803 | ||
810 | new_hashtbl = kmalloc(size, GFP_KERNEL); | 804 | new_hashtbl = kmalloc(size, GFP_KERNEL); |
811 | if (!new_hashtbl) { | 805 | if (!new_hashtbl) { |
812 | pr_err(DRV_NAME | 806 | pr_err("%s: Error: Failed to allocate RLB hash table\n", |
813 | ": %s: Error: Failed to allocate RLB hash table\n", | ||
814 | bond->dev->name); | 807 | bond->dev->name); |
815 | return -1; | 808 | return -1; |
816 | } | 809 | } |
@@ -931,8 +924,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) | |||
931 | 924 | ||
932 | skb = vlan_put_tag(skb, vlan->vlan_id); | 925 | skb = vlan_put_tag(skb, vlan->vlan_id); |
933 | if (!skb) { | 926 | if (!skb) { |
934 | pr_err(DRV_NAME | 927 | pr_err("%s: Error: failed to insert VLAN tag\n", |
935 | ": %s: Error: failed to insert VLAN tag\n", | ||
936 | bond->dev->name); | 928 | bond->dev->name); |
937 | continue; | 929 | continue; |
938 | } | 930 | } |
@@ -961,11 +953,8 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) | |||
961 | memcpy(s_addr.sa_data, addr, dev->addr_len); | 953 | memcpy(s_addr.sa_data, addr, dev->addr_len); |
962 | s_addr.sa_family = dev->type; | 954 | s_addr.sa_family = dev->type; |
963 | if (dev_set_mac_address(dev, &s_addr)) { | 955 | if (dev_set_mac_address(dev, &s_addr)) { |
964 | pr_err(DRV_NAME | 956 | pr_err("%s: Error: dev_set_mac_address of dev %s failed!\n" |
965 | ": %s: Error: dev_set_mac_address of dev %s failed! ALB " | 957 | "ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n", |
966 | "mode requires that the base driver support setting " | ||
967 | "the hw address also when the network device's " | ||
968 | "interface is open\n", | ||
969 | dev->master->name, dev->name); | 958 | dev->master->name, dev->name); |
970 | return -EOPNOTSUPP; | 959 | return -EOPNOTSUPP; |
971 | } | 960 | } |
@@ -1172,18 +1161,12 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | |||
1172 | alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, | 1161 | alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, |
1173 | bond->alb_info.rlb_enabled); | 1162 | bond->alb_info.rlb_enabled); |
1174 | 1163 | ||
1175 | pr_warning(DRV_NAME | 1164 | pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", |
1176 | ": %s: Warning: the hw address of slave %s is " | ||
1177 | "in use by the bond; giving it the hw address " | ||
1178 | "of %s\n", | ||
1179 | bond->dev->name, slave->dev->name, | 1165 | bond->dev->name, slave->dev->name, |
1180 | free_mac_slave->dev->name); | 1166 | free_mac_slave->dev->name); |
1181 | 1167 | ||
1182 | } else if (has_bond_addr) { | 1168 | } else if (has_bond_addr) { |
1183 | pr_err(DRV_NAME | 1169 | pr_err("%s: Error: the hw address of slave %s is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened)\n", |
1184 | ": %s: Error: the hw address of slave %s is in use by the " | ||
1185 | "bond; couldn't find a slave with a free hw address to " | ||
1186 | "give it (this should not have happened)\n", | ||
1187 | bond->dev->name, slave->dev->name); | 1170 | bond->dev->name, slave->dev->name); |
1188 | return -EFAULT; | 1171 | return -EFAULT; |
1189 | } | 1172 | } |