netfilter: nf_tables: add stubs for readonly expressions
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: nf_tables: add stubs for readonly expressions
None of these write to a register, so there is no need to cancel tracking.
--- net/netfilter/nft_cmp.c | 1 + net/netfilter/nft_ct.c | 1 + net/netfilter/nft_dup_netdev.c | 7 +++++++ net/netfilter/nft_fwd_netdev.c | 8 ++++++++ net/netfilter/nft_log.c | 7 +++++++ net/netfilter/nft_masq.c | 7 +++++++ net/netfilter/nft_nat.c | 8 ++++++++ net/netfilter/nft_range.c | 7 +++++++ 8 files changed, 46 insertions(+)
net/netfilter/nft_cmp.c +1 -0
@@ -368,6 +368,7 @@ const struct nft_expr_ops nft_cmp16_fast_ops = { .init = nft_cmp16_fast_init, .dump = nft_cmp16_fast_dump, .offload = nft_cmp16_fast_offload, + .reduce = nft_cmp_reduce, }; static const struct nft_expr_ops *
net/netfilter/nft_ct.c +1 -0
@@ -776,6 +776,7 @@ static const struct nft_expr_ops nft_ct_set_zone_ops = { .init = nft_ct_set_init, .destroy = nft_ct_set_destroy, .dump = nft_ct_set_dump, + .reduce = nft_ct_set_reduce, };#endif
net/netfilter/nft_dup_netdev.c +7 -0
@@ -72,6 +72,12 @@ static bool nft_dup_netdev_offload_action(const struct nft_expr *expr)return true; } +static bool nft_dup_reduce (struct nft_regs_track *track, +const struct nft_expr *expr) +{ +return false; +} +static struct nft_expr_type nft_dup_netdev_type;static const struct nft_expr_ops nft_dup_netdev_ops = { .type = &nft_dup_netdev_type,
@@ -81,6 +87,7 @@ static const struct nft_expr_ops nft_dup_netdev_ops = { .dump = nft_dup_netdev_dump, .offload = nft_dup_netdev_offload, .offload_action = nft_dup_netdev_offload_action, + .reduce = nft_dup_reduce, };static struct nft_expr_type nft_dup_netdev_type__read_mostly = {
net/netfilter/nft_fwd_netdev.c +8 -0
@@ -209,6 +209,12 @@ static int nft_fwd_validate(const struct nft_ctx *ctx, (1 << NF_NETDEV_EGRESS)); } +static bool nft_fwd_reduce (struct nft_regs_track *track, +const struct nft_expr *expr) +{ +return false; +} +static struct nft_expr_type nft_fwd_netdev_type;static const struct nft_expr_ops nft_fwd_neigh_netdev_ops = { .type = &nft_fwd_netdev_type,
@@ -217,6 +223,7 @@ static const struct nft_expr_ops nft_fwd_neigh_netdev_ops = { .init = nft_fwd_neigh_init, .dump = nft_fwd_neigh_dump, .validate = nft_fwd_validate, + .reduce = nft_fwd_reduce, };static const struct nft_expr_ops nft_fwd_netdev_ops = {
@@ -228,6 +235,7 @@ static const struct nft_expr_ops nft_fwd_netdev_ops = { .validate = nft_fwd_validate, .offload = nft_fwd_netdev_offload, .offload_action = nft_fwd_netdev_offload_action, + .reduce = nft_fwd_reduce, }; static const struct nft_expr_ops *
net/netfilter/nft_log.c +7 -0
@@ -282,12 +282,19 @@ static int nft_log_dump(struct sk_buff *skb, const struct nft_expr *expr)return -1 ; } +static bool nft_log_reduce (struct nft_regs_track *track, +const struct nft_expr *expr) +{ +return false; +} +static struct nft_expr_type nft_log_type;static const struct nft_expr_ops nft_log_ops = { .type = &nft_log_type, .size =NFT_EXPR_SIZE (sizeof (struct nft_log )), .eval = nft_log_eval, .init = nft_log_init, + .reduce = nft_log_reduce, .destroy = nft_log_destroy, .dump = nft_log_dump, };
net/netfilter/nft_masq.c +7 -0
@@ -221,6 +221,12 @@ nft_masq_inet_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr)nf_ct_netns_put (ctx->net,NFPROTO_INET ); } +static bool nft_masq_reduce (struct nft_regs_track *track, +const struct nft_expr *expr) +{ +return false; +} +static struct nft_expr_type nft_masq_inet_type;static const struct nft_expr_ops nft_masq_inet_ops = { .type = &nft_masq_inet_type,
@@ -230,6 +236,7 @@ static const struct nft_expr_ops nft_masq_inet_ops = { .destroy = nft_masq_inet_destroy, .dump = nft_masq_dump, .validate = nft_masq_validate, + .reduce = nft_masq_reduce, };static struct nft_expr_type nft_masq_inet_type__read_mostly = {
net/netfilter/nft_nat.c +8 -0
@@ -308,6 +308,12 @@ nft_nat_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr)nf_ct_netns_put (ctx->net, priv->family); } +static bool nft_nat_reduce (struct nft_regs_track *track, +const struct nft_expr *expr) +{ +return false; +} +static struct nft_expr_type nft_nat_type;static const struct nft_expr_ops nft_nat_ops = { .type = &nft_nat_type,
@@ -317,6 +323,7 @@ static const struct nft_expr_ops nft_nat_ops = { .destroy = nft_nat_destroy, .dump = nft_nat_dump, .validate = nft_nat_validate, + .reduce = nft_nat_reduce, };static struct nft_expr_type nft_nat_type__read_mostly = {
@@ -346,6 +353,7 @@ static const struct nft_expr_ops nft_nat_inet_ops = { .destroy = nft_nat_destroy, .dump = nft_nat_dump, .validate = nft_nat_validate, + .reduce = nft_nat_reduce, };static struct nft_expr_type nft_inet_nat_type__read_mostly = {
net/netfilter/nft_range.c +7 -0
@@ -134,12 +134,19 @@ static int nft_range_dump(struct sk_buff *skb, const struct nft_expr *expr)return -1 ; } +static bool nft_range_reduce (struct nft_regs_track *track, +const struct nft_expr *expr) +{ +return false; +} +static const struct nft_expr_ops nft_range_ops = { .type = &nft_range_type, .size =NFT_EXPR_SIZE (sizeof (struct nft_range_expr )), .eval = nft_range_eval, .init = nft_range_init, .dump = nft_range_dump, + .reduce = nft_range_reduce, };struct nft_expr_type nft_range_type__read_mostly = {
Signature · 1 line
2.34.1
kernel test robot
build botI love your patch! Yet something to improve:
Hi Florian,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20220310]
[cannot apply to nf-next/master nf/master linus/master v5.17-rc7 v5.17-rc6 v5.17-rc5 v5.17-rc7] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Florian-Westphal/netfilter-nf_tables-add-stubs-for-readonly-expressions/20220311-185613 base: 71941773e143369a73c9c4a3b62fbb60736a1182 config: powerpc64-buildonly-randconfig-r003-20220310 (https://download.01.org/0day-ci/archive/20220312/[email protected]/config) compiler: powerpc64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/a0cb27794354ccba36b882731b93fdda090f2003
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Florian-Westphal/netfilter-nf_tables-add-stubs-for-readonly-expressions/20220311-185613 git checkout a0cb27794354ccba36b882731b93fdda090f2003
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash net/netfilter/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> net/netfilter/nft_cmp.c:363:27: error: 'nft_cmp_reduce' undeclared here (not in a function); did you mean 'nft_cmp_dump'?
363 | .reduce = nft_cmp_reduce,
| ^~~~~~~~~~~~~~
| nft_cmp_dumpvim +363 net/netfilter/nft_cmp.c
354
355
356 const struct nft_expr_ops nft_cmp16_fast_ops = {
357 .type = &nft_cmp_type,
358 .size = NFT_EXPR_SIZE(sizeof(struct nft_cmp16_fast_expr)),
359 .eval = NULL, /* inlined */
360 .init = nft_cmp16_fast_init,
361 .dump = nft_cmp16_fast_dump,
362 .offload = nft_cmp16_fast_offload,
> 363 .reduce = nft_cmp_reduce,
364 };
365
---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/[email protected]
kernel test robot
build botI love your patch! Yet something to improve:
Hi Florian,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20220310]
[cannot apply to nf-next/master nf/master linus/master v5.17-rc7 v5.17-rc6 v5.17-rc5 v5.17-rc7] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Florian-Westphal/netfilter-nf_tables-add-stubs-for-readonly-expressions/20220311-185613 base: 71941773e143369a73c9c4a3b62fbb60736a1182 config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20220312/[email protected]/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 276ca87382b8f16a65bddac700202924228982f6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/a0cb27794354ccba36b882731b93fdda090f2003
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Florian-Westphal/netfilter-nf_tables-add-stubs-for-readonly-expressions/20220311-185613 git checkout a0cb27794354ccba36b882731b93fdda090f2003
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/panel/ net/netfilter/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> net/netfilter/nft_cmp.c:363:13: error: use of undeclared identifier 'nft_cmp_reduce'; did you mean 'nft_cmp_dump'?
.reduce = nft_cmp_reduce,
^~~~~~~~~~~~~~
nft_cmp_dump
net/netfilter/nft_cmp.c:99:12: note: 'nft_cmp_dump' declared here
static int nft_cmp_dump(struct sk_buff *skb, const struct nft_expr *expr)
^
>> net/netfilter/nft_cmp.c:363:13: error: incompatible function pointer types initializing 'bool (*)(struct nft_regs_track *, const struct nft_expr *)' (aka '_Bool (*)(struct nft_regs_track *, const struct nft_expr *)') with an expression of type 'int (struct sk_buff *, const struct nft_expr *)' [-Werror,-Wincompatible-function-pointer-types] .reduce = nft_cmp_reduce,
^~~~~~~~~~~~~~
2 errors generated.
vim +363 net/netfilter/nft_cmp.c
354
355
356 const struct nft_expr_ops nft_cmp16_fast_ops = {
357 .type = &nft_cmp_type,
358 .size = NFT_EXPR_SIZE(sizeof(struct nft_cmp16_fast_expr)),
359 .eval = NULL, /* inlined */
360 .init = nft_cmp16_fast_init,
361 .dump = nft_cmp16_fast_dump,
362 .offload = nft_cmp16_fast_offload,
> 363 .reduce = nft_cmp_reduce,
364 };
365
---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/[email protected]
kernel test robot
build botI love your patch! Yet something to improve:
Hi Florian,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20220310]
[cannot apply to nf-next/master nf/master linus/master v5.17-rc7 v5.17-rc6 v5.17-rc5 v5.17-rc7] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Florian-Westphal/netfilter-nf_tables-add-stubs-for-readonly-expressions/20220311-185613 base: 71941773e143369a73c9c4a3b62fbb60736a1182 config: m68k-defconfig (https://download.01.org/0day-ci/archive/20220312/[email protected]/config) compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/a0cb27794354ccba36b882731b93fdda090f2003
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Florian-Westphal/netfilter-nf_tables-add-stubs-for-readonly-expressions/20220311-185613 git checkout a0cb27794354ccba36b882731b93fdda090f2003
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash net/netfilter/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> net/netfilter/nft_ct.c:732:27: error: 'nft_ct_set_reduce' undeclared here (not in a function); did you mean 'nft_ct_set_dump'?
732 | .reduce = nft_ct_set_reduce,
| ^~~~~~~~~~~~~~~~~
| nft_ct_set_dumpvim +732 net/netfilter/nft_ct.c
723
724 #ifdef CONFIG_NF_CONNTRACK_ZONES
725 static const struct nft_expr_ops nft_ct_set_zone_ops = {
726 .type = &nft_ct_type,
727 .size = NFT_EXPR_SIZE(sizeof(struct nft_ct)),
728 .eval = nft_ct_set_zone_eval,
729 .init = nft_ct_set_init,
730 .destroy = nft_ct_set_destroy,
731 .dump = nft_ct_set_dump,
> 732 .reduce = nft_ct_set_reduce,
733 };
734 #endif
735
---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/[email protected]