diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2012-02-10 15:32:32 +0100 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2012-02-27 09:04:13 -0500 |
commit | c4eefd753012467261cf221babd2e8639b81d3ca (patch) | |
tree | 0f6e09a6b51f410455330f046a8e03787d5a126e /recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.3/0073-bonding-fix-enslaving-in-alb-mode-when-link-down.patch | |
parent | 14f31c3c5a19dde049355ced3edd121c31842460 (diff) | |
download | meta-ti-c4eefd753012467261cf221babd2e8639b81d3ca.tar.gz |
linux-ti33x-psp 3.2: update to 3.2.5
Runtime tested on a beaglebone A3
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.3/0073-bonding-fix-enslaving-in-alb-mode-when-link-down.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.3/0073-bonding-fix-enslaving-in-alb-mode-when-link-down.patch | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.3/0073-bonding-fix-enslaving-in-alb-mode-when-link-down.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.3/0073-bonding-fix-enslaving-in-alb-mode-when-link-down.patch new file mode 100644 index 00000000..3c971940 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.3/0073-bonding-fix-enslaving-in-alb-mode-when-link-down.patch | |||
@@ -0,0 +1,116 @@ | |||
1 | From b0f214df7c16b27e302fb5740be5b1f4264e2235 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jiri Bohac <jbohac@suse.cz> | ||
3 | Date: Wed, 18 Jan 2012 12:24:54 +0000 | ||
4 | Subject: [PATCH 73/90] bonding: fix enslaving in alb mode when link down | ||
5 | |||
6 | [ Upstream commit b924551bed09f61b64f21bffe241afc5526b091a ] | ||
7 | |||
8 | bond_alb_init_slave() is called from bond_enslave() and sets the slave's MAC | ||
9 | address. This is done differently for TLB and ALB modes. | ||
10 | bond->alb_info.rlb_enabled is used to discriminate between the two modes but | ||
11 | this flag may be uninitialized if the slave is being enslaved prior to calling | ||
12 | bond_open() -> bond_alb_initialize() on the master. | ||
13 | |||
14 | It turns out all the callers of alb_set_slave_mac_addr() pass | ||
15 | bond->alb_info.rlb_enabled as the hw parameter. | ||
16 | |||
17 | This patch cleans up the unnecessary parameter of alb_set_slave_mac_addr() and | ||
18 | makes the function decide based on the bonding mode instead, which fixes the | ||
19 | above problem. | ||
20 | |||
21 | Reported-by: Narendra K <Narendra_K@Dell.com> | ||
22 | Signed-off-by: Jiri Bohac <jbohac@suse.cz> | ||
23 | Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> | ||
24 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
25 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
26 | --- | ||
27 | drivers/net/bonding/bond_alb.c | 27 +++++++++------------------ | ||
28 | 1 files changed, 9 insertions(+), 18 deletions(-) | ||
29 | |||
30 | diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c | ||
31 | index 106b88a..30431d8 100644 | ||
32 | --- a/drivers/net/bonding/bond_alb.c | ||
33 | +++ b/drivers/net/bonding/bond_alb.c | ||
34 | @@ -871,16 +871,12 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) | ||
35 | } | ||
36 | } | ||
37 | |||
38 | -/* hw is a boolean parameter that determines whether we should try and | ||
39 | - * set the hw address of the device as well as the hw address of the | ||
40 | - * net_device | ||
41 | - */ | ||
42 | -static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) | ||
43 | +static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[]) | ||
44 | { | ||
45 | struct net_device *dev = slave->dev; | ||
46 | struct sockaddr s_addr; | ||
47 | |||
48 | - if (!hw) { | ||
49 | + if (slave->bond->params.mode == BOND_MODE_TLB) { | ||
50 | memcpy(dev->dev_addr, addr, dev->addr_len); | ||
51 | return 0; | ||
52 | } | ||
53 | @@ -910,8 +906,8 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct | ||
54 | u8 tmp_mac_addr[ETH_ALEN]; | ||
55 | |||
56 | memcpy(tmp_mac_addr, slave1->dev->dev_addr, ETH_ALEN); | ||
57 | - alb_set_slave_mac_addr(slave1, slave2->dev->dev_addr, bond->alb_info.rlb_enabled); | ||
58 | - alb_set_slave_mac_addr(slave2, tmp_mac_addr, bond->alb_info.rlb_enabled); | ||
59 | + alb_set_slave_mac_addr(slave1, slave2->dev->dev_addr); | ||
60 | + alb_set_slave_mac_addr(slave2, tmp_mac_addr); | ||
61 | |||
62 | } | ||
63 | |||
64 | @@ -1058,8 +1054,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | ||
65 | |||
66 | /* Try setting slave mac to bond address and fall-through | ||
67 | to code handling that situation below... */ | ||
68 | - alb_set_slave_mac_addr(slave, bond->dev->dev_addr, | ||
69 | - bond->alb_info.rlb_enabled); | ||
70 | + alb_set_slave_mac_addr(slave, bond->dev->dev_addr); | ||
71 | } | ||
72 | |||
73 | /* The slave's address is equal to the address of the bond. | ||
74 | @@ -1095,8 +1090,7 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav | ||
75 | } | ||
76 | |||
77 | if (free_mac_slave) { | ||
78 | - alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, | ||
79 | - bond->alb_info.rlb_enabled); | ||
80 | + alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr); | ||
81 | |||
82 | pr_warning("%s: Warning: the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", | ||
83 | bond->dev->name, slave->dev->name, | ||
84 | @@ -1451,8 +1445,7 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave) | ||
85 | { | ||
86 | int res; | ||
87 | |||
88 | - res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr, | ||
89 | - bond->alb_info.rlb_enabled); | ||
90 | + res = alb_set_slave_mac_addr(slave, slave->perm_hwaddr); | ||
91 | if (res) { | ||
92 | return res; | ||
93 | } | ||
94 | @@ -1603,8 +1596,7 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave | ||
95 | alb_swap_mac_addr(bond, swap_slave, new_slave); | ||
96 | } else { | ||
97 | /* set the new_slave to the bond mac address */ | ||
98 | - alb_set_slave_mac_addr(new_slave, bond->dev->dev_addr, | ||
99 | - bond->alb_info.rlb_enabled); | ||
100 | + alb_set_slave_mac_addr(new_slave, bond->dev->dev_addr); | ||
101 | } | ||
102 | |||
103 | if (swap_slave) { | ||
104 | @@ -1664,8 +1656,7 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) | ||
105 | alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave); | ||
106 | alb_fasten_mac_swap(bond, swap_slave, bond->curr_active_slave); | ||
107 | } else { | ||
108 | - alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr, | ||
109 | - bond->alb_info.rlb_enabled); | ||
110 | + alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr); | ||
111 | |||
112 | read_lock(&bond->lock); | ||
113 | alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr); | ||
114 | -- | ||
115 | 1.7.7.4 | ||
116 | |||