From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: "Jason Wang" <jasowang@redhat.com>,
netdev@vger.kernel.org,
"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"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 1/8] virtio: introduce virtio_features_t
Date: Wed, 28 May 2025 11:52:40 -0400 [thread overview]
Message-ID: <20250528115015-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <3ae72579-7259-49ba-af37-a2eaba719e7e@redhat.com>
On Wed, May 28, 2025 at 05:47:53PM +0200, Paolo Abeni wrote:
> On 5/27/25 5:51 AM, Jason Wang wrote:
> > On Mon, May 26, 2025 at 3:20 PM Paolo Abeni <pabeni@redhat.com> wrote:
> >> On 5/26/25 2:43 AM, Jason Wang wrote:
> >>> On Wed, May 21, 2025 at 6:33 PM Paolo Abeni <pabeni@redhat.com> wrote:
> >>>> diff --git a/include/linux/virtio_features.h b/include/linux/virtio_features.h
> >>>> new file mode 100644
> >>>> index 0000000000000..2f742eeb45a29
> >>>> --- /dev/null
> >>>> +++ b/include/linux/virtio_features.h
> >>>> @@ -0,0 +1,23 @@
> >>>> +/* SPDX-License-Identifier: GPL-2.0 */
> >>>> +#ifndef _LINUX_VIRTIO_FEATURES_H
> >>>> +#define _LINUX_VIRTIO_FEATURES_H
> >>>> +
> >>>> +#include <linux/bits.h>
> >>>> +
> >>>> +#if IS_ENABLED(CONFIG_ARCH_SUPPORTS_INT128)
> >>>> +#define VIRTIO_HAS_EXTENDED_FEATURES
> >>>> +#define VIRTIO_FEATURES_MAX 128
> >>>> +#define VIRTIO_FEATURES_WORDS 4
> >>>> +#define VIRTIO_BIT(b) _BIT128(b)
> >>>> +
> >>>> +typedef __uint128_t virtio_features_t;
> >>>
> >>> Consider:
> >>>
> >>> 1) need the trick for arch that doesn't support 128bit
> >>> 2) some transport (e.g PCI) allows much more than just 128 bit features
> >>>
> >>> I wonder if it's better to just use arrays here.
> >>
> >> I considered that, it has been discussed both on the virtio ML and
> >> privatelly, and I tried a resonable attempt with such implementation.
> >>
> >> The diffstat would be horrible, touching a lot of the virtio/vhost code.
> >
> > Let's start with the driver. For example, driver had already used
> > array for features:
> >
> > const unsigned int *feature_table;
> > unsigned int feature_table_size;
> >
> > For vhost, we need new ioctls anyhow:
> >
> > /* Features bitmask for forward compatibility. Transport bits are used for
> > * vhost specific features. */
> > #define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64)
> > #define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64)
> >
> > As we can't change uAPI for existing ioctls.
> >
> >> Such approach will block any progress for a long time (more likely
> >> forever, since I will not have the capacity to complete it).
> >>
> >
> > Well, could we at least start from using u64[2] for virtio_features_t?
> >
> >> Also the benefit are AFAICS marginal, as 32 bits platform with huge
> >> virtualization deployments on top of it (that could benefit from GSO
> >> over UDP tunnel) are IMHO unlikely,
> >
> > I think it's better to not have those architecture specific assumptions since:
> >
> > 1) need to prove the assumption is correct or
> > 2) we may also create blockers for 64 bit archs that don't support
> > ARCH_SUPPORTS_INT128.
> >
> >> and transport features space
> >> exhaustion is AFAIK far from being reached (also thanks to reserved
> >> features availables).
> >
> > I wouldn't be worried if a straightforward switch to int128 worked,
> > but it looks like that is not the case:
> >
> > 1) ARCH_SUPPORTS_INT128 dependency
> > 2) new uAPI
> > 3) we might want a new virtio config ops as well as most of transport
> > can only return 64 bit now
> >>
> >> TL;DR: if you consider a generic implementation for an arbitrary wide
> >> features space blocking, please LMK, because any other consideration
> >> would be likely irrelevant otherwise.
>
> I read your comments above as the only way forward is abandoning the
> uint128_t usage. Could you please confirm that?
>
> Side note: new uAPI will be required by every implementation of
> feature-space extension, as the current ones are 64-bits bound.
>
> Thanks,
>
> Paolo
Jason, I think what Paolo's doing is a step in the right direction, we
can do this, then gradually transfer all drivers, devices and transports
to use virtio_features_t, then make virtio_features_t an array if we want.
If instead you jump to an array straight away, it's a huge change that
can not be split up cleanly.
--
MST
next prev parent reply other threads:[~2025-05-28 15:52 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-21 10:32 [PATCH net-next 0/8] virtio: introduce GSO over UDP tunnel Paolo Abeni
2025-05-21 10:32 ` [PATCH net-next 1/8] virtio: introduce virtio_features_t Paolo Abeni
2025-05-21 16:02 ` Michael S. Tsirkin
2025-05-22 7:29 ` Paolo Abeni
2025-05-22 15:26 ` Paolo Abeni
2025-05-23 19:50 ` Michael S. Tsirkin
2025-05-22 8:17 ` kernel test robot
2025-05-26 0:43 ` Jason Wang
2025-05-26 7:20 ` Paolo Abeni
2025-05-27 3:51 ` Jason Wang
2025-05-28 15:47 ` Paolo Abeni
2025-05-28 15:52 ` Michael S. Tsirkin [this message]
2025-05-29 2:15 ` Jason Wang
2025-05-27 14:14 ` Michael S. Tsirkin
2025-05-21 10:32 ` [PATCH net-next 2/8] virtio_pci_modern: allow setting configuring extended features Paolo Abeni
2025-05-26 0:49 ` Jason Wang
2025-05-26 10:53 ` Paolo Abeni
2025-05-27 3:04 ` Jason Wang
2025-05-28 16:02 ` Paolo Abeni
2025-05-29 2:22 ` Jason Wang
2025-05-29 11:07 ` Paolo Abeni
2025-05-29 14:28 ` Michael S. Tsirkin
2025-06-03 2:11 ` Jason Wang
2025-05-29 14:28 ` Michael S. Tsirkin
2025-05-21 10:32 ` [PATCH net-next 3/8] vhost-net: allow " Paolo Abeni
2025-05-26 0:47 ` Jason Wang
2025-05-26 10:57 ` Paolo Abeni
2025-05-27 3:56 ` Jason Wang
2025-05-29 11:10 ` Paolo Abeni
2025-06-03 2:11 ` Jason Wang
2025-05-21 10:32 ` [PATCH net-next 4/8] virtio_net: add supports for extended offloads Paolo Abeni
2025-05-26 1:01 ` Jason Wang
2025-05-21 10:32 ` [PATCH net-next 5/8] net: implement virtio helpers to handle UDP GSO tunneling Paolo Abeni
2025-05-22 22:29 ` Willem de Bruijn
2025-05-23 6:09 ` Paolo Abeni
2025-05-23 6:44 ` Paolo Abeni
2025-05-23 13:42 ` Willem de Bruijn
2025-05-23 14:00 ` Paolo Abeni
2025-05-26 4:40 ` Jason Wang
2025-05-29 11:55 ` Paolo Abeni
2025-05-30 8:43 ` Paolo Abeni
2025-06-03 2:11 ` Jason Wang
2025-05-29 15:30 ` Paolo Abeni
2025-06-03 2:11 ` Jason Wang
2025-05-21 10:32 ` [PATCH net-next 6/8] virtio_net: enable gso over UDP tunnel support Paolo Abeni
2025-05-22 8:38 ` kernel test robot
2025-05-22 22:33 ` Willem de Bruijn
2025-05-21 10:32 ` [PATCH net-next 7/8] tun: " Paolo Abeni
2025-05-26 4:40 ` Jason Wang
2025-05-26 11:20 ` Paolo Abeni
2025-05-27 4:19 ` Jason Wang
2025-05-29 16:17 ` Paolo Abeni
2025-06-03 2:11 ` Jason Wang
2025-05-21 10:32 ` [PATCH net-next 8/8] vhost/net: " Paolo Abeni
2025-05-22 6:43 ` kernel test robot
2025-05-23 19:54 ` Michael S. Tsirkin
2025-05-26 4:40 ` Jason Wang
2025-05-21 11:38 ` [PATCH net-next 0/8] virtio: introduce GSO over UDP tunnel Paolo Abeni
2025-05-21 15:52 ` Michael S. Tsirkin
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=20250528115015-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--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 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.