Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
authorDavid S. Miller <davem@davemloft.net>
Thu, 12 Nov 2015 19:17:16 +0000 (14:17 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Nov 2015 19:17:16 +0000 (14:17 -0500)
Pablo Neira Ayuso:

====================
Netfilter fixes for net

The following patchset contains Netfilter fixes for your net tree. This
large batch that includes fixes for ipset, netfilter ingress, nf_tables
dynamic set instantiation and a longstanding Kconfig dependency problem.
More specifically, they are:

1) Add missing check for empty hook list at the ingress hook, from
   Florian Westphal.

2) Input and output interface are swapped at the ingress hook,
   reported by Patrick McHardy.

3) Resolve ipset extension alignment issues on ARM, patch from Jozsef
   Kadlecsik.

4) Fix bit check on bitmap in ipset hash type, also from Jozsef.

5) Release buckets when all entries have expired in ipset hash type,
   again from Jozsef.

6) Oneliner to initialize conntrack tuple object in the PPTP helper,
   otherwise the conntrack lookup may fail due to random bits in the
   structure holes, patch from Anthony Lineham.

7) Silence a bogus gcc warning in nfnetlink_log, from Arnd Bergmann.

8) Fix Kconfig dependency problems with TPROXY, socket and dup, also
   from Arnd.

9) Add __netdev_alloc_pcpu_stats() to allow creating percpu counters
   from atomic context, this is required by the follow up fix for
   nf_tables.

10) Fix crash from the dynamic set expression, we have to add new clone
    operation that should be defined when a simple memcpy is not enough.
    This resolves a crash when using per-cpu counters with new Patrick
    McHardy's flow table nft support.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
1  2 
include/linux/netdevice.h

index d20891465247dfaa983225ce9336b14c91cb7fab,e9d0c8a75380c7af9322bbc78aa8d0ca8d27abe0..cc221b9676874fb2f138229a05c33f80a0791985
@@@ -718,8 -718,8 +718,8 @@@ struct xps_map 
        u16 queues[0];
  };
  #define XPS_MAP_SIZE(_num) (sizeof(struct xps_map) + ((_num) * sizeof(u16)))
 -#define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_map))  \
 -    / sizeof(u16))
 +#define XPS_MIN_MAP_ALLOC ((L1_CACHE_ALIGN(offsetof(struct xps_map, queues[1])) \
 +       - sizeof(struct xps_map)) / sizeof(u16))
  
  /*
   * This structure holds all XPS maps for device.  Maps are indexed by CPU.
@@@ -2068,20 -2068,23 +2068,23 @@@ struct pcpu_sw_netstats 
        struct u64_stats_sync   syncp;
  };
  
- #define netdev_alloc_pcpu_stats(type)                         \
- ({                                                            \
-       typeof(type) __percpu *pcpu_stats = alloc_percpu(type); \
-       if (pcpu_stats) {                                       \
-               int __cpu;                                      \
-               for_each_possible_cpu(__cpu) {                  \
-                       typeof(type) *stat;                     \
-                       stat = per_cpu_ptr(pcpu_stats, __cpu);  \
-                       u64_stats_init(&stat->syncp);           \
-               }                                               \
-       }                                                       \
-       pcpu_stats;                                             \
+ #define __netdev_alloc_pcpu_stats(type, gfp)                          \
+ ({                                                                    \
+       typeof(type) __percpu *pcpu_stats = alloc_percpu_gfp(type, gfp);\
+       if (pcpu_stats) {                                               \
+               int __cpu;                                              \
+               for_each_possible_cpu(__cpu) {                          \
+                       typeof(type) *stat;                             \
+                       stat = per_cpu_ptr(pcpu_stats, __cpu);          \
+                       u64_stats_init(&stat->syncp);                   \
+               }                                                       \
+       }                                                               \
+       pcpu_stats;                                                     \
  })
  
+ #define netdev_alloc_pcpu_stats(type)                                 \
+       __netdev_alloc_pcpu_stats(type, GFP_KERNEL);
  #include <linux/notifier.h>
  
  /* netdevice notifier chain. Please remember to update the rtnetlink