* [PATCH] virtio-net: clarify guest offloads <> features mapping
@ 2025-05-19 10:12 Paolo Abeni
2025-05-19 10:21 ` Paolo Abeni
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Paolo Abeni @ 2025-05-19 10:12 UTC (permalink / raw)
To: virtio-comment
Cc: Jason Wang, Willem de Bruijn, mst, Parav Pandit, mvaralar, cohuck
The guest offloads, as specified by 'Setting Offloads State,' use a
64-bit wide space, while some of the corresponding virtio net features
are in the upper 64 bits of a 128-bit wide space.
Clarify the relevant mapping as somewhat implied by the current text.
Also rename the offload definitions to avoid referring to different
numeric values with the same name in the features table and in the
offload table.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
device-types/net/description.tex | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/device-types/net/description.tex b/device-types/net/description.tex
index 1b6b54d..8c501bc 100644
--- a/device-types/net/description.tex
+++ b/device-types/net/description.tex
@@ -2186,8 +2186,8 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
#define VIRTIO_NET_F_GUEST_TSO6 8
#define VIRTIO_NET_F_GUEST_ECN 9
#define VIRTIO_NET_F_GUEST_UFO 10
-#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO 46
-#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM 47
+#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED 46
+#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED 47
#define VIRTIO_NET_F_GUEST_USO4 54
#define VIRTIO_NET_F_GUEST_USO6 55
@@ -2205,6 +2205,9 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
negotiation corresponding offload gets enabled to preserve backward
compatibility.
+Note that device features bits in the [65 to 68] range correspond to
+offload bits in the [46 to 49] range.
+
\drivernormative{\subparagraph}{Setting Offloads State}{Device Types / Network Device / Device Operation / Control Virtqueue / Offloads State Configuration / Setting Offloads State}
A driver MUST NOT enable an offload for which the appropriate feature
--
2.49.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] virtio-net: clarify guest offloads <> features mapping
2025-05-19 10:12 [PATCH] virtio-net: clarify guest offloads <> features mapping Paolo Abeni
@ 2025-05-19 10:21 ` Paolo Abeni
2025-05-19 12:49 ` Michael S. Tsirkin
2025-05-19 15:12 ` Parav Pandit
2025-05-20 0:50 ` Jason Wang
2 siblings, 1 reply; 9+ messages in thread
From: Paolo Abeni @ 2025-05-19 10:21 UTC (permalink / raw)
To: virtio-comment
Cc: Jason Wang, Willem de Bruijn, mst, Parav Pandit, mvaralar, cohuck
On 5/19/25 12:12 PM, Paolo Abeni wrote:
> The guest offloads, as specified by 'Setting Offloads State,' use a
> 64-bit wide space, while some of the corresponding virtio net features
> are in the upper 64 bits of a 128-bit wide space.
>
> Clarify the relevant mapping as somewhat implied by the current text.
> Also rename the offload definitions to avoid referring to different
> numeric values with the same name in the features table and in the
> offload table.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Fixes: https://github.com/oasis-tcs/virtio-spec/issues/225
I would like to ask a vote on this issues, thanks!
Paolo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-net: clarify guest offloads <> features mapping
2025-05-19 10:21 ` Paolo Abeni
@ 2025-05-19 12:49 ` Michael S. Tsirkin
0 siblings, 0 replies; 9+ messages in thread
From: Michael S. Tsirkin @ 2025-05-19 12:49 UTC (permalink / raw)
To: Paolo Abeni
Cc: virtio-comment, Jason Wang, Willem de Bruijn, Parav Pandit,
mvaralar, cohuck
On Mon, May 19, 2025 at 12:21:57PM +0200, Paolo Abeni wrote:
> On 5/19/25 12:12 PM, Paolo Abeni wrote:
> > The guest offloads, as specified by 'Setting Offloads State,' use a
> > 64-bit wide space, while some of the corresponding virtio net features
> > are in the upper 64 bits of a 128-bit wide space.
> >
> > Clarify the relevant mapping as somewhat implied by the current text.
> > Also rename the offload definitions to avoid referring to different
> > numeric values with the same name in the features table and in the
> > offload table.
> >
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
>
> Fixes: https://github.com/oasis-tcs/virtio-spec/issues/225
>
> I would like to ask a vote on this issues, thanks!
>
> Paolo
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Let's give people a couple of days to review pls.
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH] virtio-net: clarify guest offloads <> features mapping
2025-05-19 10:12 [PATCH] virtio-net: clarify guest offloads <> features mapping Paolo Abeni
2025-05-19 10:21 ` Paolo Abeni
@ 2025-05-19 15:12 ` Parav Pandit
2025-05-20 6:44 ` Paolo Abeni
2025-05-20 0:50 ` Jason Wang
2 siblings, 1 reply; 9+ messages in thread
From: Parav Pandit @ 2025-05-19 15:12 UTC (permalink / raw)
To: Paolo Abeni, virtio-comment@lists.linux.dev
Cc: Jason Wang, Willem de Bruijn, mst@redhat.com, mvaralar@redhat.com,
cohuck@redhat.com
Hi Paolo,
> From: Paolo Abeni <pabeni@redhat.com>
> Sent: Monday, May 19, 2025 3:42 PM
>
> The guest offloads, as specified by 'Setting Offloads State,' use a 64-bit wide
> space, while some of the corresponding virtio net features are in the upper 64
> bits of a 128-bit wide space.
>
> Clarify the relevant mapping as somewhat implied by the current text.
> Also rename the offload definitions to avoid referring to different numeric
> values with the same name in the features table and in the offload table.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
> device-types/net/description.tex | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/device-types/net/description.tex b/device-
> types/net/description.tex
> index 1b6b54d..8c501bc 100644
> --- a/device-types/net/description.tex
> +++ b/device-types/net/description.tex
> @@ -2186,8 +2186,8 @@ \subsubsection{Control
> Virtqueue}\label{sec:Device Types / Network Device / Devi
> #define VIRTIO_NET_F_GUEST_TSO6 8
> #define VIRTIO_NET_F_GUEST_ECN 9
> #define VIRTIO_NET_F_GUEST_UFO 10
> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO 46 -#define
> VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM 47
> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED 46 #define
> +VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED 47
Since the offload command is defined only for the rx side, in the below 'Note' should it be only 65-66 map to 46-47?
> #define VIRTIO_NET_F_GUEST_USO4 54
> #define VIRTIO_NET_F_GUEST_USO6 55
>
> @@ -2205,6 +2205,9 @@ \subsubsection{Control
> Virtqueue}\label{sec:Device Types / Network Device / Devi negotiation
> corresponding offload gets enabled to preserve backward compatibility.
>
> +Note that device features bits in the [65 to 68] range correspond to
> +offload bits in the [46 to 49] range.
> +
> \drivernormative{\subparagraph}{Setting Offloads State}{Device Types /
> Network Device / Device Operation / Control Virtqueue / Offloads State
> Configuration / Setting Offloads State}
>
> A driver MUST NOT enable an offload for which the appropriate feature
> --
> 2.49.0
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] virtio-net: clarify guest offloads <> features mapping
2025-05-19 15:12 ` Parav Pandit
@ 2025-05-20 6:44 ` Paolo Abeni
2025-05-20 6:45 ` Parav Pandit
0 siblings, 1 reply; 9+ messages in thread
From: Paolo Abeni @ 2025-05-20 6:44 UTC (permalink / raw)
To: Parav Pandit, virtio-comment@lists.linux.dev
Cc: Jason Wang, Willem de Bruijn, mst@redhat.com, mvaralar@redhat.com,
cohuck@redhat.com
On 5/19/25 5:12 PM, Parav Pandit wrote:
>> From: Paolo Abeni <pabeni@redhat.com>
>> Sent: Monday, May 19, 2025 3:42 PM
>>
>> The guest offloads, as specified by 'Setting Offloads State,' use a 64-bit wide
>> space, while some of the corresponding virtio net features are in the upper 64
>> bits of a 128-bit wide space.
>>
>> Clarify the relevant mapping as somewhat implied by the current text.
>> Also rename the offload definitions to avoid referring to different numeric
>> values with the same name in the features table and in the offload table.
>>
>> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
>> ---
>> device-types/net/description.tex | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/device-types/net/description.tex b/device-
>> types/net/description.tex
>> index 1b6b54d..8c501bc 100644
>> --- a/device-types/net/description.tex
>> +++ b/device-types/net/description.tex
>> @@ -2186,8 +2186,8 @@ \subsubsection{Control
>> Virtqueue}\label{sec:Device Types / Network Device / Devi
>> #define VIRTIO_NET_F_GUEST_TSO6 8
>> #define VIRTIO_NET_F_GUEST_ECN 9
>> #define VIRTIO_NET_F_GUEST_UFO 10
>> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO 46 -#define
>> VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM 47
>> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED 46 #define
>> +VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED 47
> Since the offload command is defined only for the rx side, in the below 'Note' should it be only 65-66 map to 46-47?
Fine by me. I'll wait a bit before sending a v2 to conclude the ongoing
discussion with Jason.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 9+ messages in thread* RE: [PATCH] virtio-net: clarify guest offloads <> features mapping
2025-05-20 6:44 ` Paolo Abeni
@ 2025-05-20 6:45 ` Parav Pandit
0 siblings, 0 replies; 9+ messages in thread
From: Parav Pandit @ 2025-05-20 6:45 UTC (permalink / raw)
To: Paolo Abeni, virtio-comment@lists.linux.dev
Cc: Jason Wang, Willem de Bruijn, mst@redhat.com, mvaralar@redhat.com,
cohuck@redhat.com
> From: Paolo Abeni <pabeni@redhat.com>
> Sent: Tuesday, May 20, 2025 12:14 PM
>
> On 5/19/25 5:12 PM, Parav Pandit wrote:
> >> From: Paolo Abeni <pabeni@redhat.com>
> >> Sent: Monday, May 19, 2025 3:42 PM
> >>
> >> The guest offloads, as specified by 'Setting Offloads State,' use a
> >> 64-bit wide space, while some of the corresponding virtio net
> >> features are in the upper 64 bits of a 128-bit wide space.
> >>
> >> Clarify the relevant mapping as somewhat implied by the current text.
> >> Also rename the offload definitions to avoid referring to different
> >> numeric values with the same name in the features table and in the offload
> table.
> >>
> >> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> >> ---
> >> device-types/net/description.tex | 7 +++++--
> >> 1 file changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/device-types/net/description.tex b/device-
> >> types/net/description.tex index 1b6b54d..8c501bc 100644
> >> --- a/device-types/net/description.tex
> >> +++ b/device-types/net/description.tex
> >> @@ -2186,8 +2186,8 @@ \subsubsection{Control
> >> Virtqueue}\label{sec:Device Types / Network Device / Devi
> >> #define VIRTIO_NET_F_GUEST_TSO6 8
> >> #define VIRTIO_NET_F_GUEST_ECN 9
> >> #define VIRTIO_NET_F_GUEST_UFO 10
> >> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO 46 -#define
> >> VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM 47
> >> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED 46 #define
> >> +VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED 47
> > Since the offload command is defined only for the rx side, in the below 'Note'
> should it be only 65-66 map to 46-47?
>
> Fine by me. I'll wait a bit before sending a v2 to conclude the ongoing
> discussion with Jason.
>
Ok. thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] virtio-net: clarify guest offloads <> features mapping
2025-05-19 10:12 [PATCH] virtio-net: clarify guest offloads <> features mapping Paolo Abeni
2025-05-19 10:21 ` Paolo Abeni
2025-05-19 15:12 ` Parav Pandit
@ 2025-05-20 0:50 ` Jason Wang
2025-05-20 6:39 ` Paolo Abeni
2 siblings, 1 reply; 9+ messages in thread
From: Jason Wang @ 2025-05-20 0:50 UTC (permalink / raw)
To: Paolo Abeni
Cc: virtio-comment, Willem de Bruijn, mst, Parav Pandit, mvaralar,
cohuck
On Mon, May 19, 2025 at 6:12 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> The guest offloads, as specified by 'Setting Offloads State,' use a
> 64-bit wide space, while some of the corresponding virtio net features
> are in the upper 64 bits of a 128-bit wide space.
>
> Clarify the relevant mapping as somewhat implied by the current text.
> Also rename the offload definitions to avoid referring to different
> numeric values with the same name in the features table and in the
> offload table.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
> device-types/net/description.tex | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/device-types/net/description.tex b/device-types/net/description.tex
> index 1b6b54d..8c501bc 100644
> --- a/device-types/net/description.tex
> +++ b/device-types/net/description.tex
> @@ -2186,8 +2186,8 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
> #define VIRTIO_NET_F_GUEST_TSO6 8
> #define VIRTIO_NET_F_GUEST_ECN 9
> #define VIRTIO_NET_F_GUEST_UFO 10
> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO 46
> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM 47
> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED 46
> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED 47
As the introduction of more offload features in the future, I wonder
if it's better to just avoid reusing feature names here.
For example, rename all here to something like
VIRTIO_NET_CTRL_GUEST_OFFLOAD_TSO6
...
Or introduce a new command to be as wide as the feature bits.
> #define VIRTIO_NET_F_GUEST_USO4 54
> #define VIRTIO_NET_F_GUEST_USO6 55
>
> @@ -2205,6 +2205,9 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
> negotiation corresponding offload gets enabled to preserve backward
> compatibility.
>
> +Note that device features bits in the [65 to 68] range correspond to
> +offload bits in the [46 to 49] range.
> +
> \drivernormative{\subparagraph}{Setting Offloads State}{Device Types / Network Device / Device Operation / Control Virtqueue / Offloads State Configuration / Setting Offloads State}
>
> A driver MUST NOT enable an offload for which the appropriate feature
> --
> 2.49.0
>
Thanks
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] virtio-net: clarify guest offloads <> features mapping
2025-05-20 0:50 ` Jason Wang
@ 2025-05-20 6:39 ` Paolo Abeni
2025-05-21 1:05 ` Jason Wang
0 siblings, 1 reply; 9+ messages in thread
From: Paolo Abeni @ 2025-05-20 6:39 UTC (permalink / raw)
To: Jason Wang
Cc: virtio-comment, Willem de Bruijn, mst, Parav Pandit, mvaralar,
cohuck
On 5/20/25 2:50 AM, Jason Wang wrote:
> On Mon, May 19, 2025 at 6:12 PM Paolo Abeni <pabeni@redhat.com> wrote:
>> The guest offloads, as specified by 'Setting Offloads State,' use a
>> 64-bit wide space, while some of the corresponding virtio net features
>> are in the upper 64 bits of a 128-bit wide space.
>>
>> Clarify the relevant mapping as somewhat implied by the current text.
>> Also rename the offload definitions to avoid referring to different
>> numeric values with the same name in the features table and in the
>> offload table.
>>
>> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
>> ---
>> device-types/net/description.tex | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/device-types/net/description.tex b/device-types/net/description.tex
>> index 1b6b54d..8c501bc 100644
>> --- a/device-types/net/description.tex
>> +++ b/device-types/net/description.tex
>> @@ -2186,8 +2186,8 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
>> #define VIRTIO_NET_F_GUEST_TSO6 8
>> #define VIRTIO_NET_F_GUEST_ECN 9
>> #define VIRTIO_NET_F_GUEST_UFO 10
>> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO 46
>> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM 47
>> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED 46
>> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED 47
>
> As the introduction of more offload features in the future, I wonder
> if it's better to just avoid reusing feature names here.
No strong objections, but than it would make less clear the 1to1 mapping
between offloads and features.
> For example, rename all here to something like
>
> VIRTIO_NET_CTRL_GUEST_OFFLOAD_TSO6
> ...
>
> Or introduce a new command to be as wide as the feature bits.
I would prefer to avoid such additional specification and code churn,
especially given there is already a lot of stuff pending due to the
features space extension. Note that the benefit will be limited, as
there are a lot of bits available in the 'offloads' field and we could
easily map more features, as needed.
I think the new command should be added as a last resort after
'offloads' space exhaustion (hopefully far in the future).
Cheers,
Paolo
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] virtio-net: clarify guest offloads <> features mapping
2025-05-20 6:39 ` Paolo Abeni
@ 2025-05-21 1:05 ` Jason Wang
0 siblings, 0 replies; 9+ messages in thread
From: Jason Wang @ 2025-05-21 1:05 UTC (permalink / raw)
To: Paolo Abeni
Cc: virtio-comment, Willem de Bruijn, mst, Parav Pandit, mvaralar,
cohuck
On Tue, May 20, 2025 at 2:39 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> On 5/20/25 2:50 AM, Jason Wang wrote:
> > On Mon, May 19, 2025 at 6:12 PM Paolo Abeni <pabeni@redhat.com> wrote:
> >> The guest offloads, as specified by 'Setting Offloads State,' use a
> >> 64-bit wide space, while some of the corresponding virtio net features
> >> are in the upper 64 bits of a 128-bit wide space.
> >>
> >> Clarify the relevant mapping as somewhat implied by the current text.
> >> Also rename the offload definitions to avoid referring to different
> >> numeric values with the same name in the features table and in the
> >> offload table.
> >>
> >> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> >> ---
> >> device-types/net/description.tex | 7 +++++--
> >> 1 file changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/device-types/net/description.tex b/device-types/net/description.tex
> >> index 1b6b54d..8c501bc 100644
> >> --- a/device-types/net/description.tex
> >> +++ b/device-types/net/description.tex
> >> @@ -2186,8 +2186,8 @@ \subsubsection{Control Virtqueue}\label{sec:Device Types / Network Device / Devi
> >> #define VIRTIO_NET_F_GUEST_TSO6 8
> >> #define VIRTIO_NET_F_GUEST_ECN 9
> >> #define VIRTIO_NET_F_GUEST_UFO 10
> >> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO 46
> >> -#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM 47
> >> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_MAPPED 46
> >> +#define VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO_CSUM_MAPPED 47
> >
> > As the introduction of more offload features in the future, I wonder
> > if it's better to just avoid reusing feature names here.
>
> No strong objections, but than it would make less clear the 1to1 mapping
> between offloads and features.
Right, so let's start from the patch.
>
> > For example, rename all here to something like
> >
> > VIRTIO_NET_CTRL_GUEST_OFFLOAD_TSO6
> > ...
> >
> > Or introduce a new command to be as wide as the feature bits.
>
> I would prefer to avoid such additional specification and code churn,
> especially given there is already a lot of stuff pending due to the
> features space extension. Note that the benefit will be limited, as
> there are a lot of bits available in the 'offloads' field and we could
> easily map more features, as needed.
>
> I think the new command should be added as a last resort after
> 'offloads' space exhaustion (hopefully far in the future).
Agree.
>
> Cheers,
>
> Paolo
>
>
Thanks
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-05-21 1:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 10:12 [PATCH] virtio-net: clarify guest offloads <> features mapping Paolo Abeni
2025-05-19 10:21 ` Paolo Abeni
2025-05-19 12:49 ` Michael S. Tsirkin
2025-05-19 15:12 ` Parav Pandit
2025-05-20 6:44 ` Paolo Abeni
2025-05-20 6:45 ` Parav Pandit
2025-05-20 0:50 ` Jason Wang
2025-05-20 6:39 ` Paolo Abeni
2025-05-21 1:05 ` Jason Wang
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.