57 lines
2.0 KiB
Diff
57 lines
2.0 KiB
Diff
|
|
From 0ae5aeef8aa5bf2d32fdf393cf66c36172c3e974 Mon Sep 17 00:00:00 2001
|
||
|
|
From: fangyi <eric.fangyi@huawei.com>
|
||
|
|
Date: Thu, 16 Nov 2023 09:54:53 +0800
|
||
|
|
Subject: [PATCH] virtio-net: add support for configure interrupt
|
||
|
|
|
||
|
|
Add functions to support configure interrupt in virtio_net
|
||
|
|
The functions are config_pending and config_mask, while
|
||
|
|
this input idx is VIRTIO_CONFIG_IRQ_IDX will check the
|
||
|
|
function of configure interrupt.
|
||
|
|
|
||
|
|
Signed-off-by: Cindy Lu <lulu@redhat.com>
|
||
|
|
Message-Id: <20211104164827.21911-9-lulu@redhat.com>
|
||
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
|
Signed-off-by: fangyi <eric.fangyi@huawei.com>
|
||
|
|
---
|
||
|
|
hw/net/vhost_net.c | 9 +++++++++
|
||
|
|
include/net/vhost_net.h | 2 ++
|
||
|
|
2 files changed, 11 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
|
||
|
|
index bea053a742..d5a92144bb 100644
|
||
|
|
--- a/hw/net/vhost_net.c
|
||
|
|
+++ b/hw/net/vhost_net.c
|
||
|
|
@@ -524,6 +524,15 @@ void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
|
||
|
|
vhost_virtqueue_mask(&net->dev, dev, idx, mask);
|
||
|
|
}
|
||
|
|
|
||
|
|
+bool vhost_net_config_pending(VHostNetState *net)
|
||
|
|
+{
|
||
|
|
+ return vhost_config_pending(&net->dev);
|
||
|
|
+}
|
||
|
|
+
|
||
|
|
+void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mask)
|
||
|
|
+{
|
||
|
|
+ vhost_config_mask(&net->dev, dev, mask);
|
||
|
|
+}
|
||
|
|
VHostNetState *get_vhost_net(NetClientState *nc)
|
||
|
|
{
|
||
|
|
VHostNetState *vhost_net = 0;
|
||
|
|
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
|
||
|
|
index 7bdbf484e4..1844f0ed46 100644
|
||
|
|
--- a/include/net/vhost_net.h
|
||
|
|
+++ b/include/net/vhost_net.h
|
||
|
|
@@ -39,6 +39,8 @@ int vhost_net_set_config(struct vhost_net *net, const uint8_t *data,
|
||
|
|
bool vhost_net_virtqueue_pending(VHostNetState *net, int n);
|
||
|
|
void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev,
|
||
|
|
int idx, bool mask);
|
||
|
|
+bool vhost_net_config_pending(VHostNetState *net);
|
||
|
|
+void vhost_net_config_mask(VHostNetState *net, VirtIODevice *dev, bool mask);
|
||
|
|
int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr);
|
||
|
|
VHostNetState *get_vhost_net(NetClientState *nc);
|
||
|
|
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|