* Re: [PATCH net-next 8/8] vhost/net: enable gso over UDP tunnel support.
[not found] <f95716aed2c65d079cdb10518431088f3e103899.1747822866.git.pabeni@redhat.com>
@ 2025-05-22 6:43 ` kernel test robot
2025-05-23 19:54 ` Michael S. Tsirkin
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-05-22 6:43 UTC (permalink / raw)
To: Paolo Abeni, netdev
Cc: llvm, oe-kbuild-all, Willem de Bruijn, Jason Wang, Andrew Lunn,
Eric Dumazet, Jakub Kicinski, Michael S. Tsirkin, Xuan Zhuo,
Eugenio Pérez
Hi Paolo,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Paolo-Abeni/virtio-introduce-virtio_features_t/20250521-183700
base: net-next/main
patch link: https://lore.kernel.org/r/f95716aed2c65d079cdb10518431088f3e103899.1747822866.git.pabeni%40redhat.com
patch subject: [PATCH net-next 8/8] vhost/net: enable gso over UDP tunnel support.
config: i386-buildonly-randconfig-001-20250522 (https://download.01.org/0day-ci/archive/20250522/202505221428.67HNn025-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250522/202505221428.67HNn025-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505221428.67HNn025-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/vhost/net.c:1633:30: warning: shift count >= width of type [-Wshift-count-overflow]
1633 | has_tunnel = !!(features & (VIRTIO_BIT(VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO) |
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/virtio_features.h:18:24: note: expanded from macro 'VIRTIO_BIT'
18 | #define VIRTIO_BIT(b) BIT_ULL(b)
| ^~~~~~~~~~
include/vdso/bits.h:8:30: note: expanded from macro 'BIT_ULL'
8 | #define BIT_ULL(nr) (ULL(1) << (nr))
| ^ ~~~~
drivers/vhost/net.c:1634:9: warning: shift count >= width of type [-Wshift-count-overflow]
1634 | VIRTIO_BIT(VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO)));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/virtio_features.h:18:24: note: expanded from macro 'VIRTIO_BIT'
18 | #define VIRTIO_BIT(b) BIT_ULL(b)
| ^~~~~~~~~~
include/vdso/bits.h:8:30: note: expanded from macro 'BIT_ULL'
8 | #define BIT_ULL(nr) (ULL(1) << (nr))
| ^ ~~~~
2 warnings generated.
vim +1633 drivers/vhost/net.c
1622
1623 static int vhost_net_set_features(struct vhost_net *n, virtio_features_t features)
1624 {
1625 size_t vhost_hlen, sock_hlen, hdr_len;
1626 bool has_tunnel;
1627 int i;
1628
1629 hdr_len = (features & ((1ULL << VIRTIO_NET_F_MRG_RXBUF) |
1630 (1ULL << VIRTIO_F_VERSION_1))) ?
1631 sizeof(struct virtio_net_hdr_mrg_rxbuf) :
1632 sizeof(struct virtio_net_hdr);
> 1633 has_tunnel = !!(features & (VIRTIO_BIT(VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO) |
1634 VIRTIO_BIT(VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO)));
1635 hdr_len += has_tunnel ? sizeof(struct virtio_net_hdr_tunnel) : 0;
1636 if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) {
1637 /* vhost provides vnet_hdr */
1638 vhost_hlen = hdr_len;
1639 sock_hlen = 0;
1640 } else {
1641 /* socket provides vnet_hdr */
1642 vhost_hlen = 0;
1643 sock_hlen = hdr_len;
1644 }
1645 mutex_lock(&n->dev.mutex);
1646 if ((features & (1 << VHOST_F_LOG_ALL)) &&
1647 !vhost_log_access_ok(&n->dev))
1648 goto out_unlock;
1649
1650 if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {
1651 if (vhost_init_device_iotlb(&n->dev))
1652 goto out_unlock;
1653 }
1654
1655 for (i = 0; i < VHOST_NET_VQ_MAX; ++i) {
1656 mutex_lock(&n->vqs[i].vq.mutex);
1657 n->vqs[i].vq.acked_features = features;
1658 n->vqs[i].vhost_hlen = vhost_hlen;
1659 n->vqs[i].sock_hlen = sock_hlen;
1660 mutex_unlock(&n->vqs[i].vq.mutex);
1661 }
1662 mutex_unlock(&n->dev.mutex);
1663 return 0;
1664
1665 out_unlock:
1666 mutex_unlock(&n->dev.mutex);
1667 return -EFAULT;
1668 }
1669
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next 8/8] vhost/net: enable gso over UDP tunnel support.
2025-05-22 6:43 ` [PATCH net-next 8/8] vhost/net: enable gso over UDP tunnel support kernel test robot
@ 2025-05-23 19:54 ` Michael S. Tsirkin
0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2025-05-23 19:54 UTC (permalink / raw)
To: kernel test robot
Cc: Paolo Abeni, netdev, llvm, oe-kbuild-all, Willem de Bruijn,
Jason Wang, Andrew Lunn, Eric Dumazet, Jakub Kicinski, Xuan Zhuo,
Eugenio Pérez
On Thu, May 22, 2025 at 02:43:50PM +0800, kernel test robot wrote:
> Hi Paolo,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on net-next/main]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Paolo-Abeni/virtio-introduce-virtio_features_t/20250521-183700
> base: net-next/main
> patch link: https://lore.kernel.org/r/f95716aed2c65d079cdb10518431088f3e103899.1747822866.git.pabeni%40redhat.com
> patch subject: [PATCH net-next 8/8] vhost/net: enable gso over UDP tunnel support.
> config: i386-buildonly-randconfig-001-20250522 (https://download.01.org/0day-ci/archive/20250522/202505221428.67HNn025-lkp@intel.com/config)
> compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250522/202505221428.67HNn025-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202505221428.67HNn025-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/vhost/net.c:1633:30: warning: shift count >= width of type [-Wshift-count-overflow]
> 1633 | has_tunnel = !!(features & (VIRTIO_BIT(VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO) |
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/virtio_features.h:18:24: note: expanded from macro 'VIRTIO_BIT'
> 18 | #define VIRTIO_BIT(b) BIT_ULL(b)
> | ^~~~~~~~~~
> include/vdso/bits.h:8:30: note: expanded from macro 'BIT_ULL'
> 8 | #define BIT_ULL(nr) (ULL(1) << (nr))
> | ^ ~~~~
> drivers/vhost/net.c:1634:9: warning: shift count >= width of type [-Wshift-count-overflow]
> 1634 | VIRTIO_BIT(VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO)));
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
yep, this is why I suggested making VIRTIO_BIT(any value > 63) simply 0 on 32 bit.
> include/linux/virtio_features.h:18:24: note: expanded from macro 'VIRTIO_BIT'
> 18 | #define VIRTIO_BIT(b) BIT_ULL(b)
> | ^~~~~~~~~~
> include/vdso/bits.h:8:30: note: expanded from macro 'BIT_ULL'
> 8 | #define BIT_ULL(nr) (ULL(1) << (nr))
> | ^ ~~~~
> 2 warnings generated.
>
>
> vim +1633 drivers/vhost/net.c
>
> 1622
> 1623 static int vhost_net_set_features(struct vhost_net *n, virtio_features_t features)
> 1624 {
> 1625 size_t vhost_hlen, sock_hlen, hdr_len;
> 1626 bool has_tunnel;
> 1627 int i;
> 1628
> 1629 hdr_len = (features & ((1ULL << VIRTIO_NET_F_MRG_RXBUF) |
> 1630 (1ULL << VIRTIO_F_VERSION_1))) ?
> 1631 sizeof(struct virtio_net_hdr_mrg_rxbuf) :
> 1632 sizeof(struct virtio_net_hdr);
> > 1633 has_tunnel = !!(features & (VIRTIO_BIT(VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO) |
> 1634 VIRTIO_BIT(VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO)));
> 1635 hdr_len += has_tunnel ? sizeof(struct virtio_net_hdr_tunnel) : 0;
> 1636 if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) {
> 1637 /* vhost provides vnet_hdr */
> 1638 vhost_hlen = hdr_len;
> 1639 sock_hlen = 0;
> 1640 } else {
> 1641 /* socket provides vnet_hdr */
> 1642 vhost_hlen = 0;
> 1643 sock_hlen = hdr_len;
> 1644 }
> 1645 mutex_lock(&n->dev.mutex);
> 1646 if ((features & (1 << VHOST_F_LOG_ALL)) &&
> 1647 !vhost_log_access_ok(&n->dev))
> 1648 goto out_unlock;
> 1649
> 1650 if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {
> 1651 if (vhost_init_device_iotlb(&n->dev))
> 1652 goto out_unlock;
> 1653 }
> 1654
> 1655 for (i = 0; i < VHOST_NET_VQ_MAX; ++i) {
> 1656 mutex_lock(&n->vqs[i].vq.mutex);
> 1657 n->vqs[i].vq.acked_features = features;
> 1658 n->vqs[i].vhost_hlen = vhost_hlen;
> 1659 n->vqs[i].sock_hlen = sock_hlen;
> 1660 mutex_unlock(&n->vqs[i].vq.mutex);
> 1661 }
> 1662 mutex_unlock(&n->dev.mutex);
> 1663 return 0;
> 1664
> 1665 out_unlock:
> 1666 mutex_unlock(&n->dev.mutex);
> 1667 return -EFAULT;
> 1668 }
> 1669
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-23 19:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <f95716aed2c65d079cdb10518431088f3e103899.1747822866.git.pabeni@redhat.com>
2025-05-22 6:43 ` [PATCH net-next 8/8] vhost/net: enable gso over UDP tunnel support kernel test robot
2025-05-23 19:54 ` Michael S. Tsirkin
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).