Skip to contentSkip to conversation

VIRTIO_NET_HDR_F_RSC_INFO in virtio-net vs headers update

DISCUSSION Cornelia Huck 4 participants 6 messages Apr 27, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

I'm currently trying to prepare a linux-headers update to 5.7-rc3, which adds the definition of VIRTIO_NET_HDR_F_RSC_INFO.

Unfortunately, this breaks the build of virtio-net, because now virtio_net_rsc_ext_num_{packets,dupacks} are undefined (they are guarded by existence of VIRTIO_NET_HDR_F_RSC_INFO).

What is the right way to fix this? Remove the constants that are now provided by the header and keep the definitions of virtio_net_rsc_ext_num_{packets,dupacks}?

[I'd like to queue a headers update as soon as possible, as the whole s390 protected virt stuff depends on it...]

#1 lore raw
Quoted 5 lines · Cornelia Huck

Hi,

I'm currently trying to prepare a linux-headers update to 5.7-rc3, which adds the definition of VIRTIO_NET_HDR_F_RSC_INFO.

Quoted 7 lines

Unfortunately, this breaks the build of virtio-net, because now virtio_net_rsc_ext_num_{packets,dupacks} are undefined (they are guarded by existence of VIRTIO_NET_HDR_F_RSC_INFO).

What is the right way to fix this? Remove the constants that are now provided by the header and keep the definitions of virtio_net_rsc_ext_num_{packets,dupacks}?

We probably need to add a version of the above function when VIRTIO_NET_HDR_F_RSC_INFO is defined as attached.

But I fail to understand why we need a fallback when VIRTIO_NET_HDR_F_RSC_INFO is not defined.

Thanks

Quoted 5 lines

[I'd like to queue a headers update as soon as possible, as the whole s390 protected virt stuff depends on it...]

From 915144149cfef1c056ae3b96dfb714a2bd483759 Mon Sep 17 00:00:00 2001
From: Jason Wang <[email protected]>
Date: Mon, 27 Apr 2020 16:38:51 +0800
Subject: [PATCH]

---
 hw/net/virtio-net.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
hw/net/virtio-net.c +14 -0
index e5bf670c3f..dd671bcc0d 100644
@@ -171,6 +171,20 @@ static inline __virtio16 *virtio_net_rsc_ext_num_dupacks(
     return &hdr->csum_offset;
 }
 
+#else
+
+static inline __virtio16 *virtio_net_rsc_ext_num_packets(
+    struct virtio_net_hdr *hdr)
+{
+    return &hdr->segments;
+}
+
+static inline __virtio16 *virtio_net_rsc_ext_num_dupacks(
+    struct virtio_net_hdr *hdr)
+{
+    return &hdr->dup_acks;
+}
+
 #endif
 
 static VirtIOFeature feature_sizes[] = {
Signature · 1 line
2.20.1
#2 lore raw
Quoted 16 lines · On Mon, 27 Apr 2020 16:41:30 +0800 Jason Wang <[email protected]> wrote:
Quoted 5 lines · Cornelia Huck

Hi,

I'm currently trying to prepare a linux-headers update to 5.7-rc3, which adds the definition of VIRTIO_NET_HDR_F_RSC_INFO.

Quoted 7 lines

Unfortunately, this breaks the build of virtio-net, because now virtio_net_rsc_ext_num_{packets,dupacks} are undefined (they are guarded by existence of VIRTIO_NET_HDR_F_RSC_INFO).

What is the right way to fix this? Remove the constants that are now provided by the header and keep the definitions of virtio_net_rsc_ext_num_{packets,dupacks}?

Quoted 5 lines

We probably need to add a version of the above function when VIRTIO_NET_HDR_F_RSC_INFO is defined as attached.

But I fail to understand why we need a fallback when VIRTIO_NET_HDR_F_RSC_INFO is not defined.

Yes, the current code in virtio-net looks a bit odd, which is why I asked.

I see two options:
- do the change you proposed, do the headers update, and then rip out the compat handling
- do the above in a single step

I'd prefer the second option.

Quoted 9 lines

Thanks

Quoted 5 lines

[I'd like to queue a headers update as soon as possible, as the whole s390 protected virt stuff depends on it...]

#3 lore raw
Quoted 28 lines · Cornelia Huck
Quoted 16 lines · On Mon, 27 Apr 2020 16:41:30 +0800 Jason Wang <[email protected]> wrote:
Quoted 5 lines · Cornelia Huck

Hi,

I'm currently trying to prepare a linux-headers update to 5.7-rc3, which adds the definition of VIRTIO_NET_HDR_F_RSC_INFO.

Quoted 7 lines

Unfortunately, this breaks the build of virtio-net, because now virtio_net_rsc_ext_num_{packets,dupacks} are undefined (they are guarded by existence of VIRTIO_NET_HDR_F_RSC_INFO).

What is the right way to fix this? Remove the constants that are now provided by the header and keep the definitions of virtio_net_rsc_ext_num_{packets,dupacks}?

Quoted 5 lines

We probably need to add a version of the above function when VIRTIO_NET_HDR_F_RSC_INFO is defined as attached.

But I fail to understand why we need a fallback when VIRTIO_NET_HDR_F_RSC_INFO is not defined.

Yes, the current code in virtio-net looks a bit odd, which is why I asked.

Quoted 6 lines

I see two options:
- do the change you proposed, do the headers update, and then rip out the compat handling
- do the above in a single step

I'd prefer the second option.

Slight preference for 1st one but both are ok.

Quoted 9 lines
Quoted 9 lines

Thanks

Quoted 5 lines

[I'd like to queue a headers update as soon as possible, as the whole s390 protected virt stuff depends on it...]

#4 lore raw

I'd suggest to do the single change in virtio-net.c with RSC definitions from updated linux headers.
I can send respective patch if you want

Quoted 49 lines · Michael S. Tsirkin
Quoted 28 lines · Cornelia Huck
Quoted 16 lines · On Mon, 27 Apr 2020 16:41:30 +0800 Jason Wang <[email protected]> wrote:
Quoted 5 lines · Cornelia Huck

Hi,

I'm currently trying to prepare a linux-headers update to 5.7-rc3, which adds the definition of VIRTIO_NET_HDR_F_RSC_INFO.

Quoted 7 lines

Unfortunately, this breaks the build of virtio-net, because now virtio_net_rsc_ext_num_{packets,dupacks} are undefined (they are guarded by existence of VIRTIO_NET_HDR_F_RSC_INFO).

What is the right way to fix this? Remove the constants that are now provided by the header and keep the definitions of virtio_net_rsc_ext_num_{packets,dupacks}?

Quoted 5 lines

We probably need to add a version of the above function when VIRTIO_NET_HDR_F_RSC_INFO is defined as attached.

But I fail to understand why we need a fallback when VIRTIO_NET_HDR_F_RSC_INFO is not defined.

Yes, the current code in virtio-net looks a bit odd, which is why I asked.

Quoted 6 lines

I see two options:
- do the change you proposed, do the headers update, and then rip out the compat handling
- do the above in a single step

I'd prefer the second option.

Slight preference for 1st one but both are ok.

Quoted 9 lines
Quoted 9 lines

Thanks

Quoted 5 lines

[I'd like to queue a headers update as soon as possible, as the whole s390 protected virt stuff depends on it...]

#5 lore raw
Quoted 3 lines · On Mon, 27 Apr 2020 12:52:26 +0300 Yuri Benditovich…

I'd suggest to do the single change in virtio-net.c with RSC definitions from updated linux headers.
I can send respective patch if you want

Hm, I already sent something out before I saw your mail... can you please look at that one?