[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 39/41] vhost_net: introduce set_config & get_config
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 39/41] vhost_net: introduce set_config & get_config |
Date: |
Sat, 4 Jul 2020 14:31:03 -0400 |
From: Cindy Lu <lulu@redhat.com>
This patch introduces set_config & get_config method which allows
vhost_net set/get the config to backend
Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20200701145538.22333-13-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
---
include/net/vhost_net.h | 5 +++++
hw/net/vhost_net-stub.c | 11 +++++++++++
hw/net/vhost_net.c | 10 ++++++++++
3 files changed, 26 insertions(+)
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index 77e47398c4..172b0051d8 100644
--- a/include/net/vhost_net.h
+++ b/include/net/vhost_net.h
@@ -28,6 +28,11 @@ void vhost_net_cleanup(VHostNetState *net);
uint64_t vhost_net_get_features(VHostNetState *net, uint64_t features);
void vhost_net_ack_features(VHostNetState *net, uint64_t features);
+int vhost_net_get_config(struct vhost_net *net, uint8_t *config,
+ uint32_t config_len);
+
+int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,
+ uint32_t offset, uint32_t size, uint32_t flags);
bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
int idx, bool mask);
diff --git a/hw/net/vhost_net-stub.c b/hw/net/vhost_net-stub.c
index aac0e98228..a7f4252630 100644
--- a/hw/net/vhost_net-stub.c
+++ b/hw/net/vhost_net-stub.c
@@ -52,6 +52,17 @@ uint64_t vhost_net_get_features(struct vhost_net *net,
uint64_t features)
return features;
}
+int vhost_net_get_config(struct vhost_net *net, uint8_t *config,
+ uint32_t config_len)
+{
+ return 0;
+}
+int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,
+ uint32_t offset, uint32_t size, uint32_t flags)
+{
+ return 0;
+}
+
void vhost_net_ack_features(struct vhost_net *net, uint64_t features)
{
}
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 4096d64aaf..4561665f6b 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -110,6 +110,16 @@ uint64_t vhost_net_get_features(struct vhost_net *net,
uint64_t features)
return vhost_get_features(&net->dev, vhost_net_get_feature_bits(net),
features);
}
+int vhost_net_get_config(struct vhost_net *net, uint8_t *config,
+ uint32_t config_len)
+{
+ return vhost_dev_get_config(&net->dev, config, config_len);
+}
+int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,
+ uint32_t offset, uint32_t size, uint32_t flags)
+{
+ return vhost_dev_set_config(&net->dev, data, offset, size, flags);
+}
void vhost_net_ack_features(struct vhost_net *net, uint64_t features)
{
--
MST
- [PULL v2 31/41] virtio-pci: implement queue_enabled method, (continued)
- [PULL v2 32/41] vhost: check the existence of vhost_set_iotlb_callback, Michael S. Tsirkin, 2020/07/04
- [PULL v2 33/41] vhost: introduce new VhostOps vhost_dev_start, Michael S. Tsirkin, 2020/07/04
- [PULL v2 34/41] vhost: implement vhost_dev_start method, Michael S. Tsirkin, 2020/07/04
- [PULL v2 35/41] vhost: introduce new VhostOps vhost_vq_get_addr, Michael S. Tsirkin, 2020/07/04
- [PULL v2 36/41] vhost: implement vhost_vq_get_addr method, Michael S. Tsirkin, 2020/07/04
- [PULL v2 37/41] vhost: introduce new VhostOps vhost_force_iommu, Michael S. Tsirkin, 2020/07/04
- [PULL v2 39/41] vhost_net: introduce set_config & get_config,
Michael S. Tsirkin <=
- [PULL v2 38/41] vhost: implement vhost_force_iommu method, Michael S. Tsirkin, 2020/07/04
- [PULL v2 40/41] vhost-vdpa: introduce vhost-vdpa backend, Michael S. Tsirkin, 2020/07/04
- [PULL v2 41/41] vhost-vdpa: introduce vhost-vdpa net client, Michael S. Tsirkin, 2020/07/04
- [PULL v2 21/41] virtio-mem: Migration sanity checks, Michael S. Tsirkin, 2020/07/04
- Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Peter Maydell, 2020/07/07
- Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Michael S. Tsirkin, 2020/07/07
- Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Peter Maydell, 2020/07/07
- Re: [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Michael S. Tsirkin, 2020/07/08