Skip to content

Commit

Permalink
rhel: Enable ERSPAN features for RHEL 7.x
Browse files Browse the repository at this point in the history
Enable ERSPAN on RHEL 7.x

Signed-off-by: Greg Rose <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: William Tu <[email protected]>
  • Loading branch information
gvrose8192 authored and blp committed May 22, 2018
1 parent c5b38fa commit e1ededf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
15 changes: 14 additions & 1 deletion acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
[OVS_GREP_IFELSE([$KSRC/include/net/ip_tunnels.h],
[iptunnel_pull_offloads],
[OVS_GREP_IFELSE([$KSRC/include/net/dst_cache.h], [dst_cache],
[OVS_DEFINE([USE_UPSTREAM_TUNNEL])])])])
[OVS_GREP_IFELSE([$KSRC/include/net/erspan.h], [erspan_md2],
[OVS_DEFINE([USE_UPSTREAM_TUNNEL])])])])])
OVS_GREP_IFELSE([$KSRC/include/net/dst_cache.h], [dst_cache],
[OVS_DEFINE([USE_BUILTIN_DST_CACHE])])
Expand Down Expand Up @@ -866,6 +867,18 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
OVS_GREP_IFELSE([$KSRC/net/ipv4/gre_demux.c],
[parse_gre_header],
[OVS_DEFINE([HAVE_DEMUX_PARSE_GRE_HEADER])])
OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
[IFLA_GRE_ENCAP_DPORT])
OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
[IFLA_GRE_COLLECT_METADATA])
OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
[IFLA_GRE_IGNORE_DF])
OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
[IFLA_GRE_FWMARK])
OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
[IFLA_GRE_ERSPAN_INDEX])
OVS_GREP_IFELSE([$KSRC/include/uapi/linux/if_tunnel.h],
[IFLA_GRE_ERSPAN_HWID])
if cmp -s datapath/linux/kcompat.h.new \
datapath/linux/kcompat.h >/dev/null 2>&1; then
Expand Down
13 changes: 6 additions & 7 deletions datapath/linux/compat/ip6_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,30 +1693,29 @@ static void __net_exit ip6gre_exit_batch_net(struct list_head *net_list)
}

enum {
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
#ifndef HAVE_IFLA_GRE_ENCAP_DPORT
IFLA_GRE_ENCAP_TYPE = IFLA_GRE_FLAGS + 1,
IFLA_GRE_ENCAP_FLAGS,
IFLA_GRE_ENCAP_SPORT,
IFLA_GRE_ENCAP_DPORT,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
#ifndef HAVE_IFLA_GRE_COLLECT_METADATA
IFLA_GRE_COLLECT_METADATA = IFLA_GRE_ENCAP_DPORT + 1,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
#ifndef HAVE_IFLA_GRE_IGNORE_DF
IFLA_GRE_IGNORE_DF = IFLA_GRE_COLLECT_METADATA + 1,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
#ifndef HAVE_IFLA_GRE_FWMARK
IFLA_GRE_FWMARK = IFLA_GRE_IGNORE_DF + 1,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
#ifndef HAVE_IFLA_GRE_ERSPAN_INDEX
IFLA_GRE_ERSPAN_INDEX = IFLA_GRE_FWMARK + 1,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,16,0)
#ifndef HAVE_IFLA_GRE_ERSPAN_HWID
IFLA_GRE_ERSPAN_VER = IFLA_GRE_ERSPAN_INDEX + 1,
IFLA_GRE_ERSPAN_DIR,
IFLA_GRE_ERSPAN_HWID,
#endif

};

#define RPL_IFLA_GRE_MAX (IFLA_GRE_ERSPAN_HWID + 1)
Expand Down
12 changes: 6 additions & 6 deletions datapath/linux/compat/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,25 +814,25 @@ static int ipgre_tap_validate(struct nlattr *tb[], struct nlattr *data[])
}

enum {
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
#ifndef HAVE_IFLA_GRE_ENCAP_DPORT
IFLA_GRE_ENCAP_TYPE = IFLA_GRE_FLAGS + 1,
IFLA_GRE_ENCAP_FLAGS,
IFLA_GRE_ENCAP_SPORT,
IFLA_GRE_ENCAP_DPORT,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
#ifndef HAVE_IFLA_GRE_COLLECT_METADATA
IFLA_GRE_COLLECT_METADATA = IFLA_GRE_ENCAP_DPORT + 1,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
#ifndef HAVE_IFLA_GRE_IGNORE_DF
IFLA_GRE_IGNORE_DF = IFLA_GRE_COLLECT_METADATA + 1,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
#ifndef HAVE_IFLA_GRE_FWMARK
IFLA_GRE_FWMARK = IFLA_GRE_IGNORE_DF + 1,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
#ifndef HAVE_IFLA_GRE_ERSPAN_INDEX
IFLA_GRE_ERSPAN_INDEX = IFLA_GRE_FWMARK + 1,
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,16,0)
#ifndef HAVE_IFLA_GRE_ERSPAN_HWID
IFLA_GRE_ERSPAN_VER = IFLA_GRE_ERSPAN_INDEX + 1,
IFLA_GRE_ERSPAN_DIR,
IFLA_GRE_ERSPAN_HWID,
Expand Down

0 comments on commit e1ededf

Please sign in to comment.