From: kernel test robot <lkp@intel.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>,
bpf@vger.kernel.org, netdev@vger.kernel.org
Cc: kbuild-all@lists.01.org, lorenzo.bianconi@redhat.com,
davem@davemloft.net, kuba@kernel.org, ast@kernel.org,
daniel@iogearbox.net, shayagr@amazon.com,
john.fastabend@gmail.com, dsahern@kernel.org
Subject: Re: [PATCH v7 bpf-next 09/14] bpd: add multi-buffer support to xdp copy helpers
Date: Sat, 20 Mar 2021 11:47:00 +0800 [thread overview]
Message-ID: <202103201112.Qq22IgkP-lkp@intel.com> (raw)
In-Reply-To: <d7e913be6855a2aeaaff16de39960b38afd06da7.1616179034.git.lorenzo@kernel.org>
Hi Lorenzo,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Lorenzo-Bianconi/mvneta-introduce-XDP-multi-buffer-support/20210320-055103
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
compiler: nios2-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
cppcheck warnings: (new ones prefixed by >>)
^
net/core/filter.c:10085:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = -EACCES;
^
net/core/filter.c:10090:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = fprog->len;
^
>> net/core/filter.c:4593:30: warning: Uninitialized variable: copy_len [uninitvar]
memcpy(dst_buff, src_buff, copy_len);
^
vim +4593 net/core/filter.c
4551
4552 static unsigned long bpf_xdp_copy(void *dst_buff, const void *ctx,
4553 unsigned long off, unsigned long len)
4554 {
4555 struct xdp_buff *xdp = (struct xdp_buff *)ctx;
4556 struct xdp_shared_info *xdp_sinfo;
4557 unsigned long base_len;
4558 const void *src_buff;
4559
4560 if (likely(!xdp->mb)) {
4561 src_buff = xdp->data;
4562 memcpy(dst_buff, src_buff + off, len);
4563
4564 return 0;
4565 }
4566
4567 base_len = xdp->data_end - xdp->data;
4568 xdp_sinfo = xdp_get_shared_info_from_buff(xdp);
4569 do {
4570 unsigned long copy_len;
4571
4572 if (off < base_len) {
4573 src_buff = xdp->data + off;
4574 copy_len = min(len, base_len - off);
4575 } else {
4576 unsigned long frag_off_total = base_len;
4577 int i;
4578
4579 for (i = 0; i < xdp_sinfo->nr_frags; i++) {
4580 skb_frag_t *frag = &xdp_sinfo->frags[i];
4581 unsigned long frag_len = xdp_get_frag_size(frag);
4582 unsigned long frag_off = off - frag_off_total;
4583
4584 if (frag_off < frag_len) {
4585 src_buff = xdp_get_frag_address(frag) +
4586 frag_off;
4587 copy_len = min(len, frag_len - frag_off);
4588 break;
4589 }
4590 frag_off_total += frag_len;
4591 }
4592 }
> 4593 memcpy(dst_buff, src_buff, copy_len);
4594 off += copy_len;
4595 len -= copy_len;
4596 dst_buff += copy_len;
4597 } while (len);
4598
4599 return 0;
4600 }
4601
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next prev parent reply other threads:[~2021-03-20 3:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 21:47 [PATCH v7 bpf-next 00/14] mvneta: introduce XDP multi-buffer support Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 01/14] xdp: introduce mb in xdp_buff/xdp_frame Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 02/14] xdp: add xdp_shared_info data structure Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 03/14] net: mvneta: update mb bit before passing the xdp buffer to eBPF layer Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 04/14] xdp: add multi-buff support to xdp_return_{buff/frame} Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 05/14] net: mvneta: add multi buffer support to XDP_TX Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 06/14] net: mvneta: enable jumbo frames for XDP Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 07/14] net: xdp: add multi-buff support to xdp_build_skb_from_fram Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 08/14] bpf: add multi-buff support to the bpf_xdp_adjust_tail() API Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 09/14] bpd: add multi-buffer support to xdp copy helpers Lorenzo Bianconi
2021-03-20 0:51 ` kernel test robot
2021-03-20 3:47 ` kernel test robot [this message]
2021-03-19 21:47 ` [PATCH v7 bpf-next 10/14] bpf: add new frame_length field to the XDP ctx Lorenzo Bianconi
2021-03-20 3:42 ` David Ahern
2021-03-22 9:29 ` Eelco Chaudron
2021-03-22 15:05 ` David Ahern
2021-03-19 21:47 ` [PATCH v7 bpf-next 11/14] bpf: move user_size out of bpf_test_init Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 12/14] bpf: introduce multibuff support to bpf_prog_test_run_xdp() Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 13/14] bpf: test_run: add xdp_shared_info pointer in bpf_test_finish signature Lorenzo Bianconi
2021-03-19 21:47 ` [PATCH v7 bpf-next 14/14] bpf: update xdp_adjust_tail selftest to include multi-buffer Lorenzo Bianconi
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=202103201112.Qq22IgkP-lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=kuba@kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shayagr@amazon.com \
/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).