Skip to content

Commit

Permalink
controller: Set check_tnl_key for BFD on tunnel ifaces.
Browse files Browse the repository at this point in the history
The OVS BFD configuration option `check_tnl_key` controls whether
OVS should consider the tunnel key before processing BFD control
messages.  The OVN pipeline design ensures traffic originating
from a logical port will have a non-zero tunnel key.

Always set `check_tnl_key` to "true" to avoid processing of
BFD control messages originating from a logical port.

Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
  • Loading branch information
fnordahl authored and putnopvut committed Mar 11, 2024
1 parent 7af89a5 commit c966c35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions controller/bfd.c
Expand Up @@ -235,6 +235,9 @@ bfd_run(const struct ovsrec_interface_table *interface_table,
if (mult) {
smap_add(&bfd, "mult", mult);
}
/* `check_tnl_key` must always be set to "true" to avoid processing of
* BFD control messages originating from a logical port. */
smap_add(&bfd, "check_tnl_key", "true");
}

/* Enable or disable bfd */
Expand Down
6 changes: 3 additions & 3 deletions tests/ovn.at
Expand Up @@ -13638,15 +13638,15 @@ for chassis in gw1 hv1 hv2; do
echo "checking gw2 -> $chassis"
OVS_WAIT_UNTIL([
bfd_cfg=$(ovs-vsctl --bare --columns bfd find Interface name=ovn-$chassis-0)
test "$bfd_cfg" = "enable=true min_rx=2000"
test "$bfd_cfg" = "check_tnl_key=true enable=true min_rx=2000"
])
done
ovn-nbctl --wait=hv set NB_Global . options:"bfd-min-tx"=1500
for chassis in gw1 hv1 hv2; do
echo "checking gw2 -> $chassis"
OVS_WAIT_UNTIL([
bfd_cfg=$(ovs-vsctl --bare --columns bfd find Interface name=ovn-$chassis-0)
test "$bfd_cfg" = "enable=true min_rx=2000 min_tx=1500"
test "$bfd_cfg" = "check_tnl_key=true enable=true min_rx=2000 min_tx=1500"
])
done
ovn-nbctl remove NB_Global . options "bfd-min-rx"
Expand All @@ -13655,7 +13655,7 @@ for chassis in gw1 hv1 hv2; do
echo "checking gw2 -> $chassis"
OVS_WAIT_UNTIL([
bfd_cfg=$(ovs-vsctl --bare --columns bfd find Interface name=ovn-$chassis-0)
test "$bfd_cfg" = "enable=true min_tx=1500 mult=15"
test "$bfd_cfg" = "check_tnl_key=true enable=true min_tx=1500 mult=15"
])
done

Expand Down

0 comments on commit c966c35

Please sign in to comment.