* [PATCH net-next-2.6 0/4] bonding: Four patches @ 2009-08-28 21:57 Jay Vosburgh 2009-08-28 21:57 ` [PATCH] bonding: propogate vlan_features to bonding master Jay Vosburgh 0 siblings, 1 reply; 5+ messages in thread From: Jay Vosburgh @ 2009-08-28 21:57 UTC (permalink / raw) To: netdev; +Cc: David Miller Four patches for bonding: Patch 1 adds the propogation of vlan_features from the slaves to the master device. Patch 2 replaces a cumbersome manual MAC address comparison with compare_ether_addr. Patch 3 removes a useless test against INT_MAX. Patch 4 modifies bond_check_dev_link to handle devices that leave carrier up even when adminstratively down. Due to lab machine adventures on my end, I was only able to compile test patches 2 - 4. Please apply for net-next-2.6. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] bonding: propogate vlan_features to bonding master 2009-08-28 21:57 [PATCH net-next-2.6 0/4] bonding: Four patches Jay Vosburgh @ 2009-08-28 21:57 ` Jay Vosburgh 2009-08-28 21:57 ` [PATCH] bonding: use compare_ether_addr Jay Vosburgh 0 siblings, 1 reply; 5+ messages in thread From: Jay Vosburgh @ 2009-08-28 21:57 UTC (permalink / raw) To: netdev; +Cc: David Miller, Or Gerlitz Propogate the vlan_features of the slave devices to the bonding master device, using the same logic as for regular features. Tested by Or Gerlitz <ogerlitz@voltaire.com>, who also removed the debug logic from the original test patch. Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> --- drivers/net/bonding/bond_main.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 4798d30..1aeb36c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1331,6 +1331,7 @@ static int bond_compute_features(struct bonding *bond) struct slave *slave; struct net_device *bond_dev = bond->dev; unsigned long features = bond_dev->features; + unsigned long vlan_features = 0; unsigned short max_hard_header_len = max((u16)ETH_HLEN, bond_dev->hard_header_len); int i; @@ -1343,10 +1344,14 @@ static int bond_compute_features(struct bonding *bond) features &= ~NETIF_F_ONE_FOR_ALL; + vlan_features = bond->first_slave->dev->vlan_features; bond_for_each_slave(bond, slave, i) { features = netdev_increment_features(features, slave->dev->features, NETIF_F_ONE_FOR_ALL); + vlan_features = netdev_increment_features(vlan_features, + slave->dev->vlan_features, + NETIF_F_ONE_FOR_ALL); if (slave->dev->hard_header_len > max_hard_header_len) max_hard_header_len = slave->dev->hard_header_len; } @@ -1354,6 +1359,7 @@ static int bond_compute_features(struct bonding *bond) done: features |= (bond_dev->features & BOND_VLAN_FEATURES); bond_dev->features = netdev_fix_features(features, NULL); + bond_dev->vlan_features = netdev_fix_features(vlan_features, NULL); bond_dev->hard_header_len = max_hard_header_len; return 0; -- 1.6.0.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] bonding: use compare_ether_addr 2009-08-28 21:57 ` [PATCH] bonding: propogate vlan_features to bonding master Jay Vosburgh @ 2009-08-28 21:57 ` Jay Vosburgh 2009-08-28 21:57 ` [PATCH] Fix useless test: int > INT_MAX Jay Vosburgh 0 siblings, 1 reply; 5+ messages in thread From: Jay Vosburgh @ 2009-08-28 21:57 UTC (permalink / raw) To: netdev; +Cc: David Miller, Stephen Hemminger From: Stephen Hemminger <shemminger@vyatta.com> Bonding can use compare_ether_addr() in bond_release. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> --- drivers/net/bonding/bond_main.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 1aeb36c..ed00ba9 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1796,7 +1796,6 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) struct bonding *bond = netdev_priv(bond_dev); struct slave *slave, *oldcurrent; struct sockaddr addr; - int mac_addr_differ; /* slave is not a slave or master is not master of this slave */ if (!(slave_dev->flags & IFF_SLAVE) || @@ -1820,9 +1819,8 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) } if (!bond->params.fail_over_mac) { - mac_addr_differ = memcmp(bond_dev->dev_addr, slave->perm_hwaddr, - ETH_ALEN); - if (!mac_addr_differ && (bond->slave_cnt > 1)) + if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) + && bond->slave_cnt > 1) pr_warning(DRV_NAME ": %s: Warning: the permanent HWaddr of %s - " "%pM - is still in use by %s. " -- 1.6.0.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] Fix useless test: int > INT_MAX 2009-08-28 21:57 ` [PATCH] bonding: use compare_ether_addr Jay Vosburgh @ 2009-08-28 21:57 ` Jay Vosburgh 2009-08-28 21:57 ` [PATCH] From: Petri Gynther <pgynther@google.com> Jay Vosburgh 0 siblings, 1 reply; 5+ messages in thread From: Jay Vosburgh @ 2009-08-28 21:57 UTC (permalink / raw) To: netdev; +Cc: David Miller, Nicolas de Pesloüan [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset=utf-8, Size: 887 bytes --] From: Nicolas de Pesloüan <nicolas.2p.debian@free.fr> max_bonds is of type int and cannot be greater than INT_MAX. Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> --- drivers/net/bonding/bond_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index ed00ba9..6b9f15b 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -4759,7 +4759,7 @@ static int bond_check_params(struct bond_params *params) params->ad_select = BOND_AD_STABLE; } - if (max_bonds < 0 || max_bonds > INT_MAX) { + if (max_bonds < 0) { pr_warning(DRV_NAME ": Warning: max_bonds (%d) not in range %d-%d, so it " "was reset to BOND_DEFAULT_MAX_BONDS (%d)\n", -- 1.6.0.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] From: Petri Gynther <pgynther@google.com> 2009-08-28 21:57 ` [PATCH] Fix useless test: int > INT_MAX Jay Vosburgh @ 2009-08-28 21:57 ` Jay Vosburgh 0 siblings, 0 replies; 5+ messages in thread From: Jay Vosburgh @ 2009-08-28 21:57 UTC (permalink / raw) To: netdev; +Cc: David Miller, Petri Gynther From: Petri Gynther <pgynther@google.com> bonding: Have bond_check_dev_link examine netif_running Some network devices do not call netif_carrier_off when they are set administratively down. Have the bonding link check function also inspect the netif_running state. Ignore netif_running if the bond_check_dev_link function is called with "reporting" set, as in that case it's inspecting the capabilities of the non-netif_carrier device driver. Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> --- drivers/net/bonding/bond_main.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6b9f15b..7c0e0bd 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -695,6 +695,9 @@ static int bond_check_dev_link(struct bonding *bond, struct ifreq ifr; struct mii_ioctl_data *mii; + if (!reporting && !netif_running(slave_dev)) + return 0; + if (bond->params.use_carrier) return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; -- 1.6.0.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-08-28 21:57 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-08-28 21:57 [PATCH net-next-2.6 0/4] bonding: Four patches Jay Vosburgh 2009-08-28 21:57 ` [PATCH] bonding: propogate vlan_features to bonding master Jay Vosburgh 2009-08-28 21:57 ` [PATCH] bonding: use compare_ether_addr Jay Vosburgh 2009-08-28 21:57 ` [PATCH] Fix useless test: int > INT_MAX Jay Vosburgh 2009-08-28 21:57 ` [PATCH] From: Petri Gynther <pgynther@google.com> Jay Vosburgh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox