[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202202211228.CO4wFX0Q-lkp@intel.com>
Date: Mon, 21 Feb 2022 12:35:45 +0800
From: kernel test robot <lkp@...el.com>
To: Kumar Kartikeya Dwivedi <memxor@...il.com>, bpf@...r.kernel.org
Cc: kbuild-all@...ts.01.org, Alexei Starovoitov <ast@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Jesper Dangaard Brouer <hawk@...nel.org>,
netfilter-devel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH bpf-next v1 12/15] net/netfilter: Add bpf_ct_kptr_get
helper
Hi Kumar,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on next-20220217]
[cannot apply to bpf-next/master bpf/master linus/master v5.17-rc4 v5.17-rc3 v5.17-rc2 v5.17-rc5]
[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/Kumar-Kartikeya-Dwivedi/Introduce-typed-pointer-support-in-BPF-maps/20220220-215105
base: 3c30cf91b5ecc7272b3d2942ae0505dd8320b81c
config: s390-defconfig (https://download.01.org/0day-ci/archive/20220221/202202211228.CO4wFX0Q-lkp@intel.com/config)
compiler: s390-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/79e35d4e4ee33a7692f0612065012307a361cd56
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Kumar-Kartikeya-Dwivedi/Introduce-typed-pointer-support-in-BPF-maps/20220220-215105
git checkout 79e35d4e4ee33a7692f0612065012307a361cd56
# 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=s390 SHELL=/bin/bash net/netfilter/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
net/netfilter/nf_conntrack_bpf.c: In function 'bpf_ct_kptr_get':
>> net/netfilter/nf_conntrack_bpf.c:226:21: warning: variable 'net' set but not used [-Wunused-but-set-variable]
226 | struct net *net;
| ^~~
net/netfilter/nf_conntrack_bpf.c: At top level:
net/netfilter/nf_conntrack_bpf.c:314:5: warning: no previous prototype for 'register_nf_conntrack_bpf' [-Wmissing-prototypes]
314 | int register_nf_conntrack_bpf(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
vim +/net +226 net/netfilter/nf_conntrack_bpf.c
219
220 /* TODO: Just a PoC, need to reuse code in __nf_conntrack_find_get for this */
221 struct nf_conn *bpf_ct_kptr_get(struct nf_conn **ptr, struct bpf_sock_tuple *bpf_tuple,
222 u32 tuple__sz, u8 protonum, u8 direction)
223 {
224 struct nf_conntrack_tuple tuple;
225 struct nf_conn *nfct;
> 226 struct net *net;
227 u64 *nfct_p;
228 int ret;
229
230 WARN_ON_ONCE(!rcu_read_lock_held());
231
232 if ((protonum != IPPROTO_TCP && protonum != IPPROTO_UDP) ||
233 (direction != IP_CT_DIR_ORIGINAL && direction != IP_CT_DIR_REPLY))
234 return NULL;
235
236 /* ptr is actually pointer to u64 having address, hence recast u64 load
237 * to native pointer width.
238 */
239 nfct_p = (u64 *)ptr;
240 nfct = (struct nf_conn *)READ_ONCE(*nfct_p);
241 if (!nfct || unlikely(!refcount_inc_not_zero(&nfct->ct_general.use)))
242 return NULL;
243
244 memset(&tuple, 0, sizeof(tuple));
245 ret = bpf_fill_nf_tuple(&tuple, bpf_tuple, tuple__sz);
246 if (ret < 0)
247 goto end;
248 tuple.dst.protonum = protonum;
249
250 /* XXX: Need to allow passing in struct net *, or take netns_id, this is non-sense */
251 net = nf_ct_net(nfct);
252 if (!nf_ct_key_equal(&nfct->tuplehash[direction], &tuple,
253 &nf_ct_zone_dflt, nf_ct_net(nfct)))
254 goto end;
255 return nfct;
256 end:
257 nf_ct_put(nfct);
258 return NULL;
259 }
260
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Powered by blists - more mailing lists