[ovs-dev] [PATCH 23/23] ovn: Implement basic logical L3 routing.

Ben Pfaff blp at nicira.com
Fri Oct 16 21:08:04 UTC 2015


On Thu, Oct 15, 2015 at 11:49:13PM -0700, Han Zhou wrote:
> On Fri, Oct 9, 2015 at 9:21 PM, Ben Pfaff <blp at nicira.com> wrote:
> > +    /* Connect logical router ports, and logical switch ports of type "router",
> > +     * to their peers. */
> > +    struct ovn_port *op;
> > +    HMAP_FOR_EACH (op, key_node, ports) {
> 
> This seems not efficient. There are far more lswitch ports than router
> ports and patch ports. Would it be better to have a separate index to
> iterate routers ports and patch ports?

Yes, however this is a micro-optimization when in fact ovn-northd needs
a complete rewrite for scale.  The current structure is just there to
ensure that the generated logical flow tables actually work.  Sooner or
later, we'll rewrite the whole thing to regenerate the logical flow
tables incrementally as the northbound database changes.

> > +        /* ARP reply.  These flows reply to ARP requests for the router's own
> > +         * IP address. */
> > +        match = xasprintf(
> > +            "inport == %s && arp.tha == "ETH_ADDR_FMT" && arp.op == 1",
> > +            op->json_key, ETH_ADDR_ARGS(op->mac));
> 
> Should this be arp.tpa == "IP_FMT" ... ? Because I think we should
> match router's IP instead of MAC here.

Indeed you are right, thank you.  This is what happens when I'm in too
much of a hurry to write a proper test!

> After all this is amazing code. Thanks Ben!

Thanks!



More information about the dev mailing list