[ovs-dev] [PATCH v3] ovn: Check for known logical switch port types.

Lance Richardson lrichard at redhat.com
Tue Sep 5 18:45:10 UTC 2017


> From: "Mark Michelson" <mmichels at redhat.com>
> To: dev at openvswitch.org
> Sent: Friday, August 25, 2017 3:14:33 PM
> Subject: [ovs-dev] [PATCH v3] ovn: Check for known logical switch port types.
> 
> OVN is lenient with the types of logical switch ports. Maybe too
> lenient. This patch attempts to solve this problem on two fronts:
> 
> 1) In ovn-nbctl, if you attempt to set the port type to an unknown
> type, the command will not end up setting the type.
> 2) In northd, when copying the port type from the northbound database to
> the corresponding port-binding in the southbound database, a warning
> will be issued if the port is of an unknown type.
> 
> Signed-off-by: Mark Michelson <mmichels at redhat.com>
> ---
> v3:
>   * OVN_NB_LSP_TYPES declaration is static
>   * northd will not copy unknown port types to southbound DB
>   * re-ordered port types in OVN_NB_LSP_TYPES
> v2:
>   * Used ARRAY_SIZE to calculate length of OVN_NB_LSP_TYPES
> v1:
>   * Initial patch
> ---

Hi Mark,

This seems like a good enhancement to me. Changes look good, but they
currently cause a test case to fail (setting lsp type to "void"). I think
something like the following will be needed before this can be applied:

diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
index 9b9e42115..0d2711e3a 100644
--- a/tests/ovn-controller-vtep.at
+++ b/tests/ovn-controller-vtep.at
@@ -327,7 +327,7 @@ ${tunnel_key}
 
 # changes the ovn-nb logical port type so that it is no longer
 # vtep port.
-AT_CHECK([ovn-nbctl lsp-set-type br-vtep_lswitch0 void])
+AT_CHECK([ovn-nbctl lsp-set-type br-vtep_lswitch0 ""])
 OVS_WAIT_UNTIL([test -z "`vtep-ctl --columns=tunnel_key list Logical_Switch | grep 1`"])
 # now should see the tunnel key reset.
 AT_CHECK([vtep-ctl --columns=tunnel_key list Logical_Switch | cut -d ':' -f2 | tr -d ' '], [0], [dnl





More information about the dev mailing list