* [Qemu-devel] [PATCH] virtio-net: remove useless codes
@ 2015-08-03 5:20 Jason Wang
2015-08-04 9:01 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Jason Wang @ 2015-08-03 5:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Jason Wang, mst
After commit 40bad8f3deba15e2074ff34cfe923c12916b1cc5("virtio-net: fix
used len for tx"), async_tx.len was no longer used afterwards. So
remove useless codes with it.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/virtio-net.c | 8 ++------
include/hw/virtio/virtio-net.h | 1 -
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 1510839..8d28e45 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1124,7 +1124,7 @@ static void virtio_net_tx_complete(NetClientState *nc, ssize_t len)
virtqueue_push(q->tx_vq, &q->async_tx.elem, 0);
virtio_notify(vdev, q->tx_vq);
- q->async_tx.elem.out_num = q->async_tx.len = 0;
+ q->async_tx.elem.out_num = 0;
virtio_queue_set_notification(q->tx_vq, 1);
virtio_net_flush_tx(q);
@@ -1148,7 +1148,7 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
}
while (virtqueue_pop(q->tx_vq, &elem)) {
- ssize_t ret, len;
+ ssize_t ret;
unsigned int out_num = elem.out_num;
struct iovec *out_sg = &elem.out_sg[0];
struct iovec sg[VIRTQUEUE_MAX_SIZE], sg2[VIRTQUEUE_MAX_SIZE + 1];
@@ -1196,18 +1196,14 @@ static int32_t virtio_net_flush_tx(VirtIONetQueue *q)
out_sg = sg;
}
- len = n->guest_hdr_len;
-
ret = qemu_sendv_packet_async(qemu_get_subqueue(n->nic, queue_index),
out_sg, out_num, virtio_net_tx_complete);
if (ret == 0) {
virtio_queue_set_notification(q->tx_vq, 0);
q->async_tx.elem = elem;
- q->async_tx.len = len;
return -EBUSY;
}
- len += ret;
drop:
virtqueue_push(q->tx_vq, &elem, 0);
virtio_notify(vdev, q->tx_vq);
diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index 60b11d5..f3cc25f 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -48,7 +48,6 @@ typedef struct VirtIONetQueue {
int tx_waiting;
struct {
VirtQueueElement elem;
- ssize_t len;
} async_tx;
struct VirtIONet *n;
} VirtIONetQueue;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-net: remove useless codes
2015-08-03 5:20 [Qemu-devel] [PATCH] virtio-net: remove useless codes Jason Wang
@ 2015-08-04 9:01 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2015-08-04 9:01 UTC (permalink / raw)
To: Jason Wang; +Cc: qemu-devel, mst
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
On Mon, Aug 03, 2015 at 01:20:38PM +0800, Jason Wang wrote:
> After commit 40bad8f3deba15e2074ff34cfe923c12916b1cc5("virtio-net: fix
> used len for tx"), async_tx.len was no longer used afterwards. So
> remove useless codes with it.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
> hw/net/virtio-net.c | 8 ++------
> include/hw/virtio/virtio-net.h | 1 -
> 2 files changed, 2 insertions(+), 7 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-04 9:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-03 5:20 [Qemu-devel] [PATCH] virtio-net: remove useless codes Jason Wang
2015-08-04 9:01 ` Stefan Hajnoczi
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).