diff options
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_debugfs.c | 2 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 18 | ||||
-rw-r--r-- | drivers/net/bonding/bond_procfs.c | 15 | ||||
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 8 |
4 files changed, 31 insertions, 12 deletions
diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 3680aa251dea..2cf084eb9d52 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "bonding.h" | 6 | #include "bonding.h" |
7 | #include "bond_alb.h" | 7 | #include "bond_alb.h" |
8 | 8 | ||
9 | #ifdef CONFIG_DEBUG_FS | 9 | #if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_NET_NS) |
10 | 10 | ||
11 | #include <linux/debugfs.h> | 11 | #include <linux/debugfs.h> |
12 | #include <linux/seq_file.h> | 12 | #include <linux/seq_file.h> |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2ee8cf9e8a3b..2ee76993f052 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -76,6 +76,7 @@ | |||
76 | #include <net/route.h> | 76 | #include <net/route.h> |
77 | #include <net/net_namespace.h> | 77 | #include <net/net_namespace.h> |
78 | #include <net/netns/generic.h> | 78 | #include <net/netns/generic.h> |
79 | #include <net/pkt_sched.h> | ||
79 | #include "bonding.h" | 80 | #include "bonding.h" |
80 | #include "bond_3ad.h" | 81 | #include "bond_3ad.h" |
81 | #include "bond_alb.h" | 82 | #include "bond_alb.h" |
@@ -381,8 +382,6 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr) | |||
381 | return next; | 382 | return next; |
382 | } | 383 | } |
383 | 384 | ||
384 | #define bond_queue_mapping(skb) (*(u16 *)((skb)->cb)) | ||
385 | |||
386 | /** | 385 | /** |
387 | * bond_dev_queue_xmit - Prepare skb for xmit. | 386 | * bond_dev_queue_xmit - Prepare skb for xmit. |
388 | * | 387 | * |
@@ -395,7 +394,9 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, | |||
395 | { | 394 | { |
396 | skb->dev = slave_dev; | 395 | skb->dev = slave_dev; |
397 | 396 | ||
398 | skb->queue_mapping = bond_queue_mapping(skb); | 397 | BUILD_BUG_ON(sizeof(skb->queue_mapping) != |
398 | sizeof(qdisc_skb_cb(skb)->bond_queue_mapping)); | ||
399 | skb->queue_mapping = qdisc_skb_cb(skb)->bond_queue_mapping; | ||
399 | 400 | ||
400 | if (unlikely(netpoll_tx_running(slave_dev))) | 401 | if (unlikely(netpoll_tx_running(slave_dev))) |
401 | bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); | 402 | bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb); |
@@ -3226,6 +3227,12 @@ static int bond_master_netdev_event(unsigned long event, | |||
3226 | switch (event) { | 3227 | switch (event) { |
3227 | case NETDEV_CHANGENAME: | 3228 | case NETDEV_CHANGENAME: |
3228 | return bond_event_changename(event_bond); | 3229 | return bond_event_changename(event_bond); |
3230 | case NETDEV_UNREGISTER: | ||
3231 | bond_remove_proc_entry(event_bond); | ||
3232 | break; | ||
3233 | case NETDEV_REGISTER: | ||
3234 | bond_create_proc_entry(event_bond); | ||
3235 | break; | ||
3229 | default: | 3236 | default: |
3230 | break; | 3237 | break; |
3231 | } | 3238 | } |
@@ -4171,7 +4178,7 @@ static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
4171 | /* | 4178 | /* |
4172 | * Save the original txq to restore before passing to the driver | 4179 | * Save the original txq to restore before passing to the driver |
4173 | */ | 4180 | */ |
4174 | bond_queue_mapping(skb) = skb->queue_mapping; | 4181 | qdisc_skb_cb(skb)->bond_queue_mapping = skb->queue_mapping; |
4175 | 4182 | ||
4176 | if (unlikely(txq >= dev->real_num_tx_queues)) { | 4183 | if (unlikely(txq >= dev->real_num_tx_queues)) { |
4177 | do { | 4184 | do { |
@@ -4410,8 +4417,6 @@ static void bond_uninit(struct net_device *bond_dev) | |||
4410 | 4417 | ||
4411 | bond_work_cancel_all(bond); | 4418 | bond_work_cancel_all(bond); |
4412 | 4419 | ||
4413 | bond_remove_proc_entry(bond); | ||
4414 | |||
4415 | bond_debug_unregister(bond); | 4420 | bond_debug_unregister(bond); |
4416 | 4421 | ||
4417 | __hw_addr_flush(&bond->mc_list); | 4422 | __hw_addr_flush(&bond->mc_list); |
@@ -4813,7 +4818,6 @@ static int bond_init(struct net_device *bond_dev) | |||
4813 | 4818 | ||
4814 | bond_set_lockdep_class(bond_dev); | 4819 | bond_set_lockdep_class(bond_dev); |
4815 | 4820 | ||
4816 | bond_create_proc_entry(bond); | ||
4817 | list_add_tail(&bond->bond_list, &bn->dev_list); | 4821 | list_add_tail(&bond->bond_list, &bn->dev_list); |
4818 | 4822 | ||
4819 | bond_prepare_sysfs_group(bond); | 4823 | bond_prepare_sysfs_group(bond); |
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c index ad284baafe87..3cea38d37344 100644 --- a/drivers/net/bonding/bond_procfs.c +++ b/drivers/net/bonding/bond_procfs.c | |||
@@ -150,14 +150,25 @@ static void bond_info_show_master(struct seq_file *seq) | |||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | static const char *bond_slave_link_status(s8 link) | ||
154 | { | ||
155 | static const char * const status[] = { | ||
156 | [BOND_LINK_UP] = "up", | ||
157 | [BOND_LINK_FAIL] = "going down", | ||
158 | [BOND_LINK_DOWN] = "down", | ||
159 | [BOND_LINK_BACK] = "going back", | ||
160 | }; | ||
161 | |||
162 | return status[link]; | ||
163 | } | ||
164 | |||
153 | static void bond_info_show_slave(struct seq_file *seq, | 165 | static void bond_info_show_slave(struct seq_file *seq, |
154 | const struct slave *slave) | 166 | const struct slave *slave) |
155 | { | 167 | { |
156 | struct bonding *bond = seq->private; | 168 | struct bonding *bond = seq->private; |
157 | 169 | ||
158 | seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); | 170 | seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); |
159 | seq_printf(seq, "MII Status: %s\n", | 171 | seq_printf(seq, "MII Status: %s\n", bond_slave_link_status(slave->link)); |
160 | (slave->link == BOND_LINK_UP) ? "up" : "down"); | ||
161 | if (slave->speed == SPEED_UNKNOWN) | 172 | if (slave->speed == SPEED_UNKNOWN) |
162 | seq_printf(seq, "Speed: %s\n", "Unknown"); | 173 | seq_printf(seq, "Speed: %s\n", "Unknown"); |
163 | else | 174 | else |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index aef42f045320..485bedb8278c 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1082,8 +1082,12 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1082 | } | 1082 | } |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | pr_info("%s: Unable to set %.*s as primary slave.\n", | 1085 | strncpy(bond->params.primary, ifname, IFNAMSIZ); |
1086 | bond->dev->name, (int)strlen(buf) - 1, buf); | 1086 | bond->params.primary[IFNAMSIZ - 1] = 0; |
1087 | |||
1088 | pr_info("%s: Recording %s as primary, " | ||
1089 | "but it has not been enslaved to %s yet.\n", | ||
1090 | bond->dev->name, ifname, bond->dev->name); | ||
1087 | out: | 1091 | out: |
1088 | write_unlock_bh(&bond->curr_slave_lock); | 1092 | write_unlock_bh(&bond->curr_slave_lock); |
1089 | read_unlock(&bond->lock); | 1093 | read_unlock(&bond->lock); |