X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbond.c;h=bb5d49968b70186e389ff4b4cacff4c7aa0d9a21;hb=2c8fcc9cd6a7bbb948f6c79879e89c7ed791c9b1;hp=2b99b9acc5eb0c1a1f27503ceb33af62781324c8;hpb=ea131871e4c8793ff90f60cfb5f45947d6a2c10b;p=openvswitch diff --git a/lib/bond.c b/lib/bond.c index 2b99b9ac..bb5d4996 100644 --- a/lib/bond.c +++ b/lib/bond.c @@ -575,9 +575,10 @@ bond_check_admissibility(struct bond *bond, const void *slave_, } } - /* Drop all packets which arrive on backup slaves. This is similar to how - * Linux bonding handles active-backup bonds. */ - if (bond->balance == BM_AB) { + switch (bond->balance) { + case BM_AB: + /* Drop all packets which arrive on backup slaves. This is similar to + * how Linux bonding handles active-backup bonds. */ *tags |= bond_get_active_slave_tag(bond); if (bond->active_slave != slave) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); @@ -587,14 +588,27 @@ bond_check_admissibility(struct bond *bond, const void *slave_, slave->name, ETH_ADDR_ARGS(eth_dst)); return BV_DROP; } + return BV_ACCEPT; + + case BM_TCP: + /* TCP balancing has degraded to SLB (otherwise the + * bond->lacp_negotiated check above would have processed this). + * + * Fall through. */ + case BM_SLB: + /* Drop all packets for which we have learned a different input port, + * because we probably sent the packet on one slave and got it back on + * the other. Gratuitous ARP packets are an exception to this rule: + * the host has moved to another switch. The exception to the + * exception is if we locked the learning table to avoid reflections on + * bond slaves. */ + return BV_DROP_IF_MOVED; + + case BM_STABLE: + return BV_ACCEPT; } - /* Drop all packets for which we have learned a different input port, - * because we probably sent the packet on one slave and got it back on the - * other. Gratuitous ARP packets are an exception to this rule: the host - * has moved to another switch. The exception to the exception is if we - * locked the learning table to avoid reflections on bond slaves. */ - return BV_DROP_IF_MOVED; + NOT_REACHED(); } /* Returns the slave (registered on 'bond' by bond_slave_register()) to which @@ -987,11 +1001,7 @@ bond_unixctl_show(struct unixctl_conn *conn, ds_put_format(&ds, "\thash %d: %"PRIu64" kB load\n", hash, be->tx_bytes / 1024); - if (bond->balance != BM_SLB) { - continue; - } - - /* XXX How can we list the MACs assigned to hashes? */ + /* XXX How can we list the MACs assigned to hashes of SLB bonds? */ } } unixctl_command_reply(conn, 200, ds_cstr(&ds));