[ovs-dev] [RFC PATCH] vswitchd: warn about misconfigured interface type on netdev bridge

Eelco Chaudron echaudro at redhat.com
Tue Mar 19 09:23:30 UTC 2019


When debugging an issue we noticed that by accident someone has changes the
bridge datapath_type to netdev, where it's clearly a kernel (system bridge)
with physical and tap devices. Unfortunately, this is not something you
will easily spot, as the bridge datapath type value is not shown by default.

In addition, OVS is not warning you about this potential mismatch in
interface and bridge datapath.

I'm sending out this patch as an RFC as I could not find a clear
demarcation between bridge datapath types and interface datapath types.
The patch below will at least warn for netdev bridges with system
interfaces. But no warning will be given for some unsupported virtual
interfaces. For system bridges, the dpdk types will no be recognized as
system/virtual interfaces (unless the name exists) which will result in
an error.

Signed-off-by: Eelco Chaudron <echaudro at redhat.com>
---
 vswitchd/bridge.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index a427b0122..42c33d1d9 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1808,6 +1808,12 @@ iface_do_create(const struct bridge *br,
         goto error;
     }
 
+    if (!iface_is_internal(iface_cfg, br->cfg)
+        && !strcmp(br->type, "netdev")
+        && !strcmp(netdev_get_type(netdev), "system")) {
+        VLOG_WARN("bridge %s: interface %s is a system type where the bridge "
+                  "is a netdev one", br->name, iface_cfg->name);
+    }
     VLOG_INFO("bridge %s: added interface %s on port %d",
               br->name, iface_cfg->name, *ofp_portp);
 



More information about the dev mailing list