* [nf-next:master 4/14] net/netfilter/nft_set_pipapo.c:412:6: error: static declaration of 'nft_pipapo_lookup' follows non-static declaration
@ 2021-05-28 20:54 kernel test robot
2021-05-28 21:30 ` Florian Westphal
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2021-05-28 20:54 UTC (permalink / raw)
To: Florian Westphal; +Cc: kbuild-all, netfilter-devel, coreteam, Pablo Neira Ayuso
[-- Attachment #1: Type: text/plain, Size: 10080 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
head: 6d6dbfe7fe1e6e1fdeda2a947036339a513ca690
commit: a890630241c76a5865b89a4fbdc39f1319754dee [4/14] netfilter: nf_tables: prefer direct calls for set lookups
config: nios2-randconfig-s032-20210528 (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git/commit/?id=a890630241c76a5865b89a4fbdc39f1319754dee
git remote add nf-next https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git
git fetch --no-tags nf-next master
git checkout a890630241c76a5865b89a4fbdc39f1319754dee
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=nios2
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> net/netfilter/nft_set_pipapo.c:412:6: error: static declaration of 'nft_pipapo_lookup' follows non-static declaration
412 | bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set,
| ^~~~~~~~~~~~~~~~~
In file included from net/netfilter/nft_set_pipapo.c:343:
net/netfilter/nft_set_pipapo.h:181:6: note: previous declaration of 'nft_pipapo_lookup' was here
181 | bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set,
| ^~~~~~~~~~~~~~~~~
vim +/nft_pipapo_lookup +412 net/netfilter/nft_set_pipapo.c
3c4287f62044a9 Stefano Brivio 2020-01-22 399
3c4287f62044a9 Stefano Brivio 2020-01-22 400 /**
3c4287f62044a9 Stefano Brivio 2020-01-22 401 * nft_pipapo_lookup() - Lookup function
3c4287f62044a9 Stefano Brivio 2020-01-22 402 * @net: Network namespace
3c4287f62044a9 Stefano Brivio 2020-01-22 403 * @set: nftables API set representation
3db86c397f608b Andrew Lunn 2020-07-13 404 * @key: nftables API element representation containing key data
3c4287f62044a9 Stefano Brivio 2020-01-22 405 * @ext: nftables API extension pointer, filled with matching reference
3c4287f62044a9 Stefano Brivio 2020-01-22 406 *
3c4287f62044a9 Stefano Brivio 2020-01-22 407 * For more details, see DOC: Theory of Operation.
3c4287f62044a9 Stefano Brivio 2020-01-22 408 *
3c4287f62044a9 Stefano Brivio 2020-01-22 409 * Return: true on match, false otherwise.
3c4287f62044a9 Stefano Brivio 2020-01-22 410 */
a890630241c76a Florian Westphal 2021-05-13 411 INDIRECT_CALLABLE_SCOPE
f0b3d338064e1f Stefano Brivio 2021-05-10 @412 bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set,
3c4287f62044a9 Stefano Brivio 2020-01-22 413 const u32 *key, const struct nft_set_ext **ext)
3c4287f62044a9 Stefano Brivio 2020-01-22 414 {
3c4287f62044a9 Stefano Brivio 2020-01-22 415 struct nft_pipapo *priv = nft_set_priv(set);
3c4287f62044a9 Stefano Brivio 2020-01-22 416 unsigned long *res_map, *fill_map;
3c4287f62044a9 Stefano Brivio 2020-01-22 417 u8 genmask = nft_genmask_cur(net);
3c4287f62044a9 Stefano Brivio 2020-01-22 418 const u8 *rp = (const u8 *)key;
3c4287f62044a9 Stefano Brivio 2020-01-22 419 struct nft_pipapo_match *m;
3c4287f62044a9 Stefano Brivio 2020-01-22 420 struct nft_pipapo_field *f;
3c4287f62044a9 Stefano Brivio 2020-01-22 421 bool map_index;
3c4287f62044a9 Stefano Brivio 2020-01-22 422 int i;
3c4287f62044a9 Stefano Brivio 2020-01-22 423
3c4287f62044a9 Stefano Brivio 2020-01-22 424 local_bh_disable();
3c4287f62044a9 Stefano Brivio 2020-01-22 425
3c4287f62044a9 Stefano Brivio 2020-01-22 426 map_index = raw_cpu_read(nft_pipapo_scratch_index);
3c4287f62044a9 Stefano Brivio 2020-01-22 427
3c4287f62044a9 Stefano Brivio 2020-01-22 428 m = rcu_dereference(priv->match);
3c4287f62044a9 Stefano Brivio 2020-01-22 429
3c4287f62044a9 Stefano Brivio 2020-01-22 430 if (unlikely(!m || !*raw_cpu_ptr(m->scratch)))
3c4287f62044a9 Stefano Brivio 2020-01-22 431 goto out;
3c4287f62044a9 Stefano Brivio 2020-01-22 432
3c4287f62044a9 Stefano Brivio 2020-01-22 433 res_map = *raw_cpu_ptr(m->scratch) + (map_index ? m->bsize_max : 0);
3c4287f62044a9 Stefano Brivio 2020-01-22 434 fill_map = *raw_cpu_ptr(m->scratch) + (map_index ? 0 : m->bsize_max);
3c4287f62044a9 Stefano Brivio 2020-01-22 435
3c4287f62044a9 Stefano Brivio 2020-01-22 436 memset(res_map, 0xff, m->bsize_max * sizeof(*res_map));
3c4287f62044a9 Stefano Brivio 2020-01-22 437
3c4287f62044a9 Stefano Brivio 2020-01-22 438 nft_pipapo_for_each_field(f, i, m) {
3c4287f62044a9 Stefano Brivio 2020-01-22 439 bool last = i == m->field_count - 1;
e807b13cb3e3bc Stefano Brivio 2020-03-07 440 int b;
3c4287f62044a9 Stefano Brivio 2020-01-22 441
e807b13cb3e3bc Stefano Brivio 2020-03-07 442 /* For each bit group: select lookup table bucket depending on
3c4287f62044a9 Stefano Brivio 2020-01-22 443 * packet bytes value, then AND bucket value
3c4287f62044a9 Stefano Brivio 2020-01-22 444 */
4051f43116cdc7 Stefano Brivio 2020-03-07 445 if (likely(f->bb == 8))
4051f43116cdc7 Stefano Brivio 2020-03-07 446 pipapo_and_field_buckets_8bit(f, res_map, rp);
4051f43116cdc7 Stefano Brivio 2020-03-07 447 else
e807b13cb3e3bc Stefano Brivio 2020-03-07 448 pipapo_and_field_buckets_4bit(f, res_map, rp);
4051f43116cdc7 Stefano Brivio 2020-03-07 449 NFT_PIPAPO_GROUP_BITS_ARE_8_OR_4;
3c4287f62044a9 Stefano Brivio 2020-01-22 450
e807b13cb3e3bc Stefano Brivio 2020-03-07 451 rp += f->groups / NFT_PIPAPO_GROUPS_PER_BYTE(f);
3c4287f62044a9 Stefano Brivio 2020-01-22 452
3c4287f62044a9 Stefano Brivio 2020-01-22 453 /* Now populate the bitmap for the next field, unless this is
3c4287f62044a9 Stefano Brivio 2020-01-22 454 * the last field, in which case return the matched 'ext'
3c4287f62044a9 Stefano Brivio 2020-01-22 455 * pointer if any.
3c4287f62044a9 Stefano Brivio 2020-01-22 456 *
3c4287f62044a9 Stefano Brivio 2020-01-22 457 * Now res_map contains the matching bitmap, and fill_map is the
3c4287f62044a9 Stefano Brivio 2020-01-22 458 * bitmap for the next field.
3c4287f62044a9 Stefano Brivio 2020-01-22 459 */
3c4287f62044a9 Stefano Brivio 2020-01-22 460 next_match:
3c4287f62044a9 Stefano Brivio 2020-01-22 461 b = pipapo_refill(res_map, f->bsize, f->rules, fill_map, f->mt,
3c4287f62044a9 Stefano Brivio 2020-01-22 462 last);
3c4287f62044a9 Stefano Brivio 2020-01-22 463 if (b < 0) {
3c4287f62044a9 Stefano Brivio 2020-01-22 464 raw_cpu_write(nft_pipapo_scratch_index, map_index);
3c4287f62044a9 Stefano Brivio 2020-01-22 465 local_bh_enable();
3c4287f62044a9 Stefano Brivio 2020-01-22 466
3c4287f62044a9 Stefano Brivio 2020-01-22 467 return false;
3c4287f62044a9 Stefano Brivio 2020-01-22 468 }
3c4287f62044a9 Stefano Brivio 2020-01-22 469
3c4287f62044a9 Stefano Brivio 2020-01-22 470 if (last) {
3c4287f62044a9 Stefano Brivio 2020-01-22 471 *ext = &f->mt[b].e->ext;
3c4287f62044a9 Stefano Brivio 2020-01-22 472 if (unlikely(nft_set_elem_expired(*ext) ||
3c4287f62044a9 Stefano Brivio 2020-01-22 473 !nft_set_elem_active(*ext, genmask)))
3c4287f62044a9 Stefano Brivio 2020-01-22 474 goto next_match;
3c4287f62044a9 Stefano Brivio 2020-01-22 475
3c4287f62044a9 Stefano Brivio 2020-01-22 476 /* Last field: we're just returning the key without
3c4287f62044a9 Stefano Brivio 2020-01-22 477 * filling the initial bitmap for the next field, so the
3c4287f62044a9 Stefano Brivio 2020-01-22 478 * current inactive bitmap is clean and can be reused as
3c4287f62044a9 Stefano Brivio 2020-01-22 479 * *next* bitmap (not initial) for the next packet.
3c4287f62044a9 Stefano Brivio 2020-01-22 480 */
3c4287f62044a9 Stefano Brivio 2020-01-22 481 raw_cpu_write(nft_pipapo_scratch_index, map_index);
3c4287f62044a9 Stefano Brivio 2020-01-22 482 local_bh_enable();
3c4287f62044a9 Stefano Brivio 2020-01-22 483
3c4287f62044a9 Stefano Brivio 2020-01-22 484 return true;
3c4287f62044a9 Stefano Brivio 2020-01-22 485 }
3c4287f62044a9 Stefano Brivio 2020-01-22 486
3c4287f62044a9 Stefano Brivio 2020-01-22 487 /* Swap bitmap indices: res_map is the initial bitmap for the
3c4287f62044a9 Stefano Brivio 2020-01-22 488 * next field, and fill_map is guaranteed to be all-zeroes at
3c4287f62044a9 Stefano Brivio 2020-01-22 489 * this point.
3c4287f62044a9 Stefano Brivio 2020-01-22 490 */
3c4287f62044a9 Stefano Brivio 2020-01-22 491 map_index = !map_index;
3c4287f62044a9 Stefano Brivio 2020-01-22 492 swap(res_map, fill_map);
3c4287f62044a9 Stefano Brivio 2020-01-22 493
e807b13cb3e3bc Stefano Brivio 2020-03-07 494 rp += NFT_PIPAPO_GROUPS_PADDING(f);
3c4287f62044a9 Stefano Brivio 2020-01-22 495 }
3c4287f62044a9 Stefano Brivio 2020-01-22 496
3c4287f62044a9 Stefano Brivio 2020-01-22 497 out:
3c4287f62044a9 Stefano Brivio 2020-01-22 498 local_bh_enable();
3c4287f62044a9 Stefano Brivio 2020-01-22 499 return false;
3c4287f62044a9 Stefano Brivio 2020-01-22 500 }
3c4287f62044a9 Stefano Brivio 2020-01-22 501
:::::: The code at line 412 was first introduced by commit
:::::: f0b3d338064e1fe7531f0d2977e35f3b334abfb4 netfilter: nft_set_pipapo_avx2: Add irq_fpu_usable() check, fallback to non-AVX2 version
:::::: TO: Stefano Brivio <sbrivio@redhat.com>
:::::: CC: Pablo Neira Ayuso <pablo@netfilter.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26516 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [nf-next:master 4/14] net/netfilter/nft_set_pipapo.c:412:6: error: static declaration of 'nft_pipapo_lookup' follows non-static declaration 2021-05-28 20:54 [nf-next:master 4/14] net/netfilter/nft_set_pipapo.c:412:6: error: static declaration of 'nft_pipapo_lookup' follows non-static declaration kernel test robot @ 2021-05-28 21:30 ` Florian Westphal 2021-05-28 22:52 ` Pablo Neira Ayuso 0 siblings, 1 reply; 3+ messages in thread From: Florian Westphal @ 2021-05-28 21:30 UTC (permalink / raw) To: kernel test robot Cc: Florian Westphal, kbuild-all, netfilter-devel, coreteam, Pablo Neira Ayuso kernel test robot <lkp@intel.com> wrote: > All errors (new ones prefixed by >>): > > >> net/netfilter/nft_set_pipapo.c:412:6: error: static declaration of 'nft_pipapo_lookup' follows non-static declaration > 412 | bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set, > | ^~~~~~~~~~~~~~~~~ > In file included from net/netfilter/nft_set_pipapo.c:343: > net/netfilter/nft_set_pipapo.h:181:6: note: previous declaration of 'nft_pipapo_lookup' was here > 181 | bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set, > | ^~~~~~~~~~~~~~~~~ > > > vim +/nft_pipapo_lookup +412 net/netfilter/nft_set_pipapo.c > > 3c4287f62044a9 Stefano Brivio 2020-01-22 399 > 3c4287f62044a9 Stefano Brivio 2020-01-22 400 /** > 3c4287f62044a9 Stefano Brivio 2020-01-22 401 * nft_pipapo_lookup() - Lookup function > 3c4287f62044a9 Stefano Brivio 2020-01-22 402 * @net: Network namespace > 3c4287f62044a9 Stefano Brivio 2020-01-22 403 * @set: nftables API set representation > 3db86c397f608b Andrew Lunn 2020-07-13 404 * @key: nftables API element representation containing key data > 3c4287f62044a9 Stefano Brivio 2020-01-22 405 * @ext: nftables API extension pointer, filled with matching reference > 3c4287f62044a9 Stefano Brivio 2020-01-22 406 * > 3c4287f62044a9 Stefano Brivio 2020-01-22 407 * For more details, see DOC: Theory of Operation. > 3c4287f62044a9 Stefano Brivio 2020-01-22 408 * > 3c4287f62044a9 Stefano Brivio 2020-01-22 409 * Return: true on match, false otherwise. > 3c4287f62044a9 Stefano Brivio 2020-01-22 410 */ > a890630241c76a Florian Westphal 2021-05-13 411 INDIRECT_CALLABLE_SCOPE This line needs to be dropped after the nf merge. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [nf-next:master 4/14] net/netfilter/nft_set_pipapo.c:412:6: error: static declaration of 'nft_pipapo_lookup' follows non-static declaration 2021-05-28 21:30 ` Florian Westphal @ 2021-05-28 22:52 ` Pablo Neira Ayuso 0 siblings, 0 replies; 3+ messages in thread From: Pablo Neira Ayuso @ 2021-05-28 22:52 UTC (permalink / raw) To: Florian Westphal; +Cc: kernel test robot, kbuild-all, netfilter-devel, coreteam [-- Attachment #1: Type: text/plain, Size: 2183 bytes --] On Fri, May 28, 2021 at 11:30:01PM +0200, Florian Westphal wrote: > kernel test robot <lkp@intel.com> wrote: > > All errors (new ones prefixed by >>): > > > > >> net/netfilter/nft_set_pipapo.c:412:6: error: static declaration of 'nft_pipapo_lookup' follows non-static declaration > > 412 | bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set, > > | ^~~~~~~~~~~~~~~~~ > > In file included from net/netfilter/nft_set_pipapo.c:343: > > net/netfilter/nft_set_pipapo.h:181:6: note: previous declaration of 'nft_pipapo_lookup' was here > > 181 | bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set, > > | ^~~~~~~~~~~~~~~~~ > > > > > > vim +/nft_pipapo_lookup +412 net/netfilter/nft_set_pipapo.c > > > > 3c4287f62044a9 Stefano Brivio 2020-01-22 399 > > 3c4287f62044a9 Stefano Brivio 2020-01-22 400 /** > > 3c4287f62044a9 Stefano Brivio 2020-01-22 401 * nft_pipapo_lookup() - Lookup function > > 3c4287f62044a9 Stefano Brivio 2020-01-22 402 * @net: Network namespace > > 3c4287f62044a9 Stefano Brivio 2020-01-22 403 * @set: nftables API set representation > > 3db86c397f608b Andrew Lunn 2020-07-13 404 * @key: nftables API element representation containing key data > > 3c4287f62044a9 Stefano Brivio 2020-01-22 405 * @ext: nftables API extension pointer, filled with matching reference > > 3c4287f62044a9 Stefano Brivio 2020-01-22 406 * > > 3c4287f62044a9 Stefano Brivio 2020-01-22 407 * For more details, see DOC: Theory of Operation. > > 3c4287f62044a9 Stefano Brivio 2020-01-22 408 * > > 3c4287f62044a9 Stefano Brivio 2020-01-22 409 * Return: true on match, false otherwise. > > 3c4287f62044a9 Stefano Brivio 2020-01-22 410 */ > > a890630241c76a Florian Westphal 2021-05-13 411 INDIRECT_CALLABLE_SCOPE > > This line needs to be dropped after the nf merge. And bool nft_pipapo_lookup(...) needs to be moved away from #ifdef CONFIG_RETPOLINE in nf_tables_core.h I'm attaching the patch I have here after this changes. However, this is exacty what Stephen Rothwell suggested to fix but Stefano mentioned this is not the right fix... [-- Attachment #2: 0001-netfilter-nf_tables-prefer-direct-calls-for-set-look.patch --] [-- Type: text/x-diff, Size: 8556 bytes --] From 4fdcdd409dda1b2cd96d763cf614ef44772167e3 Mon Sep 17 00:00:00 2001 From: Florian Westphal <fw@strlen.de> Date: Thu, 13 May 2021 22:29:56 +0200 Subject: [PATCH] netfilter: nf_tables: prefer direct calls for set lookups Extend nft_set_do_lookup() to use direct calls when retpoline feature is enabled. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> --- include/net/netfilter/nf_tables_core.h | 24 ++++++++++++++++++++ net/netfilter/nft_lookup.c | 31 ++++++++++++++++++++++++++ net/netfilter/nft_set_bitmap.c | 5 +++-- net/netfilter/nft_set_hash.c | 17 ++++++++------ net/netfilter/nft_set_pipapo.h | 2 -- net/netfilter/nft_set_pipapo_avx2.h | 2 -- net/netfilter/nft_set_rbtree.c | 5 +++-- 7 files changed, 71 insertions(+), 15 deletions(-) diff --git a/include/net/netfilter/nf_tables_core.h b/include/net/netfilter/nf_tables_core.h index 5eb699454490..c75bc6e83d9c 100644 --- a/include/net/netfilter/nf_tables_core.h +++ b/include/net/netfilter/nf_tables_core.h @@ -3,6 +3,7 @@ #define _NET_NF_TABLES_CORE_H #include <net/netfilter/nf_tables.h> +#include <linux/indirect_call_wrapper.h> extern struct nft_expr_type nft_imm_type; extern struct nft_expr_type nft_cmp_type; @@ -88,12 +89,35 @@ extern const struct nft_set_type nft_set_bitmap_type; extern const struct nft_set_type nft_set_pipapo_type; extern const struct nft_set_type nft_set_pipapo_avx2_type; +bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext); + +#ifdef CONFIG_RETPOLINE +bool nft_rhash_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext); +bool nft_rbtree_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext); +bool nft_bitmap_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext); +bool nft_hash_lookup_fast(const struct net *net, + const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext); +bool nft_hash_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext); +bool nft_set_do_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext); +#else static inline bool nft_set_do_lookup(const struct net *net, const struct nft_set *set, const u32 *key, const struct nft_set_ext **ext) { return set->ops->lookup(net, set, key, ext); } +#endif + +/* called from nft_pipapo.c */ +bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext); struct nft_expr; struct nft_regs; diff --git a/net/netfilter/nft_lookup.c b/net/netfilter/nft_lookup.c index 1a8581879af5..90becbf5bff3 100644 --- a/net/netfilter/nft_lookup.c +++ b/net/netfilter/nft_lookup.c @@ -23,6 +23,37 @@ struct nft_lookup { struct nft_set_binding binding; }; +#ifdef CONFIG_RETPOLINE +bool nft_set_do_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext) +{ + if (set->ops == &nft_set_hash_fast_type.ops) + return nft_hash_lookup_fast(net, set, key, ext); + if (set->ops == &nft_set_hash_type.ops) + return nft_hash_lookup(net, set, key, ext); + + if (set->ops == &nft_set_rhash_type.ops) + return nft_rhash_lookup(net, set, key, ext); + + if (set->ops == &nft_set_bitmap_type.ops) + return nft_bitmap_lookup(net, set, key, ext); + + if (set->ops == &nft_set_pipapo_type.ops) + return nft_pipapo_lookup(net, set, key, ext); +#if defined(CONFIG_X86_64) && !defined(CONFIG_UML) + if (set->ops == &nft_set_pipapo_avx2_type.ops) + return nft_pipapo_avx2_lookup(net, set, key, ext); +#endif + + if (set->ops == &nft_set_rbtree_type.ops) + return nft_rbtree_lookup(net, set, key, ext); + + WARN_ON_ONCE(1); + return set->ops->lookup(net, set, key, ext); +} +EXPORT_SYMBOL_GPL(nft_set_do_lookup); +#endif + void nft_lookup_eval(const struct nft_expr *expr, struct nft_regs *regs, const struct nft_pktinfo *pkt) diff --git a/net/netfilter/nft_set_bitmap.c b/net/netfilter/nft_set_bitmap.c index 2a81ea421819..e7ae5914971e 100644 --- a/net/netfilter/nft_set_bitmap.c +++ b/net/netfilter/nft_set_bitmap.c @@ -73,8 +73,9 @@ nft_bitmap_active(const u8 *bitmap, u32 idx, u32 off, u8 genmask) return (bitmap[idx] & (0x3 << off)) & (genmask << off); } -static bool nft_bitmap_lookup(const struct net *net, const struct nft_set *set, - const u32 *key, const struct nft_set_ext **ext) +INDIRECT_CALLABLE_SCOPE +bool nft_bitmap_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext) { const struct nft_bitmap *priv = nft_set_priv(set); u8 genmask = nft_genmask_cur(net); diff --git a/net/netfilter/nft_set_hash.c b/net/netfilter/nft_set_hash.c index 7b3d0a78c569..df40314de21f 100644 --- a/net/netfilter/nft_set_hash.c +++ b/net/netfilter/nft_set_hash.c @@ -74,8 +74,9 @@ static const struct rhashtable_params nft_rhash_params = { .automatic_shrinking = true, }; -static bool nft_rhash_lookup(const struct net *net, const struct nft_set *set, - const u32 *key, const struct nft_set_ext **ext) +INDIRECT_CALLABLE_SCOPE +bool nft_rhash_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext) { struct nft_rhash *priv = nft_set_priv(set); const struct nft_rhash_elem *he; @@ -446,8 +447,9 @@ struct nft_hash_elem { struct nft_set_ext ext; }; -static bool nft_hash_lookup(const struct net *net, const struct nft_set *set, - const u32 *key, const struct nft_set_ext **ext) +INDIRECT_CALLABLE_SCOPE +bool nft_hash_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext) { struct nft_hash *priv = nft_set_priv(set); u8 genmask = nft_genmask_cur(net); @@ -484,9 +486,10 @@ static void *nft_hash_get(const struct net *net, const struct nft_set *set, return ERR_PTR(-ENOENT); } -static bool nft_hash_lookup_fast(const struct net *net, - const struct nft_set *set, - const u32 *key, const struct nft_set_ext **ext) +INDIRECT_CALLABLE_SCOPE +bool nft_hash_lookup_fast(const struct net *net, + const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext) { struct nft_hash *priv = nft_set_priv(set); u8 genmask = nft_genmask_cur(net); diff --git a/net/netfilter/nft_set_pipapo.h b/net/netfilter/nft_set_pipapo.h index d84afb8fa79a..25a75591583e 100644 --- a/net/netfilter/nft_set_pipapo.h +++ b/net/netfilter/nft_set_pipapo.h @@ -178,8 +178,6 @@ struct nft_pipapo_elem { int pipapo_refill(unsigned long *map, int len, int rules, unsigned long *dst, union nft_pipapo_map_bucket *mt, bool match_only); -bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set, - const u32 *key, const struct nft_set_ext **ext); /** * pipapo_and_field_buckets_4bit() - Intersect 4-bit buckets diff --git a/net/netfilter/nft_set_pipapo_avx2.h b/net/netfilter/nft_set_pipapo_avx2.h index 394bcb704db7..dbb6aaca8a7a 100644 --- a/net/netfilter/nft_set_pipapo_avx2.h +++ b/net/netfilter/nft_set_pipapo_avx2.h @@ -5,8 +5,6 @@ #include <asm/fpu/xstate.h> #define NFT_PIPAPO_ALIGN (XSAVE_YMM_SIZE / BITS_PER_BYTE) -bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set, - const u32 *key, const struct nft_set_ext **ext); bool nft_pipapo_avx2_estimate(const struct nft_set_desc *desc, u32 features, struct nft_set_estimate *est); #endif /* defined(CONFIG_X86_64) && !defined(CONFIG_UML) */ diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c index 9e36eb4a7429..d600a566da32 100644 --- a/net/netfilter/nft_set_rbtree.c +++ b/net/netfilter/nft_set_rbtree.c @@ -107,8 +107,9 @@ static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set return false; } -static bool nft_rbtree_lookup(const struct net *net, const struct nft_set *set, - const u32 *key, const struct nft_set_ext **ext) +INDIRECT_CALLABLE_SCOPE +bool nft_rbtree_lookup(const struct net *net, const struct nft_set *set, + const u32 *key, const struct nft_set_ext **ext) { struct nft_rbtree *priv = nft_set_priv(set); unsigned int seq = read_seqcount_begin(&priv->count); -- 2.30.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-28 22:53 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2021-05-28 20:54 [nf-next:master 4/14] net/netfilter/nft_set_pipapo.c:412:6: error: static declaration of 'nft_pipapo_lookup' follows non-static declaration kernel test robot 2021-05-28 21:30 ` Florian Westphal 2021-05-28 22:52 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).