From patchwork Mon Aug 3 05:20:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 503006 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 17D721402CD for ; Mon, 3 Aug 2015 15:21:07 +1000 (AEST) Received: from localhost ([::1]:57551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM8BK-00022P-MV for incoming@patchwork.ozlabs.org; Mon, 03 Aug 2015 01:21:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM8B6-0001j9-6Z for qemu-devel@nongnu.org; Mon, 03 Aug 2015 01:20:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZM8B1-0004hC-6v for qemu-devel@nongnu.org; Mon, 03 Aug 2015 01:20:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM8B1-0004h3-1u for qemu-devel@nongnu.org; Mon, 03 Aug 2015 01:20:43 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id DBE958E3E4 for ; Mon, 3 Aug 2015 05:20:41 +0000 (UTC) Received: from jason-ThinkPad-T430s.nay.redhat.com (dhcp-14-122.nay.redhat.com [10.66.14.122]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t735KdRa000434; Mon, 3 Aug 2015 01:20:40 -0400 From: Jason Wang To: qemu-devel@nongnu.org Date: Mon, 3 Aug 2015 13:20:38 +0800 Message-Id: <1438579238-7092-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jason Wang , mst@redhat.com Subject: [Qemu-devel] [PATCH] virtio-net: remove useless codes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Stefan Hajnoczi --- 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;