netdev
[Top] [All Lists]

Re: [PATCH 2.6.12-rc2] bonding: partially back out dev_set_mac_address

To: fubar@xxxxxxxxxx (Jay Vosburgh)
Subject: Re: [PATCH 2.6.12-rc2] bonding: partially back out dev_set_mac_address
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 08 Apr 2005 22:36:28 +1000
Cc: davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx, jgarzik@xxxxxxxxx
In-reply-to: <200504072135.j37LZt4f004009@xxxxxxxxxxxxxxxxxxxxxx>
Organization: Core
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686))
Jay Vosburgh <fubar@xxxxxxxxxx> wrote:
> 
>        Yes, that works, and yes, the troublesome calls come from
> softirq (timers).  In that case, the rtnetlink patch would be:

This should work.

However, this is a bit of an eye sore as it is the only place
where rtmsg_ifinfo is called from softirq context.  In fact,
this is probably the only place where CHANGEADDR (and perhaps
even call_netdevice_notifiers) is called from softirq context.

It just so happens that all the CHANGEADDR handlers were coded to be
on the safe side and this seems to be the only place where it sleeps.

Nevertheless, I'd like to ask the possibility for bond to not do
this from softirq context.

I looked at bond_alb.c briefly and it appears that the MAC addresses
aren't actually set from the timers.  It is however set in user
context with spin locks held to guard against the timer.

I looked at one of those places: alb_handle_addr_collision_on_attach.
As far as I can see, there is no need for the address change to occur
under the write_lock.

It would work just as well if that function returned the MAC address
to be set and performed the actual setting after dropping the lock.

So if you have time, could you please comb through the bonding driver
and let us know if it is possible to move the setting of the MAC
address outside atomic areas.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<Prev in Thread] Current Thread [Next in Thread>