From: Joe Stringer Date: Wed, 26 Feb 2014 21:22:35 +0000 (-0800) Subject: dpif-linux: Lookup netdev to get netdev type string. X-Git-Tag: v2.3~594 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=5ed512094a2f5534b031d2b3873262f870dc4083;p=cascardo%2Fovs.git dpif-linux: Lookup netdev to get netdev type string. When creating tap ports in dpif-linux, the "tap" type is treated the same as "system", and the type is discarded. When dumping datapath port types, this would cause "tap" type to be reported as a "system" type. Each time we see a port of the wrong type in bridge_reconfigure(), we remove it and add a port with the correct configuration. This would always occur for tap ports, causing deletion and re-creation of all tap ports each time the bridge was reconfigured. This patch makes dpif-linux use netdev to look up port types if the datapath reports that they are of type OVS_VPORT_TYPE_NETDEV. Bug #1196289. Reported-by: James Schmidt Signed-off-by: Joe Stringer Acked-by: Alex Wang Acked-by: Ben Pfaff --- diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index f7f529266..18de1184d 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -439,8 +439,11 @@ get_vport_type(const struct dpif_linux_vport *vport) static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20); switch (vport->type) { - case OVS_VPORT_TYPE_NETDEV: - return "system"; + case OVS_VPORT_TYPE_NETDEV: { + const char *type = netdev_get_type_from_name(vport->name); + + return type ? type : "system"; + } case OVS_VPORT_TYPE_INTERNAL: return "internal";