All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guo Zhi <qtxuning1999@sjtu.edu.cn>
To: eperezma@redhat.com, jasowang@redhat.com, sgarzare@redhat.com,
	mst@redhat.com
Cc: qemu-devel@nongnu.org, Guo Zhi <qtxuning1999@sjtu.edu.cn>
Subject: [RFC 2/2] virtio: enable f_in_order feature for virtio-net
Date: Thu, 18 Aug 2022 23:12:44 +0800	[thread overview]
Message-ID: <20220818151244.2050-3-qtxuning1999@sjtu.edu.cn> (raw)
In-Reply-To: <20220818151244.2050-1-qtxuning1999@sjtu.edu.cn>

In order feature is not a transparent feature in QEMU, only specific
devices(eg, virtio-net) support it.

Signed-off-by: Guo Zhi <qtxuning1999@sjtu.edu.cn>
---
 hw/net/virtio-net.c        | 1 +
 include/hw/virtio/virtio.h | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index c8e83921..cf0b23d8 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -719,6 +719,7 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
     features |= n->host_features;
 
     virtio_add_feature(&features, VIRTIO_NET_F_MAC);
+    virtio_add_feature(&features, VIRTIO_F_IN_ORDER);
 
     if (!peer_has_vnet_hdr(n)) {
         virtio_clear_feature(&features, VIRTIO_NET_F_CSUM);
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index db1c0ddf..578f22c8 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -291,7 +291,9 @@ typedef struct VirtIORNGConf VirtIORNGConf;
     DEFINE_PROP_BIT64("iommu_platform", _state, _field, \
                       VIRTIO_F_IOMMU_PLATFORM, false), \
     DEFINE_PROP_BIT64("packed", _state, _field, \
-                      VIRTIO_F_RING_PACKED, false)
+                      VIRTIO_F_RING_PACKED, false), \
+    DEFINE_PROP_BIT64("in_order", _state, _field, \
+                      VIRTIO_F_IN_ORDER, false)
 
 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
 bool virtio_queue_enabled_legacy(VirtIODevice *vdev, int n);
-- 
2.17.1



  parent reply	other threads:[~2022-08-18 15:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 15:12 [RFC 0/2] Virtio in order feature support for virtio-net device Guo Zhi
2022-08-18 15:12 ` [RFC 1/2] virtio: expose used buffers Guo Zhi
2022-08-22 14:08   ` Eugenio Perez Martin
2022-08-25  7:15     ` Guo Zhi
2022-08-25  8:59       ` Eugenio Perez Martin
2022-08-25  6:06   ` Jason Wang
2022-08-26  3:05     ` Guo Zhi
2022-08-18 15:12 ` Guo Zhi [this message]
2022-08-25  6:08 ` [RFC 0/2] Virtio in order feature support for virtio-net device Jason Wang

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=20220818151244.2050-3-qtxuning1999@sjtu.edu.cn \
    --to=qtxuning1999@sjtu.edu.cn \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.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 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.