On Wed, Nov 21, 2012 at 03:34:35AM -0800, Gurucharan Shetty wrote:
> Currently, the 'ofport' column in Interface table is
> ephemeral and is populated by vswitchd everytime it is
> started or when a new interface is created with vswitchd
> running.
> 
> Making it persistent lets vswitchd try and assign the
> same ofport number to a particular interface across
> restarts. This is just a fallback option when
> 'ofport_request' column is empty.
> 
> Signed-off-by: Gurucharan Shetty <[email protected]>

Looks good.

Personally I'd find the body of the following:

> +static int64_t
> +iface_pick_ofport(const struct ovsrec_interface *cfg)
> +{
> +    int64_t ofport = cfg->n_ofport ? *cfg->ofport : OFPP_NONE;
> +    return cfg->n_ofport_request ? *cfg->ofport_request : ofport;
> +}

more straightforward as:

    return (cfg->n_ofport_request ? *cfg->ofport_request
            : cfg->n_ofport ? *cfg->ofport
            : OFPP_NONE);

but I also understand the code in the form you wrote it.

Thanks,

Ben.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to