Skip to content

Commit

Permalink
controller: Properly handle localnet flows in I+P.
Browse files Browse the repository at this point in the history
Delete flows on localnet port deletion, and add localnet
related flows when peer ports are added. This was properly done when
recomputing, but not when doing IP.

When peer ports are added, some flows such as chassis_mac flows
must be added.

Fixes: edc064b ("controller: Properly handle localnet flows in I+P.")
Fixes: d276728 ("Revert "controller: Properly handle localnet flows in I+P.".")

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
Acked-by: Ales Musil <amusil@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
(cherry picked from commit 6d13bb2)
(cherry picked from commit c0d27b8)
  • Loading branch information
simonartxavier authored and numansiddique committed Dec 20, 2024
1 parent 21e14f6 commit 68241f1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions controller/physical.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,14 +698,15 @@ put_replace_chassis_mac_flows(const struct simap *ct_zones,
put_resubmit(OFTABLE_LOG_INGRESS_PIPELINE, ofpacts_p);
ofctrl_add_flow(flow_table, OFTABLE_PHY_TO_LOG, 180,
rport_binding->header_.uuid.parts[0],
&match, ofpacts_p, hc_uuid);
&match, ofpacts_p, &localnet_port->header_.uuid);

/* Provide second search criteria, i.e localnet port's
* vlan ID for conjunction flow */
struct ofpact_conjunction *conj;
ofpbuf_clear(ofpacts_p);
match_init_catchall(&match);

match_set_in_port(&match, ofport);
if (tag) {
match_set_dl_vlan(&match, htons(tag), 0);
} else {
Expand All @@ -718,7 +719,7 @@ put_replace_chassis_mac_flows(const struct simap *ct_zones,
conj->clause = 1;
ofctrl_add_flow(flow_table, OFTABLE_PHY_TO_LOG, 180,
rport_binding->header_.uuid.parts[0],
&match, ofpacts_p, hc_uuid);
&match, ofpacts_p, &localnet_port->header_.uuid);
}
}

Expand Down Expand Up @@ -2362,8 +2363,9 @@ physical_handle_flows_for_lport(const struct sbrec_port_binding *pb,
struct local_datapath *ldp =
get_local_datapath(p_ctx->local_datapaths,
pb->datapath->tunnel_key);
if (!strcmp(pb->type, "external")) {
/* External lports have a dependency on the localnet port.
if (!strcmp(pb->type, "external") ||
!strcmp(pb->type, "patch") || !strcmp(pb->type, "l3gateway")) {
/* Those lports have a dependency on the localnet port.
* We need to remove the flows of the localnet port as well
* and re-consider adding the flows for it.
*/
Expand Down

0 comments on commit 68241f1

Please sign in to comment.