From: Ethan Jackson Date: Thu, 19 May 2011 23:48:58 +0000 (-0700) Subject: bond: Remove useless slave->up flag. X-Git-Tag: v1.2.0~319 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c8544aa15f8811e9d6329d4a5e612ff7acb926c9;p=sliver-openvswitch.git bond: Remove useless slave->up flag. Theres no longer any reason not to simply call netdev_get_carrier(). --- diff --git a/lib/bond.c b/lib/bond.c index f5d0110ce..4e68fc865 100644 --- a/lib/bond.c +++ b/lib/bond.c @@ -63,7 +63,6 @@ struct bond_slave { /* Link status. */ long long delay_expires; /* Time after which 'enabled' may change. */ - bool up; /* Last link status read from netdev. */ bool enabled; /* May be chosen for flows? */ bool lacp_may_enable; /* LACP considers this interface bondable. */ tag_type tag; /* Tag associated with this slave. */ @@ -323,12 +322,11 @@ bond_slave_register(struct bond *bond, void *slave_, uint32_t stb_id, slave->bond = bond; slave->aux = slave_; slave->delay_expires = LLONG_MAX; - slave->up = netdev_get_carrier(netdev); slave->name = xstrdup(netdev_get_name(netdev)); bond->bond_revalidate = true; slave->enabled = false; - bond_enable_slave(slave, slave->up, NULL); + bond_enable_slave(slave, netdev_get_carrier(netdev), NULL); } if (slave->stb_id != stb_id) { @@ -419,11 +417,6 @@ bond_run(struct bond *bond, struct tag_set *tags, bool lacp_negotiated) bond->lacp_negotiated = lacp_negotiated; - /* Update link status. */ - HMAP_FOR_EACH (slave, hmap_node, &bond->slaves) { - slave->up = netdev_get_carrier(slave->netdev); - } - if (bond->monitor) { netdev_monitor_flush(bond->monitor); } @@ -1278,7 +1271,7 @@ bond_link_status_update(struct bond_slave *slave, struct tag_set *tags) struct bond *bond = slave->bond; bool up; - up = slave->up && slave->lacp_may_enable; + up = netdev_get_carrier(slave->netdev) && slave->lacp_may_enable; if ((up == slave->enabled) != (slave->delay_expires == LLONG_MAX)) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); VLOG_INFO_RL(&rl, "interface %s: link state %s",