Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec...
authorDavid S. Miller <davem@davemloft.net>
Fri, 17 Feb 2017 02:25:49 +0000 (21:25 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Feb 2017 02:25:49 +0000 (21:25 -0500)
Steffen Klassert says:

====================
pull request (net-next): ipsec-next 2017-02-16

1) Make struct xfrm_input_afinfo const, nothing writes to it.
   From Florian Westphal.

2) Remove all places that write to the afinfo policy backend
   and make the struct const then.
   From Florian Westphal.

3) Prepare for packet consuming gro callbacks and add
   ESP GRO handlers. ESP packets can be decapsulated
   at the GRO layer then. It saves a round through
   the stack for each ESP packet.

Please note that this has a merge coflict between commit

63fca65d0863 ("net: add confirm_neigh method to dst_ops")

from net-next and

3d7d25a68ea5 ("xfrm: policy: remove garbage_collect callback")
a2817d8b279b ("xfrm: policy: remove family field")

from ipsec-next.

The conflict can be solved as it is done in linux-next.

Please pull or let me know if there are problems.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
1  2 
include/linux/netdevice.h
net/core/dev.c
net/ethernet/eth.c
net/ipv4/Kconfig
net/ipv6/Kconfig
net/xfrm/Kconfig
net/xfrm/xfrm_policy.c

Simple merge
diff --cc net/core/dev.c
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -4,8 -4,11 +4,12 @@@
  config XFRM
         bool
         depends on NET
 +       select GRO_CELLS
  
+ config XFRM_OFFLOAD
+        bool
+        depends on XFRM
  config XFRM_ALGO
        tristate
        select XFRM
@@@ -2856,32 -2843,15 +2843,32 @@@ static struct neighbour *xfrm_neigh_loo
        return dst->path->ops->neigh_lookup(dst, skb, daddr);
  }
  
- int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
 +static void xfrm_confirm_neigh(const struct dst_entry *dst, const void *daddr)
 +{
 +      const struct dst_entry *path = dst->path;
 +
 +      for (; dst != path; dst = dst->child) {
 +              const struct xfrm_state *xfrm = dst->xfrm;
 +
 +              if (xfrm->props.mode == XFRM_MODE_TRANSPORT)
 +                      continue;
 +              if (xfrm->type->flags & XFRM_TYPE_REMOTE_COADDR)
 +                      daddr = xfrm->coaddr;
 +              else if (!(xfrm->type->flags & XFRM_TYPE_LOCAL_COADDR))
 +                      daddr = &xfrm->id.daddr;
 +      }
 +      path->ops->confirm_neigh(path, daddr);
 +}
 +
+ int xfrm_policy_register_afinfo(const struct xfrm_policy_afinfo *afinfo, int family)
  {
        int err = 0;
-       if (unlikely(afinfo == NULL))
-               return -EINVAL;
-       if (unlikely(afinfo->family >= NPROTO))
+       if (WARN_ON(family >= ARRAY_SIZE(xfrm_policy_afinfo)))
                return -EAFNOSUPPORT;
        spin_lock(&xfrm_policy_afinfo_lock);
-       if (unlikely(xfrm_policy_afinfo[afinfo->family] != NULL))
+       if (unlikely(xfrm_policy_afinfo[family] != NULL))
                err = -EEXIST;
        else {
                struct dst_ops *dst_ops = afinfo->dst_ops;
                        dst_ops->link_failure = xfrm_link_failure;
                if (likely(dst_ops->neigh_lookup == NULL))
                        dst_ops->neigh_lookup = xfrm_neigh_lookup;
-               if (likely(afinfo->garbage_collect == NULL))
-                       afinfo->garbage_collect = xfrm_garbage_collect_deferred;
-               rcu_assign_pointer(xfrm_policy_afinfo[afinfo->family], afinfo);
 +              if (likely(!dst_ops->confirm_neigh))
 +                      dst_ops->confirm_neigh = xfrm_confirm_neigh;
+               rcu_assign_pointer(xfrm_policy_afinfo[family], afinfo);
        }
        spin_unlock(&xfrm_policy_afinfo_lock);