]> Pileus Git - ~andy/linux/commit
bonding: Convert miimon to new locking
authorJay Vosburgh <fubar@us.ibm.com>
Thu, 18 Oct 2007 00:37:48 +0000 (17:37 -0700)
committerJeff Garzik <jeff@garzik.org>
Wed, 24 Oct 2007 00:32:00 +0000 (20:32 -0400)
commit0b0eef66419e9abe6fd62bc958ab7cd0a18f858e
tree2b334288d26198e18df867b01c880320d7ba9f5f
parentcf5f9044934658dd3ffc628a60cd37c70f8168b1
bonding: Convert miimon to new locking

Convert mii (link state) monitor to acquire correct locks for
failover events.  In particular, failovers generally require RTNL at a low
level (when manipulating device MAC addresses, for example) and no other
locks.  The high level monitor is responsible for acquiring a known set
of locks, RTNL, the bond->lock for read and the slave_lock for write, and
the low level failover processing can then release appropriate locks as
needed.  This patch provides the high level portion.

As it is undesirable to acquire RTNL for every monitor pass (which
may occur as often as every 10 ms), the miimon has been converted to
do conditional locking.  A first pass inspects all slaves to determine
if any action is required, and if so, a second pass (after acquring RTNL)
is done to perform any actions (doing a complete rescan, as the situation
may have changed when all locks were released).

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/bonding/bond_main.c