From e00afcf6427ab3b99c6ad0867c2a22bfe9ead180 Mon Sep 17 00:00:00 2001 From: Samuel Ghinet Date: Thu, 25 Sep 2014 21:20:25 +0000 Subject: datapath-windows: fix OVS_VPORT_TYPE The windows ovs kernel uses an OVS_VPORT_TYPE enum that is incompatible with the userspace counterpart (enum ovs_vport_type from openvswitch.h). We must use the same enum type for the netlink communication to work properly. This patch makes the fix: "typedef enum ovs_vport_type OVS_VPORT_TYPE" and changes the afferent kernel driver code: o) vport types synthetic and emulated turn to: netdev o) vport type internal turns to: internal o) vport type external truns to: netdev (plus, we hold a field in vport, "isExternal" Signed-off-by: Samuel Ghinet Acked-by: Nithin Raju Signed-off-by: Ben Pfaff --- datapath-windows/include/OvsDpInterfaceExt.h | 1 + datapath-windows/include/OvsPub.h | 25 +++++-------------------- 2 files changed, 6 insertions(+), 20 deletions(-) (limited to 'datapath-windows/include') diff --git a/datapath-windows/include/OvsDpInterfaceExt.h b/datapath-windows/include/OvsDpInterfaceExt.h index 64fd20e42..72b2e8e83 100644 --- a/datapath-windows/include/OvsDpInterfaceExt.h +++ b/datapath-windows/include/OvsDpInterfaceExt.h @@ -81,5 +81,6 @@ enum ovs_nl_mcast_attr { }; typedef struct ovs_dp_stats OVS_DP_STATS; +typedef enum ovs_vport_type OVS_VPORT_TYPE; #endif /* __OVS_DP_INTERFACE_EXT_H_ */ diff --git a/datapath-windows/include/OvsPub.h b/datapath-windows/include/OvsPub.h index 36814c482..ff0e8ce20 100644 --- a/datapath-windows/include/OvsPub.h +++ b/datapath-windows/include/OvsPub.h @@ -142,34 +142,19 @@ typedef struct _OVS_VPORT_GET { char name[OVS_MAX_PORT_NAME_LENGTH]; } OVS_VPORT_GET, *POVS_VPORT_GET; - -typedef enum { - OVSWIN_VPORT_TYPE_UNKNOWN, - OVSWIN_VPORT_TYPE_RESERVED, - OVSWIN_VPORT_TYPE_EXTERNAL, - OVSWIN_VPORT_TYPE_INTERNAL, - OVSWIN_VPORT_TYPE_SYNTHETIC, - OVSWIN_VPORT_TYPE_EMULATED, - OVSWIN_VPORT_TYPE_GRE, - OVSWIN_VPORT_TYPE_GRE64, - OVSWIN_VPORT_TYPE_VXLAN, - OVSWIN_VPORT_TYPE_LOCAL, /* For bridge local port. */ -} OVS_VPORT_TYPE; - static __inline const char * OvsVportTypeToStr(OVS_VPORT_TYPE t) { switch(t) { -#define STR(t) case OVSWIN_VPORT_TYPE_##t : return "VPORT_##t"; - STR(UNKNOWN) - STR(EXTERNAL) +#define STR(t) case OVS_VPORT_TYPE_##t : return "VPORT_##t"; + STR(UNSPEC) + STR(NETDEV) STR(INTERNAL) - STR(SYNTHETIC) - STR(EMULATED) STR(GRE) STR(GRE64) STR(VXLAN) - STR(LOCAL) + STR(GENEVE) + STR(LISP) } #undef STR -- cgit v1.2.1