From: kernel test robot <lkp@intel.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org
Subject: Re: [PATCH nf-next,v2 5/5] netfilter: nf_tables: make counter support built-in
Date: Sat, 18 Dec 2021 04:43:22 +0800 [thread overview]
Message-ID: <202112180458.kdTRRudP-lkp@intel.com> (raw)
In-Reply-To: <20211217113837.1253-5-pablo@netfilter.org>
Hi Pablo,
I love your patch! Perhaps something to improve:
[auto build test WARNING on nf/master]
[also build test WARNING on nf-next/master horms-ipvs/master v5.16-rc5 next-20211217]
[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/Pablo-Neira-Ayuso/netfilter-nf_tables-remove-rcu-read-size-lock/20211217-194033
base: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
config: x86_64-randconfig-a001-20211217 (https://download.01.org/0day-ci/archive/20211218/202112180458.kdTRRudP-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9043c3d65b11b442226015acfbf8167684586cfa)
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/390ad4295aa6445c311abd677b653a510f621131
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Pablo-Neira-Ayuso/netfilter-nf_tables-remove-rcu-read-size-lock/20211217-194033
git checkout 390ad4295aa6445c311abd677b653a510f621131
# 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=x86_64 SHELL=/bin/bash net/netfilter/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> net/netfilter/nft_counter.c:195:6: warning: no previous prototype for function 'nft_counter_eval' [-Wmissing-prototypes]
void nft_counter_eval(const struct nft_expr *expr, struct nft_regs *regs,
^
net/netfilter/nft_counter.c:195:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void nft_counter_eval(const struct nft_expr *expr, struct nft_regs *regs,
^
static
>> net/netfilter/nft_counter.c:277:6: warning: no previous prototype for function 'nft_counter_init_seqcount' [-Wmissing-prototypes]
void nft_counter_init_seqcount(void)
^
net/netfilter/nft_counter.c:277:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void nft_counter_init_seqcount(void)
^
static
2 warnings generated.
vim +/nft_counter_eval +195 net/netfilter/nft_counter.c
194
> 195 void nft_counter_eval(const struct nft_expr *expr, struct nft_regs *regs,
196 const struct nft_pktinfo *pkt)
197 {
198 struct nft_counter_percpu_priv *priv = nft_expr_priv(expr);
199
200 nft_counter_do_eval(priv, regs, pkt);
201 }
202
203 static int nft_counter_dump(struct sk_buff *skb, const struct nft_expr *expr)
204 {
205 struct nft_counter_percpu_priv *priv = nft_expr_priv(expr);
206
207 return nft_counter_do_dump(skb, priv, false);
208 }
209
210 static int nft_counter_init(const struct nft_ctx *ctx,
211 const struct nft_expr *expr,
212 const struct nlattr * const tb[])
213 {
214 struct nft_counter_percpu_priv *priv = nft_expr_priv(expr);
215
216 return nft_counter_do_init(tb, priv);
217 }
218
219 static void nft_counter_destroy(const struct nft_ctx *ctx,
220 const struct nft_expr *expr)
221 {
222 struct nft_counter_percpu_priv *priv = nft_expr_priv(expr);
223
224 nft_counter_do_destroy(priv);
225 }
226
227 static int nft_counter_clone(struct nft_expr *dst, const struct nft_expr *src)
228 {
229 struct nft_counter_percpu_priv *priv = nft_expr_priv(src);
230 struct nft_counter_percpu_priv *priv_clone = nft_expr_priv(dst);
231 struct nft_counter __percpu *cpu_stats;
232 struct nft_counter *this_cpu;
233 struct nft_counter total;
234
235 nft_counter_fetch(priv, &total);
236
237 cpu_stats = alloc_percpu_gfp(struct nft_counter, GFP_ATOMIC);
238 if (cpu_stats == NULL)
239 return -ENOMEM;
240
241 preempt_disable();
242 this_cpu = this_cpu_ptr(cpu_stats);
243 this_cpu->packets = total.packets;
244 this_cpu->bytes = total.bytes;
245 preempt_enable();
246
247 priv_clone->counter = cpu_stats;
248 return 0;
249 }
250
251 static int nft_counter_offload(struct nft_offload_ctx *ctx,
252 struct nft_flow_rule *flow,
253 const struct nft_expr *expr)
254 {
255 /* No specific offload action is needed, but report success. */
256 return 0;
257 }
258
259 static void nft_counter_offload_stats(struct nft_expr *expr,
260 const struct flow_stats *stats)
261 {
262 struct nft_counter_percpu_priv *priv = nft_expr_priv(expr);
263 struct nft_counter *this_cpu;
264 seqcount_t *myseq;
265
266 preempt_disable();
267 this_cpu = this_cpu_ptr(priv->counter);
268 myseq = this_cpu_ptr(&nft_counter_seq);
269
270 write_seqcount_begin(myseq);
271 this_cpu->packets += stats->pkts;
272 this_cpu->bytes += stats->bytes;
273 write_seqcount_end(myseq);
274 preempt_enable();
275 }
276
> 277 void nft_counter_init_seqcount(void)
278 {
279 int cpu;
280
281 for_each_possible_cpu(cpu)
282 seqcount_init(per_cpu_ptr(&nft_counter_seq, cpu));
283 }
284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
prev parent reply other threads:[~2021-12-17 20:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-17 11:38 [PATCH nf-next,v2 1/5] netfilter: nf_tables: remove rcu read-size lock Pablo Neira Ayuso
2021-12-17 11:38 ` [PATCH nf-next,v2 2/5] netfilter: nft_payload: WARN_ON_ONCE instead of BUG Pablo Neira Ayuso
2021-12-17 11:38 ` [PATCH nf-next,v2 3/5] netfilter: nf_tables: consolidate rule verdict trace call Pablo Neira Ayuso
2021-12-17 11:38 ` [PATCH nf-next,v2 4/5] netfilter: nf_tables: replace WARN_ON by WARN_ON_ONCE for unknown verdicts Pablo Neira Ayuso
2021-12-17 11:38 ` [PATCH nf-next,v2 5/5] netfilter: nf_tables: make counter support built-in Pablo Neira Ayuso
2021-12-17 19:22 ` kernel test robot
2021-12-17 20:43 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202112180458.kdTRRudP-lkp@intel.com \
--to=lkp@intel.com \
--cc=davem@davemloft.net \
--cc=kbuild-all@lists.01.org \
--cc=kuba@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).