Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Nov 4, 2024
1 parent 8079885 commit 8c8f1ab
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions northd/northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -12406,6 +12406,8 @@ build_lrouter_bfd_flows(struct lflow_table *lflows, struct ovn_port *op,

struct ds ip_list = DS_EMPTY_INITIALIZER;
struct ds match = DS_EMPTY_INITIALIZER;
char *redirect_name = ovn_chassis_redirect_name(op->nbrp->name);
bool bfd_only = smap_get_bool(&op->nbrp->external_ids, "bfd_only", false);

if (op->lrp_networks.n_ipv4_addrs) {
op_put_v4_networks(&ip_list, op, false);
Expand All @@ -12424,6 +12426,21 @@ build_lrouter_bfd_flows(struct lflow_table *lflows, struct ovn_port *op,
meter_groups),
&op->nbrp->header_,
lflow_ref);
if ((op->nbrp->ha_chassis_group || op->nbrp->n_gateway_chassis) &&
bfd_only) {
ds_clear(&match);
ds_put_format(&match, "ip4.dst == %s && udp.dst == 3784 && "
"!is_chassis_resident(\"%s\")",
ds_cstr(&ip_list), redirect_name);
ovn_lflow_add_with_hint__(lflows, op->od, S_ROUTER_IN_IP_INPUT,
115, ds_cstr(&match),
"outport = \"%s\"; output;", NULL,
copp_meter_get(COPP_BFD,
op->od->nbr->copp,
meter_groups),
&op->nbrp->header_,
lflow_ref);
}
}
if (op->lrp_networks.n_ipv6_addrs) {
ds_clear(&ip_list);
Expand All @@ -12445,10 +12462,26 @@ build_lrouter_bfd_flows(struct lflow_table *lflows, struct ovn_port *op,
meter_groups),
&op->nbrp->header_,
lflow_ref);
if ((op->nbrp->ha_chassis_group || op->nbrp->n_gateway_chassis) &&
bfd_only) {
ds_clear(&match);
ds_put_format(&match, "ip6.dst == %s && udp.dst == 3784 && "
"!is_chassis_resident(\"%s\")",
ds_cstr(&ip_list), redirect_name);
ovn_lflow_add_with_hint__(lflows, op->od, S_ROUTER_IN_IP_INPUT,
115, ds_cstr(&match),
"outport = \"%s\"; output;", NULL,
copp_meter_get(COPP_BFD,
op->od->nbr->copp,
meter_groups),
&op->nbrp->header_,
lflow_ref);
}
}

ds_destroy(&ip_list);
ds_destroy(&match);
free(redirect_name);
}

/* Logical router ingress Table 0: L2 Admission Control
Expand Down

0 comments on commit 8c8f1ab

Please sign in to comment.