From patchwork Mon Aug 3 08:30:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Hongyang X-Patchwork-Id: 503049 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 37E9B1402DE for ; Mon, 3 Aug 2015 18:31:48 +1000 (AEST) Received: from localhost ([::1]:58022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMB9u-0007Ab-3o for incoming@patchwork.ozlabs.org; Mon, 03 Aug 2015 04:31:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMB9F-000620-Fb for qemu-devel@nongnu.org; Mon, 03 Aug 2015 04:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMB9E-0007Hq-H5 for qemu-devel@nongnu.org; Mon, 03 Aug 2015 04:31:05 -0400 Received: from [59.151.112.132] (port=4678 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMB9D-00071y-Rd for qemu-devel@nongnu.org; Mon, 03 Aug 2015 04:31:04 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="99193378" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Aug 2015 16:34:11 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t738SkET024967; Mon, 3 Aug 2015 16:28:47 +0800 Received: from localhost (10.167.226.223) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Mon, 3 Aug 2015 16:30:39 +0800 From: Yang Hongyang To: Date: Mon, 3 Aug 2015 16:30:13 +0800 Message-ID: <1438590616-21142-10-git-send-email-yanghy@cn.fujitsu.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438590616-21142-1-git-send-email-yanghy@cn.fujitsu.com> References: <1438590616-21142-1-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com, jasowang@redhat.com, dgilbert@redhat.com, mrhines@linux.vnet.ibm.com, stefanha@redhat.com, Yang Hongyang Subject: [Qemu-devel] [PATCH v3 09/12] move out net queue structs define 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 Signed-off-by: Yang Hongyang --- include/net/queue.h | 19 +++++++++++++++++++ net/queue.c | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/net/queue.h b/include/net/queue.h index f10fab0..e139cc7 100644 --- a/include/net/queue.h +++ b/include/net/queue.h @@ -31,6 +31,25 @@ typedef struct NetQueue NetQueue; typedef void (NetPacketSent) (NetClientState *sender, ssize_t ret); +struct NetPacket { + QTAILQ_ENTRY(NetPacket) entry; + NetClientState *sender; + unsigned flags; + int size; + NetPacketSent *sent_cb; + uint8_t data[0]; +}; + +struct NetQueue { + void *opaque; + uint32_t nq_maxlen; + uint32_t nq_count; + + QTAILQ_HEAD(packets, NetPacket) packets; + + unsigned delivering:1; +}; + #define QEMU_NET_PACKET_FLAG_NONE 0 #define QEMU_NET_PACKET_FLAG_RAW (1<<0) diff --git a/net/queue.c b/net/queue.c index c34a3e0..428fdd6 100644 --- a/net/queue.c +++ b/net/queue.c @@ -39,25 +39,6 @@ * unbounded queueing. */ -struct NetPacket { - QTAILQ_ENTRY(NetPacket) entry; - NetClientState *sender; - unsigned flags; - int size; - NetPacketSent *sent_cb; - uint8_t data[0]; -}; - -struct NetQueue { - void *opaque; - uint32_t nq_maxlen; - uint32_t nq_count; - - QTAILQ_HEAD(packets, NetPacket) packets; - - unsigned delivering : 1; -}; - NetQueue *qemu_new_net_queue(void *opaque) { NetQueue *queue;