linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Matteo Croce <mcroce@linux.microsoft.com>, netdev@vger.kernel.org
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Jakub Kicinski <kuba@kernel.org>,
	Julia Lawall <julia.lawall@inria.fr>
Subject: Re: [PATCH net-next 2/3] net: use skb_for_each_frag() helper where possible
Date: Sat, 10 Apr 2021 08:27:15 +0800	[thread overview]
Message-ID: <202104100800.V20GFYCt-lkp@intel.com> (raw)
In-Reply-To: <20210409180605.78599-3-mcroce@linux.microsoft.com>

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

Hi Matteo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Matteo-Croce/introduce-skb_for_each_frag/20210410-020828
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 4438669eb703d1a7416c2b19a8a15b0400b36738
config: um-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/9a46b324d3f1ca289db31c0011a6bbfd5ae06918
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Matteo-Croce/introduce-skb_for_each_frag/20210410-020828
        git checkout 9a46b324d3f1ca289db31c0011a6bbfd5ae06918
        # save the attached .config to linux build tree
        make W=1 ARCH=um 

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 >>):

   cc1: warning: arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
   arch/um/drivers/vector_kern.c: In function 'get_bpf_flash':
   arch/um/drivers/vector_kern.c:145:18: warning: ordered comparison of pointer with integer zero [-Wextra]
     145 |    return (allow > 0);
         |                  ^
   arch/um/drivers/vector_kern.c: In function 'prep_skb':
>> arch/um/drivers/vector_kern.c:627:11: warning: variable 'nr_frags' set but not used [-Wunused-but-set-variable]
     627 |  int err, nr_frags, frag;
         |           ^~~~~~~~
   arch/um/drivers/vector_kern.c: In function 'vector_parse':
   arch/um/drivers/vector_kern.c:719:9: warning: variable 'len' set but not used [-Wunused-but-set-variable]
     719 |  int n, len, err;
         |         ^~~


vim +/nr_frags +627 arch/um/drivers/vector_kern.c

49da7e64f33e80 Anton Ivanov 2017-11-20  609  
49da7e64f33e80 Anton Ivanov 2017-11-20  610  /*
49da7e64f33e80 Anton Ivanov 2017-11-20  611   * We do not use the RX queue as a proper wraparound queue for now
49da7e64f33e80 Anton Ivanov 2017-11-20  612   * This is not necessary because the consumption via netif_rx()
49da7e64f33e80 Anton Ivanov 2017-11-20  613   * happens in-line. While we can try using the return code of
49da7e64f33e80 Anton Ivanov 2017-11-20  614   * netif_rx() for flow control there are no drivers doing this today.
49da7e64f33e80 Anton Ivanov 2017-11-20  615   * For this RX specific use we ignore the tail/head locks and
49da7e64f33e80 Anton Ivanov 2017-11-20  616   * just read into a prepared queue filled with skbuffs.
49da7e64f33e80 Anton Ivanov 2017-11-20  617   */
49da7e64f33e80 Anton Ivanov 2017-11-20  618  
49da7e64f33e80 Anton Ivanov 2017-11-20  619  static struct sk_buff *prep_skb(
49da7e64f33e80 Anton Ivanov 2017-11-20  620  	struct vector_private *vp,
49da7e64f33e80 Anton Ivanov 2017-11-20  621  	struct user_msghdr *msg)
49da7e64f33e80 Anton Ivanov 2017-11-20  622  {
49da7e64f33e80 Anton Ivanov 2017-11-20  623  	int linear = vp->max_packet + vp->headroom + SAFETY_MARGIN;
49da7e64f33e80 Anton Ivanov 2017-11-20  624  	struct sk_buff *result;
49da7e64f33e80 Anton Ivanov 2017-11-20  625  	int iov_index = 0, len;
49da7e64f33e80 Anton Ivanov 2017-11-20  626  	struct iovec *iov = msg->msg_iov;
49da7e64f33e80 Anton Ivanov 2017-11-20 @627  	int err, nr_frags, frag;
49da7e64f33e80 Anton Ivanov 2017-11-20  628  	skb_frag_t *skb_frag;
49da7e64f33e80 Anton Ivanov 2017-11-20  629  
49da7e64f33e80 Anton Ivanov 2017-11-20  630  	if (vp->req_size <= linear)
49da7e64f33e80 Anton Ivanov 2017-11-20  631  		len = linear;
49da7e64f33e80 Anton Ivanov 2017-11-20  632  	else
49da7e64f33e80 Anton Ivanov 2017-11-20  633  		len = vp->req_size;
49da7e64f33e80 Anton Ivanov 2017-11-20  634  	result = alloc_skb_with_frags(
49da7e64f33e80 Anton Ivanov 2017-11-20  635  		linear,
49da7e64f33e80 Anton Ivanov 2017-11-20  636  		len - vp->max_packet,
49da7e64f33e80 Anton Ivanov 2017-11-20  637  		3,
49da7e64f33e80 Anton Ivanov 2017-11-20  638  		&err,
49da7e64f33e80 Anton Ivanov 2017-11-20  639  		GFP_ATOMIC
49da7e64f33e80 Anton Ivanov 2017-11-20  640  	);
49da7e64f33e80 Anton Ivanov 2017-11-20  641  	if (vp->header_size > 0)
49da7e64f33e80 Anton Ivanov 2017-11-20  642  		iov_index++;
49da7e64f33e80 Anton Ivanov 2017-11-20  643  	if (result == NULL) {
49da7e64f33e80 Anton Ivanov 2017-11-20  644  		iov[iov_index].iov_base = NULL;
49da7e64f33e80 Anton Ivanov 2017-11-20  645  		iov[iov_index].iov_len = 0;
49da7e64f33e80 Anton Ivanov 2017-11-20  646  		goto done;
49da7e64f33e80 Anton Ivanov 2017-11-20  647  	}
49da7e64f33e80 Anton Ivanov 2017-11-20  648  	skb_reserve(result, vp->headroom);
49da7e64f33e80 Anton Ivanov 2017-11-20  649  	result->dev = vp->dev;
49da7e64f33e80 Anton Ivanov 2017-11-20  650  	skb_put(result, vp->max_packet);
49da7e64f33e80 Anton Ivanov 2017-11-20  651  	result->data_len = len - vp->max_packet;
49da7e64f33e80 Anton Ivanov 2017-11-20  652  	result->len += len - vp->max_packet;
49da7e64f33e80 Anton Ivanov 2017-11-20  653  	skb_reset_mac_header(result);
49da7e64f33e80 Anton Ivanov 2017-11-20  654  	result->ip_summed = CHECKSUM_NONE;
49da7e64f33e80 Anton Ivanov 2017-11-20  655  	iov[iov_index].iov_base = result->data;
49da7e64f33e80 Anton Ivanov 2017-11-20  656  	iov[iov_index].iov_len = vp->max_packet;
49da7e64f33e80 Anton Ivanov 2017-11-20  657  	iov_index++;
49da7e64f33e80 Anton Ivanov 2017-11-20  658  
49da7e64f33e80 Anton Ivanov 2017-11-20  659  	nr_frags = skb_shinfo(result)->nr_frags;
9a46b324d3f1ca Matteo Croce 2021-04-09  660  	skb_for_each_frag(result, frag) {
49da7e64f33e80 Anton Ivanov 2017-11-20  661  		skb_frag = &skb_shinfo(result)->frags[frag];
49da7e64f33e80 Anton Ivanov 2017-11-20  662  		iov[iov_index].iov_base = skb_frag_address_safe(skb_frag);
49da7e64f33e80 Anton Ivanov 2017-11-20  663  		if (iov[iov_index].iov_base != NULL)
49da7e64f33e80 Anton Ivanov 2017-11-20  664  			iov[iov_index].iov_len = skb_frag_size(skb_frag);
49da7e64f33e80 Anton Ivanov 2017-11-20  665  		else
49da7e64f33e80 Anton Ivanov 2017-11-20  666  			iov[iov_index].iov_len = 0;
49da7e64f33e80 Anton Ivanov 2017-11-20  667  		iov_index++;
49da7e64f33e80 Anton Ivanov 2017-11-20  668  	}
49da7e64f33e80 Anton Ivanov 2017-11-20  669  done:
49da7e64f33e80 Anton Ivanov 2017-11-20  670  	msg->msg_iovlen = iov_index;
49da7e64f33e80 Anton Ivanov 2017-11-20  671  	return result;
49da7e64f33e80 Anton Ivanov 2017-11-20  672  }
49da7e64f33e80 Anton Ivanov 2017-11-20  673  

---
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: 24381 bytes --]

  parent reply	other threads:[~2021-04-10  0:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 18:06 [PATCH net-next 0/3] introduce skb_for_each_frag() Matteo Croce
2021-04-09 18:06 ` [PATCH net-next 1/3] skbuff: add helper to walk over the fraglist Matteo Croce
2021-04-09 18:06 ` [PATCH net-next 2/3] net: use skb_for_each_frag() helper where possible Matteo Croce
2021-04-09 18:54   ` Jakub Kicinski
2021-04-09 20:44     ` Matteo Croce
2021-04-09 21:28       ` Jakub Kicinski
2021-04-10  0:53         ` Matteo Croce
2021-04-09 21:21   ` kernel test robot
2021-04-10  0:27   ` kernel test robot [this message]
2021-04-09 18:06 ` [PATCH net-next 3/3] net: use skb_for_each_frag() in illegal_highdma() Matteo Croce

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=202104100800.V20GFYCt-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --cc=kbuild-all@lists.01.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcroce@linux.microsoft.com \
    --cc=netdev@vger.kernel.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).