diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-03-16 04:46:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-16 15:51:20 -0400 |
commit | 2d7011ca79f1a8792e04d131b8ea21db179ab917 (patch) | |
tree | 5c9c43a4d02c75b3c46e9fff94bb3f77c0607cd7 /drivers/net/bonding | |
parent | e30bc066ab67a4c8abcb972227ffe7c576f06a86 (diff) |
bonding: get rid of IFF_SLAVE_INACTIVE netdev->priv_flag
Since bond-related code was moved from net/core/dev.c into bonding,
IFF_SLAVE_INACTIVE is no longer needed. Replace is with flag "inactive"
stored in slave structure
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 6 | ||||
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 4 | ||||
-rw-r--r-- | drivers/net/bonding/bonding.h | 14 |
3 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a3ea44997a2a..04119b1e7cdb 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1461,7 +1461,7 @@ static bool bond_should_deliver_exact_match(struct sk_buff *skb, | |||
1461 | struct slave *slave, | 1461 | struct slave *slave, |
1462 | struct bonding *bond) | 1462 | struct bonding *bond) |
1463 | { | 1463 | { |
1464 | if (slave->dev->priv_flags & IFF_SLAVE_INACTIVE) { | 1464 | if (bond_is_slave_inactive(slave)) { |
1465 | if (slave_do_arp_validate(bond, slave) && | 1465 | if (slave_do_arp_validate(bond, slave) && |
1466 | skb->protocol == __cpu_to_be16(ETH_P_ARP)) | 1466 | skb->protocol == __cpu_to_be16(ETH_P_ARP)) |
1467 | return false; | 1467 | return false; |
@@ -2122,7 +2122,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
2122 | 2122 | ||
2123 | dev_set_mtu(slave_dev, slave->original_mtu); | 2123 | dev_set_mtu(slave_dev, slave->original_mtu); |
2124 | 2124 | ||
2125 | slave_dev->priv_flags &= ~(IFF_SLAVE_INACTIVE | IFF_BONDING); | 2125 | slave_dev->priv_flags &= ~IFF_BONDING; |
2126 | 2126 | ||
2127 | kfree(slave); | 2127 | kfree(slave); |
2128 | 2128 | ||
@@ -2233,8 +2233,6 @@ static int bond_release_all(struct net_device *bond_dev) | |||
2233 | dev_set_mac_address(slave_dev, &addr); | 2233 | dev_set_mac_address(slave_dev, &addr); |
2234 | } | 2234 | } |
2235 | 2235 | ||
2236 | slave_dev->priv_flags &= ~IFF_SLAVE_INACTIVE; | ||
2237 | |||
2238 | kfree(slave); | 2236 | kfree(slave); |
2239 | 2237 | ||
2240 | /* re-acquire the lock before getting the next slave */ | 2238 | /* re-acquire the lock before getting the next slave */ |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index c81b97cffaa3..de87aea6d01a 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1584,9 +1584,9 @@ static ssize_t bonding_store_slaves_active(struct device *d, | |||
1584 | bond_for_each_slave(bond, slave, i) { | 1584 | bond_for_each_slave(bond, slave, i) { |
1585 | if (!bond_is_active_slave(slave)) { | 1585 | if (!bond_is_active_slave(slave)) { |
1586 | if (new_value) | 1586 | if (new_value) |
1587 | slave->dev->priv_flags &= ~IFF_SLAVE_INACTIVE; | 1587 | slave->inactive = 0; |
1588 | else | 1588 | else |
1589 | slave->dev->priv_flags |= IFF_SLAVE_INACTIVE; | 1589 | slave->inactive = 1; |
1590 | } | 1590 | } |
1591 | } | 1591 | } |
1592 | out: | 1592 | out: |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 63e9cf779389..6b26962fd0ec 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -192,8 +192,9 @@ struct slave { | |||
192 | unsigned long last_arp_rx; | 192 | unsigned long last_arp_rx; |
193 | s8 link; /* one of BOND_LINK_XXXX */ | 193 | s8 link; /* one of BOND_LINK_XXXX */ |
194 | s8 new_link; | 194 | s8 new_link; |
195 | u8 backup; /* indicates backup slave. Value corresponds with | 195 | u8 backup:1, /* indicates backup slave. Value corresponds with |
196 | BOND_STATE_ACTIVE and BOND_STATE_BACKUP */ | 196 | BOND_STATE_ACTIVE and BOND_STATE_BACKUP */ |
197 | inactive:1; /* indicates inactive slave */ | ||
197 | u32 original_mtu; | 198 | u32 original_mtu; |
198 | u32 link_failure_count; | 199 | u32 link_failure_count; |
199 | u8 perm_hwaddr[ETH_ALEN]; | 200 | u8 perm_hwaddr[ETH_ALEN]; |
@@ -376,13 +377,18 @@ static inline void bond_set_slave_inactive_flags(struct slave *slave) | |||
376 | if (!bond_is_lb(bond)) | 377 | if (!bond_is_lb(bond)) |
377 | bond_set_backup_slave(slave); | 378 | bond_set_backup_slave(slave); |
378 | if (!bond->params.all_slaves_active) | 379 | if (!bond->params.all_slaves_active) |
379 | slave->dev->priv_flags |= IFF_SLAVE_INACTIVE; | 380 | slave->inactive = 1; |
380 | } | 381 | } |
381 | 382 | ||
382 | static inline void bond_set_slave_active_flags(struct slave *slave) | 383 | static inline void bond_set_slave_active_flags(struct slave *slave) |
383 | { | 384 | { |
384 | bond_set_active_slave(slave); | 385 | bond_set_active_slave(slave); |
385 | slave->dev->priv_flags &= ~IFF_SLAVE_INACTIVE; | 386 | slave->inactive = 0; |
387 | } | ||
388 | |||
389 | static inline bool bond_is_slave_inactive(struct slave *slave) | ||
390 | { | ||
391 | return slave->inactive; | ||
386 | } | 392 | } |
387 | 393 | ||
388 | struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr); | 394 | struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr); |