Content-Type: multipart/mixed; boundary="===============4816127900039964014==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH nf-next, v2 5/5] netfilter: nf_tables: make counter support built-in Date: Sat, 18 Dec 2021 03:22:15 +0800 Message-ID: <202112180342.ufUrUKkP-lkp@intel.com> In-Reply-To: <20211217113837.1253-5-pablo@netfilter.org> List-Id: --===============4816127900039964014== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/netfilte= r-nf_tables-remove-rcu-read-size-lock/20211217-194033 base: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20211218/2= 02112180342.ufUrUKkP-lkp(a)intel.com/config) compiler: sh4-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 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/390ad4295aa6445c311abd677= b653a510f621131 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Pablo-Neira-Ayuso/netfilter-nf_tab= les-remove-rcu-read-size-lock/20211217-194033 git checkout 390ad4295aa6445c311abd677b653a510f621131 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dsh SHELL=3D/bin/bash net/netfilter/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> net/netfilter/nft_counter.c:195:6: warning: no previous prototype for 'n= ft_counter_eval' [-Wmissing-prototypes] 195 | void nft_counter_eval(const struct nft_expr *expr, struct nft_re= gs *regs, | ^~~~~~~~~~~~~~~~ >> net/netfilter/nft_counter.c:277:6: warning: no previous prototype for 'n= ft_counter_init_seqcount' [-Wmissing-prototypes] 277 | void nft_counter_init_seqcount(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~ 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 =3D 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_ex= pr *expr) 204 { 205 struct nft_counter_percpu_priv *priv =3D 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 =3D 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 =3D 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 =3D nft_expr_priv(src); 230 struct nft_counter_percpu_priv *priv_clone =3D 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 =3D alloc_percpu_gfp(struct nft_counter, GFP_ATOMIC); 238 if (cpu_stats =3D=3D NULL) 239 return -ENOMEM; 240 = 241 preempt_disable(); 242 this_cpu =3D this_cpu_ptr(cpu_stats); 243 this_cpu->packets =3D total.packets; 244 this_cpu->bytes =3D total.bytes; 245 preempt_enable(); 246 = 247 priv_clone->counter =3D 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 =3D nft_expr_priv(expr); 263 struct nft_counter *this_cpu; 264 seqcount_t *myseq; 265 = 266 preempt_disable(); 267 this_cpu =3D this_cpu_ptr(priv->counter); 268 myseq =3D this_cpu_ptr(&nft_counter_seq); 269 = 270 write_seqcount_begin(myseq); 271 this_cpu->packets +=3D stats->pkts; 272 this_cpu->bytes +=3D 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(a)lists.01.org --===============4816127900039964014==--