From c0cb6f59f51ceb1c16e38b050bb8c3345ba984c0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 17 Mar 2011 16:29:55 -0700 Subject: [PATCH] bridge: Improve name and comments for bond_entry's "iface_tag" member. The iface_tag name and comment implied that it was really just a copy of the 'tag' member of struct iface, but in fact it has a completely different purpose: it represents the binding of a bond_entry to a particular iface. It is invalidated when the bond_entry has to be redirected to a different iface, not when the iface itself changes. I hope that this commit helps to clarify. --- vswitchd/bridge.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 3140469f..34c0e78f 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -122,7 +122,7 @@ struct iface { struct bond_entry { int iface_idx; /* Index of assigned iface, or -1 if none. */ uint64_t tx_bytes; /* Count of bytes recently transmitted. */ - tag_type iface_tag; /* Tag associated with iface_idx. */ + tag_type tag; /* Tag for bond_entry<->iface association. */ }; enum bond_mode { @@ -2237,9 +2237,9 @@ choose_output_iface(const struct port *port, const struct flow *flow, return false; } e->iface_idx = iface->port_ifidx; - e->iface_tag = tag_create_random(); + e->tag = tag_create_random(); } - *tags |= e->iface_tag; + *tags |= e->tag; iface = port->ifaces[e->iface_idx]; } *dp_ifidx = iface->dp_ifidx; @@ -3234,9 +3234,9 @@ bond_shift_load(struct slave_balance *from, struct slave_balance *to, to->tx_bytes += delta; /* Arrange for flows to be revalidated. */ - ofproto_revalidate(port->bridge->ofproto, hash->iface_tag); + ofproto_revalidate(port->bridge->ofproto, hash->tag); hash->iface_idx = to->iface->port_ifidx; - hash->iface_tag = tag_create_random(); + hash->tag = tag_create_random(); } static void @@ -3652,9 +3652,9 @@ bond_unixctl_migrate(struct unixctl_conn *conn, const char *args_, } entry = &port->bond_hash[hash]; - ofproto_revalidate(port->bridge->ofproto, entry->iface_tag); + ofproto_revalidate(port->bridge->ofproto, entry->tag); entry->iface_idx = iface->port_ifidx; - entry->iface_tag = tag_create_random(); + entry->tag = tag_create_random(); unixctl_command_reply(conn, 200, "migrated"); } -- 2.30.2