From patchwork Wed Feb 29 19:15:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 143809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8113AB6ED0 for ; Thu, 1 Mar 2012 06:16:27 +1100 (EST) Received: from localhost ([::1]:36382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2p0j-0007Db-Ag for incoming@patchwork.ozlabs.org; Wed, 29 Feb 2012 14:16:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2p0J-0006Xr-T7 for qemu-devel@nongnu.org; Wed, 29 Feb 2012 14:16:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2p0D-0000px-Cu for qemu-devel@nongnu.org; Wed, 29 Feb 2012 14:15:59 -0500 Received: from david.siemens.de ([192.35.17.14]:18360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2p0C-0000pK-UD for qemu-devel@nongnu.org; Wed, 29 Feb 2012 14:15:53 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id q1TJFnU2029738 for ; Wed, 29 Feb 2012 20:15:49 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id q1TJFlH2003174 for ; Wed, 29 Feb 2012 20:15:49 +0100 From: Jan Kiszka To: qemu-devel@nongnu.org Date: Wed, 29 Feb 2012 20:15:46 +0100 Message-Id: X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.14 Subject: [Qemu-devel] [PATCH 3/4] slirp: Remove unneeded if_queued 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 There is now a trivial check on entry of if_start for pending packets, so we can drop the additional tracking via if_queued. Signed-off-by: Jan Kiszka --- slirp/if.c | 8 -------- slirp/slirp.c | 7 +------ slirp/slirp.h | 1 - 3 files changed, 1 insertions(+), 15 deletions(-) diff --git a/slirp/if.c b/slirp/if.c index 78a9b78..90bf398 100644 --- a/slirp/if.c +++ b/slirp/if.c @@ -110,8 +110,6 @@ if_output(struct socket *so, struct mbuf *ifm) insque(ifm, ifq); diddit: - slirp->if_queued++; - if (so) { /* Update *_queued */ so->so_queued++; @@ -157,7 +155,6 @@ diddit: void if_start(Slirp *slirp) { uint64_t now = qemu_get_clock_ns(rt_clock); - int requeued = 0; bool from_batchq, from_batchq_next; struct mbuf *ifm, *ifm_next, *ifqt; @@ -195,12 +192,9 @@ void if_start(Slirp *slirp) ifm_next = NULL; } - slirp->if_queued--; - /* Try to send packet unless it already expired */ if (ifm->expiration_date >= now && !if_encap(slirp, ifm)) { /* Packet is delayed due to pending ARP resolution */ - requeued++; continue; } @@ -231,6 +225,4 @@ void if_start(Slirp *slirp) m_free(ifm); } - - slirp->if_queued = requeued; } diff --git a/slirp/slirp.c b/slirp/slirp.c index 19d69eb..bcffc34 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -581,12 +581,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds, } } - /* - * See if we can start outputting - */ - if (slirp->if_queued) { - if_start(slirp); - } + if_start(slirp); } /* clear global file descriptor sets. diff --git a/slirp/slirp.h b/slirp/slirp.h index 28a5c03..950eccd 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -235,7 +235,6 @@ struct Slirp { int mbuf_alloced; /* if states */ - int if_queued; /* number of packets queued so far */ struct mbuf if_fastq; /* fast queue (for interactive data) */ struct mbuf if_batchq; /* queue for non-interactive data */ struct mbuf *next_m; /* pointer to next mbuf to output */