On Tue, May 24, 2022 at 6:41 PM Numan Siddique <num...@ovn.org> wrote:
> On Mon, May 23, 2022 at 4:46 AM Ales Musil <amu...@redhat.com> wrote: > > > > The localport should always delegate traffic locally, > > move the definition into consider_port_binding as > > the physical_run is not evaluated during I-P. > > > > Reported-at: https://bugzilla.redhat.com/2076604 > > Signed-off-by: Ales Musil <amu...@redhat.com> > > --- > > Hi Ales, > > Thanks for fixing these issues. I see that the BZ - > https://bugzilla.redhat.com/show_bug.cgi?id=2076604 > has a reproducer script. Is it possible to incorporate that as a test > case ? > > Thanks > Numan > Hi Numan, thank you for the review, added a test case in v2. Regards, Ales > > > controller/physical.c | 44 ++++++++++++++++++------------------------- > > 1 file changed, 18 insertions(+), 26 deletions(-) > > > > diff --git a/controller/physical.c b/controller/physical.c > > index 36f265a8c..773df0b77 100644 > > --- a/controller/physical.c > > +++ b/controller/physical.c > > @@ -1287,6 +1287,24 @@ consider_port_binding(struct ovsdb_idl_index > *sbrec_port_binding_by_name, > > } > > } > > > > + /* Table 37, priority 150. > > + * ======================= > > + * > > + * Handles packets received from ports of type "localport". > These > > + * ports are present on every hypervisor. Traffic that > originates at > > + * one should never go over a tunnel to a remote hypervisor, > > + * so resubmit them to table 38 for local delivery. */ > > + if (!strcmp(binding->type, "localport")) { > > + ofpbuf_clear(ofpacts_p); > > + put_resubmit(OFTABLE_LOCAL_OUTPUT, ofpacts_p); > > + match_init_catchall(&match); > > + match_set_reg(&match, MFF_LOG_INPORT - MFF_REG0, > > + binding->tunnel_key); > > + match_set_metadata(&match, > htonll(binding->datapath->tunnel_key)); > > + ofctrl_add_flow(flow_table, OFTABLE_REMOTE_OUTPUT, 150, > > + binding->header_.uuid.parts[0], &match, > > + ofpacts_p, &binding->header_.uuid); > > + } > > } else if (!tun && !is_ha_remote) { > > /* Remote port connected by localnet port */ > > /* Table 38, priority 100. > > @@ -1846,32 +1864,6 @@ physical_run(struct physical_ctx *p_ctx, > > ofctrl_add_flow(flow_table, OFTABLE_REMOTE_OUTPUT, 150, 0, > > &match, &ofpacts, hc_uuid); > > > > - /* Table 37, priority 150. > > - * ======================= > > - * > > - * Handles packets received from ports of type "localport". These > ports > > - * are present on every hypervisor. Traffic that originates at one > should > > - * never go over a tunnel to a remote hypervisor, so resubmit them > to table > > - * 38 for local delivery. */ > > - match_init_catchall(&match); > > - ofpbuf_clear(&ofpacts); > > - put_resubmit(OFTABLE_LOCAL_OUTPUT, &ofpacts); > > - const char *localport; > > - SSET_FOR_EACH (localport, p_ctx->local_lports) { > > - /* Iterate over all local logical ports and insert a drop > > - * rule with higher priority for every localport in this > > - * datapath. */ > > - const struct sbrec_port_binding *pb = lport_lookup_by_name( > > - p_ctx->sbrec_port_binding_by_name, localport); > > - if (pb && !strcmp(pb->type, "localport")) { > > - match_set_reg(&match, MFF_LOG_INPORT - MFF_REG0, > pb->tunnel_key); > > - match_set_metadata(&match, > htonll(pb->datapath->tunnel_key)); > > - ofctrl_add_flow(flow_table, OFTABLE_REMOTE_OUTPUT, 150, > > - pb->header_.uuid.parts[0], > > - &match, &ofpacts, hc_uuid); > > - } > > - } > > - > > /* Table 37, Priority 0. > > * ======================= > > * > > -- > > 2.35.1 > > > > _______________________________________________ > > dev mailing list > > d...@openvswitch.org > > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > > > > -- Ales Musil Senior Software Engineer - RHV Network Red Hat EMEA <https://www.redhat.com> amu...@redhat.com IM: amusil <https://red.ht/sig> _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev