[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 15/19] vdpa: add NetClientState->start() callback
From: |
Eugenio Pérez |
Subject: |
[RFC PATCH v3 15/19] vdpa: add NetClientState->start() callback |
Date: |
Wed, 30 Mar 2022 20:31:12 +0200 |
It allows to inject custom code on device success start, right before
release lock.
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
include/net/net.h | 2 ++
hw/net/vhost_net.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/include/net/net.h b/include/net/net.h
index 523136c7ac..2fc3002ab4 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -44,6 +44,7 @@ typedef struct NICConf {
typedef void (NetPoll)(NetClientState *, bool enable);
typedef bool (NetCanReceive)(NetClientState *);
+typedef void (NetStart)(NetClientState *);
typedef ssize_t (NetReceive)(NetClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int);
typedef void (NetCleanup) (NetClientState *);
@@ -71,6 +72,7 @@ typedef struct NetClientInfo {
NetReceive *receive_raw;
NetReceiveIOV *receive_iov;
NetCanReceive *can_receive;
+ NetStart *start;
NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
QueryRxFilter *query_rx_filter;
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 30379d2ca4..44a105ec29 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -274,6 +274,10 @@ static int vhost_net_start_one(struct vhost_net *net,
}
}
}
+
+ if (net->nc->info->start) {
+ net->nc->info->start(net->nc);
+ }
return 0;
fail:
file.fd = -1;
--
2.27.0
- [RFC PATCH v3 06/19] virtio-net: Expose ctrl virtqueue logic, (continued)
- [RFC PATCH v3 06/19] virtio-net: Expose ctrl virtqueue logic, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 05/19] virtio-net: use g_memdup2() instead of unsafe g_memdup(), Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 04/19] vdpa: Fix index calculus at vhost_vdpa_svqs_start, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 02/19] vdpa: Add x-svq to NetdevVhostVDPAOptions, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 07/19] vdpa: Extract get geatures part from vhost_vdpa_get_max_queue_pairs, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 08/19] virtio: Make virtqueue_alloc_element non-static, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 09/19] vhost: Add SVQElement, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 10/19] vhost: Add custom used buffer callback, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 11/19] vdpa: control virtqueue support on shadow virtqueue, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 12/19] vhost: Add vhost_iova_tree_find, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 15/19] vdpa: add NetClientState->start() callback,
Eugenio Pérez <=
- [RFC PATCH v3 14/19] vhost: Add vhost_svq_inject, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 13/19] vdpa: Add map/unmap operation callback to SVQ, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 17/19] vhost: Update kernel headers, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 16/19] vdpa: Add vhost_vdpa_start_control_svq, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 18/19] vdpa: Add asid attribute to vdpa device, Eugenio Pérez, 2022/03/30
- [RFC PATCH v3 19/19] vdpa: Add x-cvq-svq, Eugenio Pérez, 2022/03/30