Skip to content
Snippets Groups Projects
Commit 44b416ad authored by Dr. David Alan Gilbert's avatar Dr. David Alan Gilbert Committed by Jason Wang
Browse files

net: Add a network device specific self-announcement ability


Some network devices have a capability to do self announcements
(ex: virtio-net).  Add infrastructure that would allow devices
to expose this ability.

Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
parent 7659505c
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,7 @@ typedef int (SetVnetLE)(NetClientState *, bool);
typedef int (SetVnetBE)(NetClientState *, bool);
typedef struct SocketReadState SocketReadState;
typedef void (SocketReadStateFinalize)(SocketReadState *rs);
typedef void (NetAnnounce)(NetClientState *);
typedef struct NetClientInfo {
NetClientDriver type;
......@@ -80,6 +81,7 @@ typedef struct NetClientInfo {
SetVnetHdrLen *set_vnet_hdr_len;
SetVnetLE *set_vnet_le;
SetVnetBE *set_vnet_be;
NetAnnounce *announce;
} NetClientInfo;
struct NetClientState {
......
......@@ -102,6 +102,11 @@ static void qemu_announce_self_iter(NICState *nic, void *opaque)
len = announce_self_create(buf, nic->conf->macaddr.a);
qemu_send_packet_raw(qemu_get_queue(nic), buf, len);
/* if the NIC provides it's own announcement support, use it as well */
if (nic->ncs->info->announce) {
nic->ncs->info->announce(nic->ncs);
}
}
static void qemu_announce_self_once(void *opaque)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment