[ovs-dev] [bridge 06/15] bridge: Improve name and comments for bond_entry's "iface_tag" member.

Ethan Jackson ethan at nicira.com
Mon Mar 21 20:07:28 UTC 2011


Looks Fine.

On Mon, Mar 21, 2011 at 10:59 AM, Ben Pfaff <blp at nicira.com> wrote:
> 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 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 3140469..34c0e78 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");
>  }
>
> --
> 1.7.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list