[ovs-dev] gateway logic question (was: Re: [PATCH v2 1/5] ovsdb-idl: Redesign use of indexes.)

Guru Shetty guru at ovn.org
Tue Jun 12 16:39:46 UTC 2018


There are 2 types of gateways in OVN - a "gateway router" and a
"distributed gateway router port". The latter is where BFD is used and has
been mostly been maintained by the OpenStack folks. I am adding the
original authors for comment. I am not very familiar with the latter
implementation.

On 12 June 2018 at 08:23, Ben Pfaff <blp at ovn.org> wrote:

> Hi Guru, Han raised the following question while reading a patch of
> mine.  Will you give your opinion?
>
> On Mon, Jun 11, 2018 at 07:17:13PM -0700, Han Zhou wrote:
> > > +static struct ovs_list *
> > > +bfd_find_ha_gateway_chassis(
> > > +    struct ovsdb_idl_index *sbrec_port_binding_by_datapath,
> > > +    const struct chassis_index *chassis_index,
> > > +    const struct sbrec_datapath_binding *datapath)
> > > +{
> > > +    struct sbrec_port_binding *target =
> > sbrec_port_binding_index_init_row(
> > > +        sbrec_port_binding_by_datapath);
> > > +    sbrec_port_binding_index_set_datapath(target, datapath);
> > > +
> > > +    struct ovs_list *ha_gateway_chassis = NULL;
> > > +    const struct sbrec_port_binding *pb;
> > > +    SBREC_PORT_BINDING_FOR_EACH_EQUAL (pb, target,
> > > +                                       sbrec_port_binding_by_datapath)
> {
> > > +        if (strcmp(pb->type, "chassisredirect")) {
> > > +            continue;
> > > +        }
> > > +
> > > +        struct ovs_list *gateway_chassis =
> gateway_chassis_get_ordered(
> > > +            pb, chassis_index);
> > > +        if (!gateway_chassis || ovs_list_is_short(gateway_chassis)) {
> > > +            /* We don't need BFD for non-HA chassisredirect. */
> > > +            gateway_chassis_destroy(gateway_chassis);
> > > +            continue;
> > > +        }
> > > +
> > > +        ha_gateway_chassis = gateway_chassis;
> > > +        break;
> > > +    }
> > > +    sbrec_port_binding_index_destroy_row(target);
> > > +    return ha_gateway_chassis;
> > > +}
> >
> > This is a good refactoring and it is functionally equal to the original
> > one, but I wonder if there is a problem even with the original logic. It
> > breaks out whenever the first logical router port is found with multiple
> > gateways chassises, but what if there are still some other logical router
> > ports on the same logical router are gateway ports and on different
> > gateways, would those gateways be missed in the bfd sessions? (Of course,
> > it shouldn't belong to this patch even if it is a real problem.)
>
> Thanks,
>
> Ben.
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>


More information about the dev mailing list