All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH 2/4] drivers/net/virtio_net: Changed mergeable buffer length calculation.
Date: Mon, 01 Nov 2021 00:11:45 +0800	[thread overview]
Message-ID: <202111010020.wbjyo0K0-lkp@intel.com> (raw)
In-Reply-To: <20211031045959.143001-3-andrew@daynix.com>

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

Hi Andrew,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mst-vhost/linux-next]
[also build test ERROR on net-next/master net/master linus/master v5.15-rc7 next-20211029]
[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/Andrew-Melnychenko/Added-RSS-support/20211031-130048
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-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/ca643e21484393b5386b7b86542c3ebb37445a70
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Andrew-Melnychenko/Added-RSS-support/20211031-130048
        git checkout ca643e21484393b5386b7b86542c3ebb37445a70
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash drivers/

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

Note: the linux-review/Andrew-Melnychenko/Added-RSS-support/20211031-130048 HEAD 385fe5b07bf0ded4667d57d48eacf27e3d4e3733 builds fine.
      It only hurts bisectability.

All errors (new ones prefixed by >>):

   drivers/net/virtio_net.c: In function 'page_to_skb':
>> drivers/net/virtio_net.c:396:15: error: 'struct virtnet_info' has no member named 'has_rss_hash_report'
     396 |         if (vi->has_rss_hash_report)
         |               ^~


vim +396 drivers/net/virtio_net.c

   376	
   377	/* Called from bottom half context */
   378	static struct sk_buff *page_to_skb(struct virtnet_info *vi,
   379					   struct receive_queue *rq,
   380					   struct page *page, unsigned int offset,
   381					   unsigned int len, unsigned int truesize,
   382					   bool hdr_valid, unsigned int metasize,
   383					   unsigned int headroom)
   384	{
   385		struct sk_buff *skb;
   386		struct virtio_net_hdr_mrg_rxbuf *hdr;
   387		unsigned int copy, hdr_len, hdr_padded_len;
   388		struct page *page_to_free = NULL;
   389		int tailroom, shinfo_size;
   390		char *p, *hdr_p, *buf;
   391	
   392		p = page_address(page) + offset;
   393		hdr_p = p;
   394	
   395		hdr_len = vi->hdr_len;
 > 396		if (vi->has_rss_hash_report)
   397			hdr_padded_len = sizeof(struct virtio_net_hdr_v1_hash);
   398		else if (vi->mergeable_rx_bufs)
   399			hdr_padded_len = sizeof(*hdr);
   400		else
   401			hdr_padded_len = sizeof(struct padded_vnet_hdr);
   402	
   403		/* If headroom is not 0, there is an offset between the beginning of the
   404		 * data and the allocated space, otherwise the data and the allocated
   405		 * space are aligned.
   406		 *
   407		 * Buffers with headroom use PAGE_SIZE as alloc size, see
   408		 * add_recvbuf_mergeable() + get_mergeable_buf_len()
   409		 */
   410		truesize = headroom ? PAGE_SIZE : truesize;
   411		tailroom = truesize - headroom;
   412		buf = p - headroom;
   413	
   414		len -= hdr_len;
   415		offset += hdr_padded_len;
   416		p += hdr_padded_len;
   417		tailroom -= hdr_padded_len + len;
   418	
   419		shinfo_size = SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
   420	
   421		/* copy small packet so we can reuse these pages */
   422		if (!NET_IP_ALIGN && len > GOOD_COPY_LEN && tailroom >= shinfo_size) {
   423			skb = build_skb(buf, truesize);
   424			if (unlikely(!skb))
   425				return NULL;
   426	
   427			skb_reserve(skb, p - buf);
   428			skb_put(skb, len);
   429	
   430			page = (struct page *)page->private;
   431			if (page)
   432				give_pages(rq, page);
   433			goto ok;
   434		}
   435	
   436		/* copy small packet so we can reuse these pages for small data */
   437		skb = napi_alloc_skb(&rq->napi, GOOD_COPY_LEN);
   438		if (unlikely(!skb))
   439			return NULL;
   440	
   441		/* Copy all frame if it fits skb->head, otherwise
   442		 * we let virtio_net_hdr_to_skb() and GRO pull headers as needed.
   443		 */
   444		if (len <= skb_tailroom(skb))
   445			copy = len;
   446		else
   447			copy = ETH_HLEN + metasize;
   448		skb_put_data(skb, p, copy);
   449	
   450		len -= copy;
   451		offset += copy;
   452	
   453		if (vi->mergeable_rx_bufs) {
   454			if (len)
   455				skb_add_rx_frag(skb, 0, page, offset, len, truesize);
   456			else
   457				page_to_free = page;
   458			goto ok;
   459		}
   460	
   461		/*
   462		 * Verify that we can indeed put this data into a skb.
   463		 * This is here to handle cases when the device erroneously
   464		 * tries to receive more than is possible. This is usually
   465		 * the case of a broken device.
   466		 */
   467		if (unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) {
   468			net_dbg_ratelimited("%s: too much data\n", skb->dev->name);
   469			dev_kfree_skb(skb);
   470			return NULL;
   471		}
   472		BUG_ON(offset >= PAGE_SIZE);
   473		while (len) {
   474			unsigned int frag_size = min((unsigned)PAGE_SIZE - offset, len);
   475			skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, offset,
   476					frag_size, truesize);
   477			len -= frag_size;
   478			page = (struct page *)page->private;
   479			offset = 0;
   480		}
   481	
   482		if (page)
   483			give_pages(rq, page);
   484	
   485	ok:
   486		/* hdr_valid means no XDP, so we can copy the vnet header */
   487		if (hdr_valid) {
   488			hdr = skb_vnet_hdr(skb);
   489			memcpy(hdr, hdr_p, hdr_len);
   490		}
   491		if (page_to_free)
   492			put_page(page_to_free);
   493	
   494		if (metasize) {
   495			__skb_pull(skb, metasize);
   496			skb_metadata_set(skb, metasize);
   497		}
   498	
   499		return skb;
   500	}
   501	

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

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

  reply	other threads:[~2021-10-31 16:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-31  4:59 [RFC PATCH 0/4] Added RSS support Andrew Melnychenko
2021-10-31  4:59 ` Andrew Melnychenko
2021-10-31  4:59 ` [RFC PATCH 1/4] drivers/net/virtio_net: Fixed vheader to use v1 Andrew Melnychenko
2021-10-31  4:59   ` Andrew Melnychenko
2021-11-01  8:40   ` Michael S. Tsirkin
2021-11-01  8:40     ` Michael S. Tsirkin
2021-11-17  6:00     ` Andrew Melnichenko
2021-11-17  6:00       ` Andrew Melnichenko
2021-10-31  4:59 ` [RFC PATCH 2/4] drivers/net/virtio_net: Changed mergeable buffer length calculation Andrew Melnychenko
2021-10-31  4:59   ` Andrew Melnychenko
2021-10-31 16:11   ` kernel test robot [this message]
2021-11-01  8:44   ` Michael S. Tsirkin
2021-11-01  8:44     ` Michael S. Tsirkin
2021-11-17  6:00     ` Andrew Melnichenko
2021-11-17  6:00       ` Andrew Melnichenko
2021-10-31  4:59 ` [RFC PATCH 3/4] drivers/net/virtio_net: Added basic RSS support Andrew Melnychenko
2021-10-31  4:59   ` Andrew Melnychenko
2021-10-31 15:30   ` kernel test robot
2021-10-31 15:32   ` Willem de Bruijn
2021-10-31 15:32     ` Willem de Bruijn
2021-10-31 15:37     ` Willem de Bruijn
2021-10-31 15:37       ` Willem de Bruijn
2021-11-17  6:00     ` Andrew Melnichenko
2021-11-17  6:00       ` Andrew Melnichenko
2021-10-31  4:59 ` [RFC PATCH 4/4] drivers/net/virtio_net: Added RSS hash report control Andrew Melnychenko
2021-10-31  4:59   ` Andrew Melnychenko
2021-11-01 19:49   ` 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=202111010020.wbjyo0K0-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@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.