qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] xen nic: use qemu_malloc
@ 2009-06-08 12:33 Gerd Hoffmann
  2009-06-08 12:33 ` [Qemu-devel] [PATCH] xen nic: check tx queue after connect Gerd Hoffmann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2009-06-08 12:33 UTC (permalink / raw)
  To: qemu-devel, xen-devel; +Cc: Gerd Hoffmann


Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/xen_nic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xen_nic.c b/hw/xen_nic.c
index 048d865..5fcc701 100644
--- a/hw/xen_nic.c
+++ b/hw/xen_nic.c
@@ -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);
 }
 
 /* ------------------------------------------------------------- */
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH] xen nic: check tx queue after connect.
  2009-06-08 12:33 [Qemu-devel] [PATCH] xen nic: use qemu_malloc Gerd Hoffmann
@ 2009-06-08 12:33 ` Gerd Hoffmann
  2009-06-08 12:33 ` [Qemu-devel] [PATCH] xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE Gerd Hoffmann
  2009-06-08 17:04 ` [Qemu-devel] [PATCH] xen nic: use qemu_malloc Blue Swirl
  2 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2009-06-08 12:33 UTC (permalink / raw)
  To: qemu-devel, xen-devel; +Cc: Gerd Hoffmann

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 <kraxel@redhat.com>
---
 hw/xen_nic.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/xen_nic.c b/hw/xen_nic.c
index 5fcc701..6f03ae7 100644
--- a/hw/xen_nic.c
+++ b/hw/xen_nic.c
@@ -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;
 }
 
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH] xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE.
  2009-06-08 12:33 [Qemu-devel] [PATCH] xen nic: use qemu_malloc Gerd Hoffmann
  2009-06-08 12:33 ` [Qemu-devel] [PATCH] xen nic: check tx queue after connect Gerd Hoffmann
@ 2009-06-08 12:33 ` Gerd Hoffmann
  2009-06-08 17:04   ` Blue Swirl
  2009-06-08 17:04 ` [Qemu-devel] [PATCH] xen nic: use qemu_malloc Blue Swirl
  2 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2009-06-08 12:33 UTC (permalink / raw)
  To: qemu-devel, xen-devel; +Cc: Gerd Hoffmann


Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/xen_nic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xen_nic.c b/hw/xen_nic.c
index 6f03ae7..f7fa3d7 100644
--- a/hw/xen_nic.c
+++ b/hw/xen_nic.c
@@ -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);
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] xen nic: use qemu_malloc
  2009-06-08 12:33 [Qemu-devel] [PATCH] xen nic: use qemu_malloc Gerd Hoffmann
  2009-06-08 12:33 ` [Qemu-devel] [PATCH] xen nic: check tx queue after connect Gerd Hoffmann
  2009-06-08 12:33 ` [Qemu-devel] [PATCH] xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE Gerd Hoffmann
@ 2009-06-08 17:04 ` Blue Swirl
  2 siblings, 0 replies; 5+ messages in thread
From: Blue Swirl @ 2009-06-08 17:04 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: xen-devel, qemu-devel

On 6/8/09, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
>  Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Thanks, applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE.
  2009-06-08 12:33 ` [Qemu-devel] [PATCH] xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE Gerd Hoffmann
@ 2009-06-08 17:04   ` Blue Swirl
  0 siblings, 0 replies; 5+ messages in thread
From: Blue Swirl @ 2009-06-08 17:04 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: xen-devel, qemu-devel

On 6/8/09, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
>  Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Thanks, applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-08 17:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-08 12:33 [Qemu-devel] [PATCH] xen nic: use qemu_malloc Gerd Hoffmann
2009-06-08 12:33 ` [Qemu-devel] [PATCH] xen nic: check tx queue after connect Gerd Hoffmann
2009-06-08 12:33 ` [Qemu-devel] [PATCH] xen nic: use XC_PAGE_SIZE instead of PAGE_SIZE Gerd Hoffmann
2009-06-08 17:04   ` Blue Swirl
2009-06-08 17:04 ` [Qemu-devel] [PATCH] xen nic: use qemu_malloc Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).