All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v7 bpf-next 09/14] bpd: add multi-buffer support to xdp copy helpers
Date: Sat, 20 Mar 2021 12:34:10 +0800	[thread overview]
Message-ID: <202103201237.8M9coCuk-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 5254 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <d7e913be6855a2aeaaff16de39960b38afd06da7.1616179034.git.lorenzo@kernel.org>
References: <d7e913be6855a2aeaaff16de39960b38afd06da7.1616179034.git.lorenzo@kernel.org>
TO: Lorenzo Bianconi <lorenzo@kernel.org>
TO: bpf(a)vger.kernel.org
TO: netdev(a)vger.kernel.org
CC: lorenzo.bianconi(a)redhat.com
CC: davem(a)davemloft.net
CC: kuba(a)kernel.org
CC: ast(a)kernel.org
CC: daniel(a)iogearbox.net
CC: shayagr(a)amazon.com
CC: john.fastabend(a)gmail.com
CC: dsahern(a)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
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: i386-randconfig-m021-20210318 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
net/core/filter.c:4593 bpf_xdp_copy() error: uninitialized symbol 'src_buff'.
net/core/filter.c:4593 bpf_xdp_copy() error: uninitialized symbol 'copy_len'.

vim +/src_buff +4593 net/core/filter.c

cb20b08ead401f Daniel Borkmann 2018-06-02  4551  
9603affe766576 Eelco Chaudron  2021-03-19  4552  static unsigned long bpf_xdp_copy(void *dst_buff, const void *ctx,
4de16969523c15 Daniel Borkmann 2016-08-18  4553  				  unsigned long off, unsigned long len)
4de16969523c15 Daniel Borkmann 2016-08-18  4554  {
9603affe766576 Eelco Chaudron  2021-03-19  4555  	struct xdp_buff *xdp = (struct xdp_buff *)ctx;
9603affe766576 Eelco Chaudron  2021-03-19  4556  	struct xdp_shared_info *xdp_sinfo;
9603affe766576 Eelco Chaudron  2021-03-19  4557  	unsigned long base_len;
9603affe766576 Eelco Chaudron  2021-03-19  4558  	const void *src_buff;
9603affe766576 Eelco Chaudron  2021-03-19  4559  
9603affe766576 Eelco Chaudron  2021-03-19  4560  	if (likely(!xdp->mb)) {
9603affe766576 Eelco Chaudron  2021-03-19  4561  		src_buff = xdp->data;
4de16969523c15 Daniel Borkmann 2016-08-18  4562  		memcpy(dst_buff, src_buff + off, len);
9603affe766576 Eelco Chaudron  2021-03-19  4563  
9603affe766576 Eelco Chaudron  2021-03-19  4564  		return 0;
9603affe766576 Eelco Chaudron  2021-03-19  4565  	}
9603affe766576 Eelco Chaudron  2021-03-19  4566  
9603affe766576 Eelco Chaudron  2021-03-19  4567  	base_len = xdp->data_end - xdp->data;
9603affe766576 Eelco Chaudron  2021-03-19  4568  	xdp_sinfo = xdp_get_shared_info_from_buff(xdp);
9603affe766576 Eelco Chaudron  2021-03-19  4569  	do {
9603affe766576 Eelco Chaudron  2021-03-19  4570  		unsigned long copy_len;
9603affe766576 Eelco Chaudron  2021-03-19  4571  
9603affe766576 Eelco Chaudron  2021-03-19  4572  		if (off < base_len) {
9603affe766576 Eelco Chaudron  2021-03-19  4573  			src_buff = xdp->data + off;
9603affe766576 Eelco Chaudron  2021-03-19  4574  			copy_len = min(len, base_len - off);
9603affe766576 Eelco Chaudron  2021-03-19  4575  		} else {
9603affe766576 Eelco Chaudron  2021-03-19  4576  			unsigned long frag_off_total = base_len;
9603affe766576 Eelco Chaudron  2021-03-19  4577  			int i;
9603affe766576 Eelco Chaudron  2021-03-19  4578  
9603affe766576 Eelco Chaudron  2021-03-19  4579  			for (i = 0; i < xdp_sinfo->nr_frags; i++) {
9603affe766576 Eelco Chaudron  2021-03-19  4580  				skb_frag_t *frag = &xdp_sinfo->frags[i];
9603affe766576 Eelco Chaudron  2021-03-19  4581  				unsigned long frag_len = xdp_get_frag_size(frag);
9603affe766576 Eelco Chaudron  2021-03-19  4582  				unsigned long frag_off = off - frag_off_total;
9603affe766576 Eelco Chaudron  2021-03-19  4583  
9603affe766576 Eelco Chaudron  2021-03-19  4584  				if (frag_off < frag_len) {
9603affe766576 Eelco Chaudron  2021-03-19  4585  					src_buff = xdp_get_frag_address(frag) +
9603affe766576 Eelco Chaudron  2021-03-19  4586  						   frag_off;
9603affe766576 Eelco Chaudron  2021-03-19  4587  					copy_len = min(len, frag_len - frag_off);
9603affe766576 Eelco Chaudron  2021-03-19  4588  					break;
9603affe766576 Eelco Chaudron  2021-03-19  4589  				}
9603affe766576 Eelco Chaudron  2021-03-19  4590  				frag_off_total += frag_len;
9603affe766576 Eelco Chaudron  2021-03-19  4591  			}
9603affe766576 Eelco Chaudron  2021-03-19  4592  		}
9603affe766576 Eelco Chaudron  2021-03-19 @4593  		memcpy(dst_buff, src_buff, copy_len);
9603affe766576 Eelco Chaudron  2021-03-19  4594  		off += copy_len;
9603affe766576 Eelco Chaudron  2021-03-19  4595  		len -= copy_len;
9603affe766576 Eelco Chaudron  2021-03-19  4596  		dst_buff += copy_len;
9603affe766576 Eelco Chaudron  2021-03-19  4597  	} while (len);
9603affe766576 Eelco Chaudron  2021-03-19  4598  
4de16969523c15 Daniel Borkmann 2016-08-18  4599  	return 0;
4de16969523c15 Daniel Borkmann 2016-08-18  4600  }
4de16969523c15 Daniel Borkmann 2016-08-18  4601  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37413 bytes --]

             reply	other threads:[~2021-03-20  4:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20  4:34 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
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 09/14] bpd: add multi-buffer support to xdp copy helpers Lorenzo Bianconi
2021-03-20  0:51   ` kernel test robot
2021-03-20  0:51     ` kernel test robot
2021-03-20  3:47   ` kernel test robot
2021-03-20  3:47     ` kernel test robot

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=202103201237.8M9coCuk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.