qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	 Yuri Benditovich <yuri.benditovich@daynix.com>
Cc: qemu-devel@nongnu.org
Subject: Re: VIRTIO_NET_HDR_F_RSC_INFO in virtio-net vs headers update
Date: Mon, 27 Apr 2020 16:41:30 +0800	[thread overview]
Message-ID: <8a559698-fb15-1f38-2fad-ee5db27f81f4@redhat.com> (raw)
In-Reply-To: <20200427093345.4111acd9.cohuck@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]


On 2020/4/27 下午3:33, Cornelia Huck wrote:
> 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}?


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


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

[-- Attachment #2: 0001-.patch --]
[-- Type: text/x-patch, Size: 833 bytes --]

From 915144149cfef1c056ae3b96dfb714a2bd483759 Mon Sep 17 00:00:00 2001
From: Jason Wang <jasowang@redhat.com>
Date: Mon, 27 Apr 2020 16:38:51 +0800
Subject: [PATCH]

---
 hw/net/virtio-net.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index e5bf670c3f..dd671bcc0d 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -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[] = {
-- 
2.20.1


  reply	other threads:[~2020-04-27  8:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  7:33 VIRTIO_NET_HDR_F_RSC_INFO in virtio-net vs headers update Cornelia Huck
2020-04-27  8:41 ` Jason Wang [this message]
2020-04-27  9:10   ` Cornelia Huck
2020-04-27  9:18     ` Michael S. Tsirkin
2020-04-27  9:52       ` Yuri Benditovich
2020-04-27 10:38         ` Cornelia Huck

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=8a559698-fb15-1f38-2fad-ee5db27f81f4@redhat.com \
    --to=jasowang@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yuri.benditovich@daynix.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;
as well as URLs for NNTP newsgroup(s).