tree:
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-5.4
head: ccb3e3ddfae0c4a0ca4ec34699a965637f2c15e0
commit: d97c3e7785e0bbc76a30f4d8953cf278a7b25886 [38/42] virtio_net: Do not pull payload
in skb->head
config: x86_64-randconfig-r021-20210411 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
dd453a1389b6a7e6d9214b449d3c54981b1a89b6)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
#
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable
https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-5.4
git checkout d97c3e7785e0bbc76a30f4d8953cf278a7b25886
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> drivers/net/virtio_net.c:414:21: error: use of undeclared
identifier 'metasize'
copy = ETH_HLEN + metasize;
^
1 error generated.
vim +/metasize +414 drivers/net/virtio_net.c
373
374 /* Called from bottom half context */
375 static struct sk_buff *page_to_skb(struct virtnet_info *vi,
376 struct receive_queue *rq,
377 struct page *page, unsigned int offset,
378 unsigned int len, unsigned int truesize,
379 bool hdr_valid)
380 {
381 struct sk_buff *skb;
382 struct virtio_net_hdr_mrg_rxbuf *hdr;
383 unsigned int copy, hdr_len, hdr_padded_len;
384 char *p;
385
386 p = page_address(page) + offset;
387
388 /* copy small packet so we can reuse these pages for small data */
389 skb = napi_alloc_skb(&rq->napi, GOOD_COPY_LEN);
390 if (unlikely(!skb))
391 return NULL;
392
393 hdr = skb_vnet_hdr(skb);
394
395 hdr_len = vi->hdr_len;
396 if (vi->mergeable_rx_bufs)
397 hdr_padded_len = sizeof(*hdr);
398 else
399 hdr_padded_len = sizeof(struct padded_vnet_hdr);
400
401 if (hdr_valid)
402 memcpy(hdr, p, hdr_len);
403
404 len -= hdr_len;
405 offset += hdr_padded_len;
406 p += hdr_padded_len;
407
408 /* Copy all frame if it fits skb->head, otherwise
409 * we let virtio_net_hdr_to_skb() and GRO pull headers as needed.
410 */
411 if (len <= skb_tailroom(skb))
412 copy = len;
413 else
414 copy = ETH_HLEN + metasize;
415 skb_put_data(skb, p,
copy);
416
417 len -= copy;
418 offset += copy;
419
420 if (vi->mergeable_rx_bufs) {
421 if (len)
422 skb_add_rx_frag(skb, 0, page, offset, len, truesize);
423 else
424 put_page(page);
425 return skb;
426 }
427
428 /*
429 * Verify that we can indeed put this data into a skb.
430 * This is here to handle cases when the device erroneously
431 * tries to receive more than is possible. This is usually
432 * the case of a broken device.
433 */
434 if (unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) {
435 net_dbg_ratelimited("%s: too much data\n", skb->dev->name);
436 dev_kfree_skb(skb);
437 return NULL;
438 }
439 BUG_ON(offset >= PAGE_SIZE);
440 while (len) {
441 unsigned int frag_size = min((unsigned)PAGE_SIZE - offset, len);
442 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, offset,
443 frag_size, truesize);
444 len -= frag_size;
445 page = (struct page *)page->private;
446 offset = 0;
447 }
448
449 if (page)
450 give_pages(rq, page);
451
452 return skb;
453 }
454
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org