[ovs-dev] [PATCH ovn] ovn-northd: Clarify lsp's 'enabled' and 'up' column handling.

Justin Pettit jpettit at ovn.org
Fri Aug 9 18:03:07 UTC 2019


Signed-off-by: Justin Pettit <jpettit at ovn.org>
---
 northd/ovn-northd.c | 8 ++++++--
 ovn-nb.xml          | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index e6953a405..e86134414 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -3488,16 +3488,20 @@ build_port_security_ip(enum ovn_pipeline pipeline, struct ovn_port *op,
 
 }
 
+/* Returns true if the logical switch port 'enabled' column is empty or
+ * set to true.  Otherwise, returns false. */
 static bool
 lsp_is_enabled(const struct nbrec_logical_switch_port *lsp)
 {
-    return !lsp->enabled || *lsp->enabled;
+    return !lsp->n_enabled || *lsp->enabled;
 }
 
+/* Returns true only if the logical switch port 'up' column is set to true.
+ * Otherwise, if the column is not set or set to false, returns false. */
 static bool
 lsp_is_up(const struct nbrec_logical_switch_port *lsp)
 {
-    return lsp->up && *lsp->up;
+    return lsp->n_up && *lsp->up;
 }
 
 static bool
diff --git a/ovn-nb.xml b/ovn-nb.xml
index f5f10a5c1..e1661907d 100644
--- a/ovn-nb.xml
+++ b/ovn-nb.xml
@@ -730,6 +730,7 @@
           table="Binding"/> table, <code>ovn-northd</code> sets this
           column to <code>true</code>; otherwise, or if the port
           becomes unbound later, it sets it to <code>false</code>.
+          If this column is empty, the port is not considered up.
           This allows the CMS to wait for a VM's (or container's)
           networking to become active before it allows the VM (or
           container) to start.
-- 
2.17.1



More information about the dev mailing list