Skip to content

Commit

Permalink
hw/xen: update Xen PV NIC to XenDevice model
Browse files Browse the repository at this point in the history
This allows us to use Xen PV networking with emulated Xen guests, and to
add them on the command line or hotplug.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
  • Loading branch information
dwmw2 committed Nov 7, 2023
1 parent 25511f3 commit 25967ff
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 117 deletions.
2 changes: 1 addition & 1 deletion hw/net/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
system_ss.add(when: 'CONFIG_DP8393X', if_true: files('dp8393x.c'))
system_ss.add(when: 'CONFIG_XEN', if_true: files('xen_nic.c'))
system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen_nic.c'))
system_ss.add(when: 'CONFIG_NE2000_COMMON', if_true: files('ne2000.c'))

# PCI network cards
Expand Down
11 changes: 11 additions & 0 deletions hw/net/trace-events
Original file line number Diff line number Diff line change
Expand Up @@ -482,3 +482,14 @@ dp8393x_receive_oversize(int size) "oversize packet, pkt_size is %d"
dp8393x_receive_not_netcard(void) "packet not for netcard"
dp8393x_receive_packet(int crba) "Receive packet at 0x%"PRIx32
dp8393x_receive_write_status(int crba) "Write status at 0x%"PRIx32

# xen_nic.c
xen_netdev_realize(int dev, const char *info, const char *peer) "vif%u info '%s' peer '%s'"
xen_netdev_unrealize(int dev) "vif%u"
xen_netdev_create(int dev) "vif%u"
xen_netdev_destroy(int dev) "vif%u"
xen_netdev_disconnect(int dev) "vif%u"
xen_netdev_connect(int dev, unsigned int tx, unsigned int rx, int port) "vif%u tx %u rx %u port %u"
xen_netdev_frontend_changed(const char *dev, int state) "vif%s state %d"
xen_netdev_tx(int dev, int ref, int off, int len, unsigned int flags, const char *c, const char *d, const char *m, const char *e) "vif%u ref %u off %u len %u flags 0x%x%s%s%s%s"
xen_netdev_rx(int dev, int idx, int status, int flags) "vif%u idx %d status %d flags 0x%x"

0 comments on commit 25967ff

Please sign in to comment.