@@ -290,8 +290,9 @@ enum ovs_vport_attr {
enum {
OVS_VXLAN_EXT_UNSPEC,
- OVS_VXLAN_EXT_GBP, /* Flag or __u32 */
- OVS_VXLAN_EXT_GPE = 8, /* Flag or __u32 */
+ OVS_VXLAN_EXT_GBP,
+ /* place new values here to fill gap. */
+ OVS_VXLAN_EXT_GPE = 8,
__OVS_VXLAN_EXT_MAX,
};
@@ -407,7 +407,8 @@ tunnel_supported_layers(const char *type,
return TNL_L3;
} else if (!strcmp(type, "gre")) {
return TNL_L2 | TNL_L3;
- } else if (!strcmp(type, "vxlan") && tnl_cfg->exts & OVS_VXLAN_EXT_GPE) {
+ } else if (!strcmp(type, "vxlan")
+ && tnl_cfg->exts & (1 << OVS_VXLAN_EXT_GPE)) {
return TNL_L2 | TNL_L3;
} else {
return TNL_L2;
@@ -545,8 +546,8 @@ set_tunnel_config(struct netdev *dev_, const struct smap *args, char **errp)
enum tunnel_layers layers = tunnel_supported_layers(type, &tnl_cfg);
const char *full_type = (strcmp(type, "vxlan") ? type
- : tnl_cfg.exts & OVS_VXLAN_EXT_GPE ? "VXLAN-GPE"
- : "VXLAN (without GPE");
+ : (tnl_cfg.exts & (1 << OVS_VXLAN_EXT_GPE)
+ ? "VXLAN-GPE" : "VXLAN (without GPE"));
const char *packet_type = smap_get(args, "packet_type");
if (!packet_type) {
tnl_cfg.pt_mode = default_pt_mode(layers);
Contrary to the comment by the enum value, these are actually regular enum values that need shifted. VXLAN_EXT_GBP for example is used as a netlink value for vports. Fixes: 875ab13020b1 ("userspace: Handling of versatile tunnel ports") Signed-off-by: Eric Garver <e@erig.me> --- datapath/linux/compat/include/linux/openvswitch.h | 5 +++-- lib/netdev-vport.c | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-)