[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/16] vhost-net: vq reset feature bit support
From: |
Kangjie Xu |
Subject: |
[PATCH 16/16] vhost-net: vq reset feature bit support |
Date: |
Mon, 18 Jul 2022 19:17:13 +0800 |
Add support for negotation of vq reset feature bit.
Signed-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com>
Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
---
hw/net/vhost_net.c | 1 +
hw/net/virtio-net.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 4f5f034c11..de910f6466 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -73,6 +73,7 @@ static const int user_feature_bits[] = {
VIRTIO_NET_F_MTU,
VIRTIO_F_IOMMU_PLATFORM,
VIRTIO_F_RING_PACKED,
+ VIRTIO_F_RING_RESET,
VIRTIO_NET_F_RSS,
VIRTIO_NET_F_HASH_REPORT,
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 0747ffe71c..a8b299067a 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -757,6 +757,8 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev,
uint64_t features,
virtio_add_feature(&features, VIRTIO_NET_F_MAC);
+ virtio_add_feature(&features, VIRTIO_F_RING_RESET);
+
if (!peer_has_vnet_hdr(n)) {
virtio_clear_feature(&features, VIRTIO_NET_F_CSUM);
virtio_clear_feature(&features, VIRTIO_NET_F_HOST_TSO4);
@@ -777,7 +779,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev,
uint64_t features,
}
if (!get_vhost_net(nc->peer)) {
- virtio_add_feature(&features, VIRTIO_F_RING_RESET);
return features;
}
--
2.32.0
[PATCH 10/16] vhost: extract the logic of unmapping the vrings and desc, Kangjie Xu, 2022/07/18
[PATCH 16/16] vhost-net: vq reset feature bit support,
Kangjie Xu <=
[PATCH 01/16] virtio-pci: virtio_pci_common_cfg add queue_notify_data, Kangjie Xu, 2022/07/18
[PATCH 05/16] virtio: introduce virtio_queue_reset(), Kangjie Xu, 2022/07/18
[PATCH 11/16] vhost: introduce restart and release for vhost_dev's vqs, Kangjie Xu, 2022/07/18