Message ID | 1544036152-27247-4-git-send-email-gvrose8192@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | datapath: Pull in upstream fixes and updates | expand |
Looks good to me, thanks Greg. Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> On Wed, Dec 5, 2018 at 10:58 AM Greg Rose <gvrose8192@gmail.com> wrote: > A new flags parameter has been added in 4.19 so add compat fixup. > > Signed-off-by: Greg Rose <gvrose8192@gmail.com> > --- > acinclude.m4 | 3 +++ > datapath/linux/compat/include/net/ip_tunnels.h | 16 +++++++++++++++- > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/acinclude.m4 b/acinclude.m4 > index ed83df4..92b4d6c 100644 > --- a/acinclude.m4 > +++ b/acinclude.m4 > @@ -897,6 +897,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ > [OVS_DEFINE([HAVE_VOID_NDO_GET_STATS64])]) > OVS_GREP_IFELSE([$KSRC/include/linux/timer.h], [init_timer_deferrable], > [OVS_DEFINE([HAVE_INIT_TIMER_DEFERRABLE])]) > + OVS_FIND_PARAM_IFELSE([$KSRC/include/net/ip_tunnels.h], > + [ip_tunnel_info_opts_set], [flags], > + > [OVS_DEFINE([HAVE_IP_TUNNEL_INFO_OPTS_SET_FLAGS])]) > > if cmp -s datapath/linux/kcompat.h.new \ > datapath/linux/kcompat.h >/dev/null 2>&1; then > diff --git a/datapath/linux/compat/include/net/ip_tunnels.h > b/datapath/linux/compat/include/net/ip_tunnels.h > index ce6fca4..dd90306 100644 > --- a/datapath/linux/compat/include/net/ip_tunnels.h > +++ b/datapath/linux/compat/include/net/ip_tunnels.h > @@ -13,7 +13,21 @@ > #define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000) > #endif > #define ovs_ip_tunnel_encap ip_tunnel_encap > -#else > + > +#ifndef HAVE_IP_TUNNEL_INFO_OPTS_SET_FLAGS > +static inline void rpl_ip_tunnel_info_opts_set(struct ip_tunnel_info > *info, > + const void *from, int len, > + __be16 flags) > +{ > + memcpy(ip_tunnel_info_opts(info), from, len); > + info->options_len = len; > + info->key.tun_flags |= flags; > +} > + > +#define ip_tunnel_info_opts_set rpl_ip_tunnel_info_opts_set > +#endif > + > +#else /* USE_UPSTREAM_TUNNEL */ > > #include <linux/if_tunnel.h> > #include <linux/types.h> > -- > 1.8.3.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
diff --git a/acinclude.m4 b/acinclude.m4 index ed83df4..92b4d6c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -897,6 +897,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ [OVS_DEFINE([HAVE_VOID_NDO_GET_STATS64])]) OVS_GREP_IFELSE([$KSRC/include/linux/timer.h], [init_timer_deferrable], [OVS_DEFINE([HAVE_INIT_TIMER_DEFERRABLE])]) + OVS_FIND_PARAM_IFELSE([$KSRC/include/net/ip_tunnels.h], + [ip_tunnel_info_opts_set], [flags], + [OVS_DEFINE([HAVE_IP_TUNNEL_INFO_OPTS_SET_FLAGS])]) if cmp -s datapath/linux/kcompat.h.new \ datapath/linux/kcompat.h >/dev/null 2>&1; then diff --git a/datapath/linux/compat/include/net/ip_tunnels.h b/datapath/linux/compat/include/net/ip_tunnels.h index ce6fca4..dd90306 100644 --- a/datapath/linux/compat/include/net/ip_tunnels.h +++ b/datapath/linux/compat/include/net/ip_tunnels.h @@ -13,7 +13,21 @@ #define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000) #endif #define ovs_ip_tunnel_encap ip_tunnel_encap -#else + +#ifndef HAVE_IP_TUNNEL_INFO_OPTS_SET_FLAGS +static inline void rpl_ip_tunnel_info_opts_set(struct ip_tunnel_info *info, + const void *from, int len, + __be16 flags) +{ + memcpy(ip_tunnel_info_opts(info), from, len); + info->options_len = len; + info->key.tun_flags |= flags; +} + +#define ip_tunnel_info_opts_set rpl_ip_tunnel_info_opts_set +#endif + +#else /* USE_UPSTREAM_TUNNEL */ #include <linux/if_tunnel.h> #include <linux/types.h>
A new flags parameter has been added in 4.19 so add compat fixup. Signed-off-by: Greg Rose <gvrose8192@gmail.com> --- acinclude.m4 | 3 +++ datapath/linux/compat/include/net/ip_tunnels.h | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-)