You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.7 KiB

  1. From 2dec526496a62c3aaf849f24ec1b5983a91827a9 Mon Sep 17 00:00:00 2001
  2. From: Greg Rose <gvrose8192@gmail.com>
  3. Date: Mon, 6 Jan 2020 13:36:34 -0800
  4. Subject: [PATCH] compat: Include confirm_neigh parameter if needed
  5. A change backported to the Linux 4.14.162 LTS kernel requires
  6. a boolean parameter. Check for the presence of the parameter
  7. and adjust the caller in that case.
  8. Passes check-kmod test with no regressions.
  9. Passes Travis build here:
  10. https://travis-ci.org/gvrose8192/ovs-experimental/builds/633461320
  11. Signed-off-by: Greg Rose <gvrose8192@gmail.com>
  12. Signed-off-by: Simon Horman <simon.horman@netronome.com>
  13. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  14. (fix acinclude.m4 patch conflict)
  15. ---
  16. acinclude.m4 | 2 ++
  17. datapath/linux/compat/ip6_gre.c | 4 ++++
  18. datapath/linux/compat/ip_tunnel.c | 5 +++++
  19. 3 files changed, 11 insertions(+)
  20. diff --git a/acinclude.m4 b/acinclude.m4
  21. index a581e1ef2..ec1f027e9 100644
  22. --- a/acinclude.m4
  23. +++ b/acinclude.m4
  24. @@ -1005,6 +1005,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
  25. [OVS_DEFINE([HAVE_GRE_CALC_HLEN])])
  26. OVS_GREP_IFELSE([$KSRC/include/net/gre.h], [ip_gre_calc_hlen],
  27. [OVS_DEFINE([HAVE_IP_GRE_CALC_HLEN])])
  28. + OVS_GREP_IFELSE([$KSRC/include/net/dst_ops.h], [bool confirm_neigh],
  29. + [OVS_DEFINE([HAVE_DST_OPS_CONFIRM_NEIGH])])
  30. if cmp -s datapath/linux/kcompat.h.new \
  31. datapath/linux/kcompat.h >/dev/null 2>&1; then
  32. diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
  33. index afff817ec..7fd345309 100644
  34. --- a/datapath/linux/compat/ip6_gre.c
  35. +++ b/datapath/linux/compat/ip6_gre.c
  36. @@ -1089,7 +1089,11 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
  37. /* TooBig packet may have updated dst->dev's mtu */
  38. if (!t->parms.collect_md && dst && dst_mtu(dst) > dst->dev->mtu)
  39. +#ifndef HAVE_DST_OPS_CONFIRM_NEIGH
  40. dst->ops->update_pmtu(dst, NULL, skb, dst->dev->mtu);
  41. +#else
  42. + dst->ops->update_pmtu(dst, NULL, skb, dst->dev->mtu, false);
  43. +#endif
  44. err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu,
  45. NEXTHDR_GRE);
  46. diff --git a/datapath/linux/compat/ip_tunnel.c b/datapath/linux/compat/ip_tunnel.c
  47. index 7dd57fee9..e7a039358 100644
  48. --- a/datapath/linux/compat/ip_tunnel.c
  49. +++ b/datapath/linux/compat/ip_tunnel.c
  50. @@ -267,7 +267,12 @@ static int rpl_tnl_update_pmtu(struct net_device *dev, struct sk_buff *skb,
  51. mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
  52. if (skb_valid_dst(skb))
  53. +#ifndef HAVE_DST_OPS_CONFIRM_NEIGH
  54. skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu);
  55. +#else
  56. + skb_dst(skb)->ops->update_pmtu(skb_dst(skb),
  57. + NULL, skb, mtu, false);
  58. +#endif
  59. if (skb->protocol == htons(ETH_P_IP)) {
  60. if (!skb_is_gso(skb) &&