bonding,vlan: propagate MAC failover changes to VLANs
Subsystems (3)
PATCH 1/1 bonding,vlan: propagate MAC failover changes to VLANs
With bonding's fail_over_mac=active, during failover the MAC
address of the bond itself changes to match that of the slave.
This patch adds a notifier call to cause VLANs stacked atop the
bonding to also change their MAC addresses to the new address when a failover occurs.
While it is legal for a VLAN to have a MAC address that differs
from the underlying device, at least one device (qeth) that requires the use of fail_over_mac for bonding cannot handle the VLAN's MAC differing from that of the bond; thus, it needs the MAC change to propagate up to any VLANs when fail_over_mac is set to active.
--- drivers/net/bonding/bond_main.c | 2 ++ include/linux/netdevice.h | 1 + net/8021q/vlan.c | 7 +++++++ 3 files changed, 10 insertions(+), 0 deletions(-)
drivers/net/bonding/bond_main.c +2 -0
@@ -896,6 +896,8 @@ static void bond_do_fail_over_mac(struct bonding *bond, new_active->dev->addr_len);write_unlock_bh (&bond->curr_slave_lock);read_unlock (&bond->lock); +call_netdevice_notifiers (NETDEV_PROPAGATE_ADDR , + bond->dev);call_netdevice_notifiers (NETDEV_CHANGEADDR , bond->dev);read_lock (&bond->lock);write_lock_bh (&bond->curr_slave_lock);
include/linux/netdevice.h +1 -0
@@ -1559,6 +1559,7 @@ struct packet_type {#define NETDEV_RELEASE 0x0012#define NETDEV_NOTIFY_PEERS 0x0013#define NETDEV_JOIN 0x0014 +#define NETDEV_PROPAGATE_ADDR 0x0015extern int register_netdevice_notifier (struct notifier_block *nb);extern int unregister_netdevice_notifier (struct notifier_block *nb);
net/8021q/vlan.c +7 -0
@@ -303,6 +303,8 @@ static void vlan_transfer_features(struct net_device *dev,static void __vlan_device_event (struct net_device *dev,unsigned long event) { +struct net_device *realdev; +switch (event) {case NETDEV_CHANGENAME :vlan_proc_rem_dev (dev);
@@ -317,6 +319,10 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event)case NETDEV_UNREGISTER :vlan_proc_rem_dev (dev);break ; +case NETDEV_PROPAGATE_ADDR : + realdev =vlan_dev_priv (dev)->real_dev; +memcpy (dev->dev_addr, realdev->dev_addr,ETH_ALEN ); +break ; } }
@@ -464,6 +470,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,case NETDEV_NOTIFY_PEERS :case NETDEV_BONDING_FAILOVER : +case NETDEV_PROPAGATE_ADDR :/* Propagate to vlan devices */ for (i =0 ; i <VLAN_N_VID ; i++) { vlandev =vlan_group_get_device (grp, i);
Signature · 1 line
1.7.7
Quoted 7 lines · Jay Vosburgh
With bonding's fail_over_mac=active, during failover the MAC
address of the bond itself changes to match that of the slave.This patch adds a notifier call to cause VLANs stacked atop the
bonding to also change their MAC addresses to the new address when a failover occurs.
Quoted 5 lines
While it is legal for a VLAN to have a MAC address that differs
from the underlying device, at least one device (qeth) that requires the use offail_over_macfor bonding cannot handle the VLAN's MAC differing from that of the bond; thus, it needs the MAC change to propagate up to any VLANs whenfail_over_macis set to active.
[...]
This doesn't make sense to me. You're applying the behaviour to all VLANs on top of a bond, whether or not the underlying device is driven by qeth, and ignoring any MAC address changes that don't involve the bonding driver.
I think either of these would be better fixes:
1. Make VLAN devices follow changes to the parent device's MAC address unless they are assigned an address of their own.
2. Add a configuration flag for VLAN devices to follow changes to the parent device's MAC address.
Ben.
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Quoted 13 lines · Ben Hutchings
Quoted 7 lines · Jay Vosburgh
With bonding's fail_over_mac=active, during failover the MAC
address of the bond itself changes to match that of the slave.This patch adds a notifier call to cause VLANs stacked atop the
bonding to also change their MAC addresses to the new address when a failover occurs.Quoted 5 lines
While it is legal for a VLAN to have a MAC address that differs
from the underlying device, at least one device (qeth) that requires the use offail_over_macfor bonding cannot handle the VLAN's MAC differing from that of the bond; thus, it needs the MAC change to propagate up to any VLANs whenfail_over_macis set to active.
Quoted 6 lines
[...]
This doesn't make sense to me. You're applying the behaviour to all VLANs on top of a bond, whether or not the underlying device is driven by qeth, and ignoring any MAC address changes that don't involve the bonding driver.
With the patch, the PROPAGATE event is only generated if bonding
is set for fail_over_mac=active, which is normally only enabled on those devices that require it (some devices for IBM's pseries and zseries architectures and Infiniband, which doesn't have VLANs).
Devices that do not use bonding's fail_over_mac will not have
VLANs following MAC changes.
Quoted 5 lines
I think either of these would be better fixes:
1. Make VLAN devices follow changes to the parent device's MAC address unless they are assigned an address of their own.
2. Add a configuration flag for VLAN devices to follow changes to the parent device's MAC address.
#1 would be a behavior change for all VLAN devices, which I
sought to avoid.
#2 would be an additional configuration option that would have
to be enabled just for this case (unless VLANs following MAC changes of the parent device is a generally desirable feature). The patch requires no additional option settings beyond what are currently in use.
-J
---
-Jay Vosburgh, IBM Linux Technology Center, [email protected]
Quoted 22 lines · Jay Vosburgh
Quoted 13 lines · Ben Hutchings
Quoted 7 lines · Jay Vosburgh
With bonding's fail_over_mac=active, during failover the MAC
address of the bond itself changes to match that of the slave.This patch adds a notifier call to cause VLANs stacked atop the
bonding to also change their MAC addresses to the new address when a failover occurs.Quoted 5 lines
While it is legal for a VLAN to have a MAC address that differs
from the underlying device, at least one device (qeth) that requires the use offail_over_macfor bonding cannot handle the VLAN's MAC differing from that of the bond; thus, it needs the MAC change to propagate up to any VLANs whenfail_over_macis set to active.Quoted 6 lines
[...]
This doesn't make sense to me. You're applying the behaviour to all VLANs on top of a bond, whether or not the underlying device is driven by qeth, and ignoring any MAC address changes that don't involve the bonding driver.
Quoted 4 lines
With the patch, the PROPAGATE event is only generated if bonding
is set for fail_over_mac=active, which is normally only enabled on those devices that require it (some devices for IBM's pseries and zseries architectures and Infiniband, which doesn't have VLANs).
Yeah, OK, that makes sense.
Quoted 2 lines
Devices that do not use bonding's
fail_over_macwill not have
VLANs following MAC changes.
I take it that the devices with this limitation on source MAC address have an essentially unchangeable MAC address? If they are limited to single address but it's changeable then they should be emitting this notification too.
Quoted 6 lines
Quoted 5 lines
I think either of these would be better fixes:
1. Make VLAN devices follow changes to the parent device's MAC address unless they are assigned an address of their own.
2. Add a configuration flag for VLAN devices to follow changes to the parent device's MAC address.
Quoted 6 lines
#1 would be a behavior change for all VLAN devices, which I
sought to avoid.#2 would be an additional configuration option that would have
to be enabled just for this case (unless VLANs following MAC changes of the parent device is a generally desirable feature).
I don't know whether it is generally desirable. My guess would be that unless a VLAN device is explicitly configured to use its own address then it is desirable.
Quoted 2 lines
The patch requires
no additional option settings beyond what are currently in use.
Right, I understand that this ought to Just Work, if possible.
Ben.
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Please do not apply this patch; we've found an alternate
solution that doesn't require this change.
Quoted 30 lines · Ben Hutchings
Quoted 22 lines · Jay Vosburgh
Quoted 13 lines · Ben Hutchings
Quoted 7 lines · Jay Vosburgh
With bonding's fail_over_mac=active, during failover the MAC
address of the bond itself changes to match that of the slave.This patch adds a notifier call to cause VLANs stacked atop the
bonding to also change their MAC addresses to the new address when a failover occurs.Quoted 5 lines
While it is legal for a VLAN to have a MAC address that differs
from the underlying device, at least one device (qeth) that requires the use offail_over_macfor bonding cannot handle the VLAN's MAC differing from that of the bond; thus, it needs the MAC change to propagate up to any VLANs whenfail_over_macis set to active.Quoted 6 lines
[...]
This doesn't make sense to me. You're applying the behaviour to all VLANs on top of a bond, whether or not the underlying device is driven by qeth, and ignoring any MAC address changes that don't involve the bonding driver.
Quoted 4 lines
With the patch, the PROPAGATE event is only generated if bonding
is set for fail_over_mac=active, which is normally only enabled on those devices that require it (some devices for IBM's pseries and zseries architectures and Infiniband, which doesn't have VLANs).Yeah, OK, that makes sense.
Quoted 7 lines
Quoted 2 lines
Devices that do not use bonding's
fail_over_macwill not have
VLANs following MAC changes.I take it that the devices with this limitation on source MAC address have an essentially unchangeable MAC address? If they are limited to single address but it's changeable then they should be emitting this notification too.
It's not that it can't change the MAC, the issue has to do with
the packet forwarding logic on the actual device that services the various virtual devices configured on the LPARs. This being s390, it's not quite that simple, but that's the short version.
Quoted 17 lines
Quoted 6 lines
Quoted 5 lines
I think either of these would be better fixes:
1. Make VLAN devices follow changes to the parent device's MAC address unless they are assigned an address of their own.
2. Add a configuration flag for VLAN devices to follow changes to the parent device's MAC address.Quoted 6 lines
#1 would be a behavior change for all VLAN devices, which I
sought to avoid.#2 would be an additional configuration option that would have
to be enabled just for this case (unless VLANs following MAC changes of the parent device is a generally desirable feature).I don't know whether it is generally desirable. My guess would be that unless a VLAN device is explicitly configured to use its own address then it is desirable.
Quoted 6 lines
Quoted 2 lines
The patch requires
no additional option settings beyond what are currently in use.Right, I understand that this ought to Just Work, if possible.
Ben.
-J
---
-Jay Vosburgh, IBM Linux Technology Center, [email protected]