Dietmar Maurer | 11 Jun 2008 10:27

Bridge MAC selection

Hi all,

We provid a management plattform for virtual machines (pve.proxmox.com),
and 
use a bridge access the network.

Currently the system choose the lowest MAC for the purposes of STP 
and also assigns this MAC to the bridge. This is a problem because the 
Bridge MAC changes when we start/stop virtual machines - leading to 
Network outage for several seconds.

Using the first (insteasd of lowest) MAC would avoid the problem. So are

There any side effects with the following patch?

--- br_stp_if.c.org     2008-06-11 09:15:16.000000000 +0200
+++ br_stp_if.c 2008-06-11 09:44:53.000000000 +0200
 <at>  <at>  -217,10 +217,7  <at>  <at> 
        struct net_bridge_port *p;

        list_for_each_entry(p, &br->port_list, list) {
-               if (addr == br_mac_zero ||
-                   memcmp(p->dev->dev_addr, addr, ETH_ALEN) < 0)
-                       addr = p->dev->dev_addr;
-
+               addr = p->dev->dev_addr;
        }

        if (compare_ether_addr(br->bridge_id.addr, addr))
(Continue reading)

Stephen Hemminger | 11 Jun 2008 17:58
Favicon

Re: Bridge MAC selection

On Wed, 11 Jun 2008 10:27:54 +0200
"Dietmar Maurer" <dietmar <at> proxmox.com> wrote:

> Hi all,
> 
> We provid a management plattform for virtual machines (pve.proxmox.com),
> and 
> use a bridge access the network.
> 
> Currently the system choose the lowest MAC for the purposes of STP 
> and also assigns this MAC to the bridge. This is a problem because the 
> Bridge MAC changes when we start/stop virtual machines - leading to 
> Network outage for several seconds.
> 
> Using the first (insteasd of lowest) MAC would avoid the problem. So are
> 
> There any side effects with the following patch?

Not for you. But if it got changed now, it would surprise the existing
users (change in ABI behaviour).  

So if you need a particular mac address, you can set it with other tools
(ip or ifconfig).
Dietmar Maurer | 12 Jun 2008 06:51

Re: Bridge MAC selection

> > There any side effects with the following patch?
> 
> Not for you. But if it got changed now, it would surprise the 
> existing users (change in ABI behaviour).  
> 
> So if you need a particular mac address, you can set it with 
> other tools (ip or ifconfig).

You are right, I can set the Hw address with ifconfig - but 
any 'brctl addif' later resets the address, so that is simply not 
usable.

- Dietmar 
Patrick McHardy | 12 Jun 2008 12:29
Favicon

Re: Bridge MAC selection

Dietmar Maurer wrote:
>>> There any side effects with the following patch?
>> Not for you. But if it got changed now, it would surprise the 
>> existing users (change in ABI behaviour).  
>>
>> So if you need a particular mac address, you can set it with 
>> other tools (ip or ifconfig).
> 
> You are right, I can set the Hw address with ifconfig - but 
> any 'brctl addif' later resets the address, so that is simply not 
> usable.

Maybe add a persistent option to keep the manually configured
mac? Or simply disable this behaviour if a mac is configured
manually automatically. If someone does this, its probably
fair to assume he doesn't expect the address to change.
Dietmar Maurer | 12 Jun 2008 13:10

Re: Bridge MAC selection

>>> There any side effects with the following patch?
>> Not for you. But if it got changed now, it would surprise the 
>> existing users (change in ABI behaviour). 

If there are no other side effects, I wonder whats better:

A.) unexpected Network failures due to mac changes

B.) surprised users (does anybody depend on such behavour?)

I vote for A.)

- Dietmar
Andy Gospodarek | 12 Jun 2008 15:22
Gravatar

Re: Bridge MAC selection

On Thu, Jun 12, 2008 at 7:10 AM, Dietmar Maurer <dietmar <at> proxmox.com> wrote:
>>>> There any side effects with the following patch?
>>> Not for you. But if it got changed now, it would surprise the
>>> existing users (change in ABI behaviour).
>
> If there are no other side effects, I wonder whats better:
>
> A.) unexpected Network failures due to mac changes
>
> B.) surprised users (does anybody depend on such behavour?)
>
> I vote for A.)
>
> - Dietmar
>

You might think A is a better option, but option B is frowned upon.  I
understand you desire your change the behavior to meet your needs, but
Patrick's suggestion to add a module parameter to tweak this behavior
based on a module option is probably better than simply changing the
existing functionality to meet your needs.
Patrick McHardy | 12 Jun 2008 15:39
Favicon

Re: Bridge MAC selection

Andy Gospodarek wrote:
> On Thu, Jun 12, 2008 at 7:10 AM, Dietmar Maurer <dietmar <at> proxmox.com> wrote:
>>>>> There any side effects with the following patch?
>>>> Not for you. But if it got changed now, it would surprise the
>>>> existing users (change in ABI behaviour).
>> If there are no other side effects, I wonder whats better:
>>
>> A.) unexpected Network failures due to mac changes
>>
>> B.) surprised users (does anybody depend on such behavour?)
>>
>> I vote for A.)
>>
>> - Dietmar
>>
> 
> You might think A is a better option, but option B is frowned upon.  I
> understand you desire your change the behavior to meet your needs, but
> Patrick's suggestion to add a module parameter to tweak this behavior
> based on a module option is probably better than simply changing the
> existing functionality to meet your needs.

I actually meant a brctl parameter, module parameters suck as
configuration interfaces. But I think the second option is
better, just disable this behaviour automatically when the
address is configured manually.

Gmane