Re: [PATCH netdev 5/5] virtio-net, xsk: virtio-net support xsk zero copy tx
From: kernel test robot <hidden>
Date: 2021-01-05 13:37:13
Also in:
oe-kbuild-all
Hi Xuan, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on ipvs/master] [also build test WARNING on linus/master v5.11-rc2 next-20210104] [cannot apply to sparc-next/master] [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/Xuan-Zhuo/virtio-net-support-xdp-socket-zero-copy-xmit/20210105-171505 base: https://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs.git master config: x86_64-randconfig-s032-20210105 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.3-208-g46a52ca4-dirty # https://github.com/0day-ci/linux/commit/265d3cdead3bd609bec53e66dfb7c5bf7339f73f git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Xuan-Zhuo/virtio-net-support-xdp-socket-zero-copy-xmit/20210105-171505 git checkout 265d3cdead3bd609bec53e66dfb7c5bf7339f73f # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <redacted> "sparse warnings: (new ones prefixed by >>)"
quoted
drivers/net/virtio_net.c:1502:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got struct virtnet_xsk_hdr [noderef] __rcu *hdr @@
drivers/net/virtio_net.c:1502:38: sparse: expected void const * drivers/net/virtio_net.c:1502:38: sparse: got struct virtnet_xsk_hdr [noderef] __rcu *hdr drivers/net/virtio_net.c:2745:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const * @@ got struct virtnet_xsk_hdr [noderef] __rcu *hdr @@ drivers/net/virtio_net.c:2745:30: sparse: expected void const * drivers/net/virtio_net.c:2745:30: sparse: got struct virtnet_xsk_hdr [noderef] __rcu *hdr
quoted
drivers/net/virtio_net.c:2798:16: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct virtnet_xsk_hdr *xskhdr @@ got struct virtnet_xsk_hdr [noderef] __rcu * @@
drivers/net/virtio_net.c:2798:16: sparse: expected struct virtnet_xsk_hdr *xskhdr
drivers/net/virtio_net.c:2798:16: sparse: got struct virtnet_xsk_hdr [noderef] __rcu *
drivers/net/virtio_net.c:602:9: sparse: sparse: context imbalance in 'virtnet_get_xdp_sq' - different lock contexts for basic block
drivers/net/virtio_net.c:611:22: sparse: sparse: context imbalance in 'virtnet_put_xdp_sq' - unexpected unlock
vim +1502 drivers/net/virtio_net.c
1489
1490 static void virt_xsk_complete(struct send_queue *sq, u32 num, bool xsk_wakeup)
1491 {
1492 struct xsk_buff_pool *pool;
1493 int n;
1494
1495 rcu_read_lock();
1496
1497 WRITE_ONCE(sq->xsk.hdr_pro, sq->xsk.hdr_pro + num);
1498
1499 pool = rcu_dereference(sq->xsk.pool);
1500 if (!pool) {
1501 if (sq->xsk.hdr_pro - sq->xsk.hdr_con == sq->xsk.hdr_n) {1502 kfree(sq->xsk.hdr);
1503 rcu_assign_pointer(sq->xsk.hdr, NULL);
1504 }
1505 rcu_read_unlock();
1506 return;
1507 }
1508
1509 xsk_tx_completed(pool, num);
1510
1511 rcu_read_unlock();
1512
1513 if (!xsk_wakeup || !sq->xsk.wait_slot)
1514 return;
1515
1516 n = sq->xsk.hdr_pro - sq->xsk.hdr_con;
1517
1518 if (n > sq->xsk.hdr_n / 2) {
1519 sq->xsk.wait_slot = false;
1520 virtqueue_napi_schedule(&sq->napi, sq->vq);
1521 }
1522 }
1523
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Attachments
- .config.gz [application/gzip] 32997 bytes