From: "Michael S. Tsirkin" <mst@redhat.com>
To: kernel test robot <lkp@intel.com>
Cc: "Paolo Abeni" <pabeni@redhat.com>,
netdev@vger.kernel.org, llvm@lists.linux.dev,
oe-kbuild-all@lists.linux.dev,
"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
"Jason Wang" <jasowang@redhat.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>
Subject: Re: [PATCH net-next 8/8] vhost/net: enable gso over UDP tunnel support.
Date: Fri, 23 May 2025 15:54:14 -0400 [thread overview]
Message-ID: <20250523155259-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <202505221428.67HNn025-lkp@intel.com>
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
prev parent reply other threads:[~2025-05-23 19:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 message]
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=20250523155259-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=xuanzhuo@linux.alibaba.com \
/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).