xen nic: use qemu_malloc
PATCH 1/1 xen nic: use qemu_malloc
Signed-off-by Gerd Hoffmann <[email protected]>
--- hw/xen_nic.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
hw/xen_nic.c +2 -2
@@ -176,7 +176,7 @@ static void net_tx_packets(struct XenNetDev *netdev)if (txreq.flags & NETTXF_csum_blank) {/* have read-only mapping -> can't fill checksum in-place */ if (!tmpbuf) - tmpbuf =malloc (PAGE_SIZE ); + tmpbuf =qemu_malloc (PAGE_SIZE );memcpy (tmpbuf, page + txreq.offset, txreq.size);net_checksum_calculate (tmpbuf, txreq.size);qemu_send_packet (netdev->vs, tmpbuf, txreq.size);
@@ -190,7 +190,7 @@ static void net_tx_packets(struct XenNetDev *netdev)break ; netdev->tx_work =0 ; } -free (tmpbuf); +qemu_free (tmpbuf); }/* ------------------------------------------------------------- */
Signature · 1 line
1.6.2.2
PATCH 1/1 xen nic: check tx queue after connect.
Needed for savevm/loadvm + migration: In that case the queue might already have packets on (re-)connect. The guest wouldn't notify us because notifications are only sent when stuffing a packet into an empty queue.
Signed-off-by Gerd Hoffmann <[email protected]>
--- hw/xen_nic.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
hw/xen_nic.c +2 -0
@@ -354,6 +354,8 @@ static int net_connect(struct XenDevice *xendev)"remote port %d, local port %d\n" , netdev->tx_ring_ref, netdev->rx_ring_ref, netdev->xendev.remote_port, netdev->xendev.local_port); + +net_tx_packets (netdev);return 0 ; }
Signature · 1 line
1.6.2.2
PATCH 1/1 xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE.
In reply to Gerd HoffmannSigned-off-by Gerd Hoffmann <[email protected]>
--- hw/xen_nic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/xen_nic.c +1 -1
@@ -176,7 +176,7 @@ static void net_tx_packets(struct XenNetDev *netdev)if (txreq.flags & NETTXF_csum_blank) {/* have read-only mapping -> can't fill checksum in-place */ if (!tmpbuf) - tmpbuf =qemu_malloc (PAGE_SIZE ); + tmpbuf =qemu_malloc (XC_PAGE_SIZE );memcpy (tmpbuf, page + txreq.offset, txreq.size);net_checksum_calculate (tmpbuf, txreq.size);qemu_send_packet (netdev->vs, tmpbuf, txreq.size);
Signature · 1 line
1.6.2.2
Blue Swirl
AppliedRe: [Qemu-devel] [PATCH] xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE.
Quoted 2 lines · Gerd Hoffmann
Signed-off-by Gerd Hoffmann <[email protected]>
Thanks, applied.
Blue Swirl
AppliedQuoted 2 lines · Gerd Hoffmann
Signed-off-by Gerd Hoffmann <[email protected]>
Thanks, applied.