netfilter: nft_set_pipapo: store index in scratch maps
[platform/kernel/linux-rpi.git] / net / netfilter / nft_set_pipapo.h
index 2e164a3..75b1340 100644 (file)
@@ -131,6 +131,16 @@ struct nft_pipapo_field {
 };
 
 /**
+ * struct nft_pipapo_scratch - percpu data used for lookup and matching
+ * @map_index: Current working bitmap index, toggled between field matches
+ * @map:       store partial matching results during lookup
+ */
+struct nft_pipapo_scratch {
+       u8 map_index;
+       unsigned long map[];
+};
+
+/**
  * struct nft_pipapo_match - Data used for lookup and matching
  * @field_count                Amount of fields in set
  * @scratch:           Preallocated per-CPU maps for partial matching results
@@ -142,9 +152,9 @@ struct nft_pipapo_field {
 struct nft_pipapo_match {
        int field_count;
 #ifdef NFT_PIPAPO_ALIGN
-       unsigned long * __percpu *scratch_aligned;
+       struct nft_pipapo_scratch * __percpu *scratch_aligned;
 #endif
-       unsigned long * __percpu *scratch;
+       struct nft_pipapo_scratch * __percpu *scratch;
        size_t bsize_max;
        struct rcu_head rcu;
        struct nft_pipapo_field f[] __counted_by(field_count);