[PATCH v2] virtio-net: clarify guest offloads <> features mapping

Paolo Abeni <[email protected]>
Newsgroups dev.linux.lists.virtio-comment
Message-ID <6af50c9ada76d8168d248827e4af7c44bdfa34a8.1747826378.git.pabeni@redhat.com>
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.

Fixes: https://github.com/oasis-tcs/virtio-spec/issues/225
Signed-off-by: Paolo Abeni <[email protected]>
---
v1 -> v2:
  - restrict the mapped range to the guest offload (Parav)
  v1: https://lore.kernel.org/virtio-comment/a30de484ff56065f56e37446e08dcdfa4850f101.1747649330.git.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..9712e83 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 66] range correspond to
+offload bits in the [46 to 47] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.