From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Parav Pandit <parav@nvidia.com>,
virtio-comment@lists.linux.dev, cohuck@redhat.com,
mvaralar@redhat.com, shahafs@nvidia.com,
Willem de Bruijn <willemb@google.com>,
Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH v1] virtio-net: Fix to avoid using reserved feature bits
Date: Mon, 28 Apr 2025 05:13:07 -0400 [thread overview]
Message-ID: <20250428045124-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20751ef1-b8e6-4e67-94e5-e8736c3a943b@redhat.com>
On Wed, Apr 23, 2025 at 06:05:43PM +0200, Paolo Abeni wrote:
> On 4/23/25 7:46 AM, Michael S. Tsirkin wrote:
> > On Tue, Apr 22, 2025 at 07:49:41PM +0200, Paolo Abeni wrote:
> >> On 1/26/25 7:20 AM, Parav Pandit wrote:
> >>> @@ -136,6 +124,18 @@ \subsection{Feature bits}\label{sec:Device Types / Network Device / Feature bits
> >>> \item[VIRTIO_NET_F_SPEED_DUPLEX(63)] Device reports speed and duplex.
> >>>
> >>> \item[VIRTIO_NET_F_RSS_CONTEXT(64)] Device supports multiple RSS contexts.
> >>> +
> >>> +\item[VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO (65)] Driver can receive GSO packets
> >>> + carried by a UDP tunnel.
> >>> +
> >>> +\item[VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM (66)] Driver handles packets
> >>> + carried by a UDP tunnel with partial csum for the outer header.
> >>> +
> >>> +\item[VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO (67)] Device can receive GSO packets
> >>> + carried by a UDP tunnel.
> >>> +
> >>> +\item[VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO_CSUM (68)] Device handles packets
> >>> + carried by a UDP tunnel with partial csum for the outer header.
> >>> \end{description}
> >>
> >> I'm finally trying to finalize the implementation and I must admit I
> >> underlooked the implication of using features bit >= 64.
> >>
> >> AFAICS all the virtio drivers in the Linux kernel and qemu assume that
> >> the features can be represented with a single u64.
> >>
> >> Supporting the above requires major reworks in both user-space and
> >> kernel space. At least on the kernel side a similar rework (extending
> >> the _netdev_ features field) has proven to be complex enough to defeat
> >> any implementation attempts for years and in the end it was dismissed in
> >> favor of lower bits reuse.
> >>
> >> I'm wondering if we could reconsider using reserved bits here?
> >>
> >> Thanks!
> >>
> >> Paolo
> >
> > :(
> >
> > It's been there for 2 months now.
>
> Unfortunately I was not able to get back earlier.
>
> > And if you want to avoid using all bits > 63 then it's even more of
> > a mess, you need to move VIRTIO_NET_F_RSS_CONTEXT which has been
> > there for a year and a half.
>
> I started the 'support [arbitrary] larger features bitmap' exercise and
> I think there is a difference between the VIRTIO_NET_F_RSS_CONTEXT bit
> and UDP_TUNNEL_GSO related ones: AFAICS the latter go through the
> VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET command, which in turn limit the
> offload to 64 bit:
>
> """
> The class VIRTIO_NET_CTRL_GUEST_OFFLOADS has one command:
> VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET applies the new offloads configuration.
>
> le64 value passed as command data is a bitmask, bits set define
> offloads to be enabled, bits cleared - offloads to be disabled.
> """
>
> while I don't see similar constraints for the VIRTIO_NET_F_RSS_CONTEXT
> feature.
>
> The current specification is inconsistent, as it does not allow enabling
> the UDP_TUNNEL guest offloads.
Through the command, yes.
> AFAICS we have to either add the specification for another
> VIRTIO_NET_CTRL_GUEST_OFFLOADS command to allow passing the additional
> data
Given features are negotiated first, we can just say the value
can be 64 or 128 bits? In any case, I agree it's buggy as defined.
> or reconsider using reserved bits just for the UDP_TUNNEL offload
> (I'm sorry for reiterating on this, it still looks like a very tempting
> path).
>
> Thanks,
>
> Paolo
Parav what's your take on this one?
--
MST
next prev parent reply other threads:[~2025-04-28 9:13 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 6:20 [PATCH v1] virtio-net: Fix to avoid using reserved feature bits Parav Pandit
2025-01-26 9:19 ` Michael S. Tsirkin
2025-01-26 16:44 ` Parav Pandit
2025-01-26 16:50 ` Michael S. Tsirkin
2025-01-27 9:21 ` Cornelia Huck
2025-01-27 12:54 ` Parav Pandit
2025-04-22 17:49 ` Paolo Abeni
2025-04-23 5:46 ` Michael S. Tsirkin
2025-04-23 16:05 ` Paolo Abeni
2025-04-28 9:13 ` Michael S. Tsirkin [this message]
2025-04-28 17:07 ` Paolo Abeni
2025-04-28 17:18 ` Michael S. Tsirkin
2025-04-23 16:29 ` Daniel Verkamp
2025-04-23 18:07 ` Michael S. Tsirkin
2025-04-28 8:39 ` Paolo Abeni
2025-04-28 8:47 ` Michael S. Tsirkin
2025-04-29 20:43 ` Michael S. Tsirkin
2025-04-30 4:44 ` Parav Pandit
2025-04-30 5:25 ` Yuri Benditovich
2025-04-30 5:44 ` Parav Pandit
2025-04-30 10:12 ` Paolo Abeni
2025-04-30 10:54 ` Parav Pandit
2025-05-01 13:42 ` Michael S. Tsirkin
2025-05-01 15:57 ` Paolo Abeni
2025-05-06 6:15 ` Parav Pandit
2025-05-06 7:56 ` Michael S. Tsirkin
2025-05-06 8:56 ` Parav Pandit
2025-05-06 14:38 ` Paolo Abeni
2025-05-06 15:00 ` Parav Pandit
2025-05-06 15:40 ` Paolo Abeni
2025-05-06 16:20 ` Parav Pandit
2025-05-07 9:57 ` Paolo Abeni
2025-05-08 6:15 ` Michael S. Tsirkin
2025-05-19 8:57 ` Paolo Abeni
2025-05-19 9:04 ` Parav Pandit
2025-05-19 9:24 ` Paolo Abeni
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=20250428045124-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=cohuck@redhat.com \
--cc=jasowang@redhat.com \
--cc=mvaralar@redhat.com \
--cc=pabeni@redhat.com \
--cc=parav@nvidia.com \
--cc=shahafs@nvidia.com \
--cc=virtio-comment@lists.linux.dev \
--cc=willemb@google.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