From patchwork Mon Mar 7 10:03:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 8517901 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42636C0553 for ; Mon, 7 Mar 2016 10:02:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E9F22015E for ; Mon, 7 Mar 2016 10:02:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5D2020148 for ; Mon, 7 Mar 2016 10:02:48 +0000 (UTC) Received: from localhost ([::1]:54771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acs00-0003So-3A for patchwork-qemu-devel@patchwork.kernel.org; Mon, 07 Mar 2016 05:02:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acrzo-0003PS-D2 for qemu-devel@nongnu.org; Mon, 07 Mar 2016 05:02:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acrzl-0001dP-NB for qemu-devel@nongnu.org; Mon, 07 Mar 2016 05:02:36 -0500 Received: from [59.151.112.132] (port=40970 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acrzj-0001cy-Qk for qemu-devel@nongnu.org; Mon, 07 Mar 2016 05:02:33 -0500 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="4303925" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 07 Mar 2016 18:02:29 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 20E0E42B4B07; Mon, 7 Mar 2016 18:02:27 +0800 (CST) Received: from G08FNSTD140215.g08.fujitsu.local (10.167.226.56) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Mon, 7 Mar 2016 18:02:26 +0800 From: Zhang Chen To: qemu devel , Jason Wang Date: Mon, 7 Mar 2016 18:03:31 +0800 Message-ID: <1457345011-17645-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.167.226.56] X-yoursite-MailScanner-ID: 20E0E42B4B07.AB725 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: zhangchen.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: Li Zhijian , Gui jianfeng , "eddie.dong" , zhanghailiang , "Dr. David Alan Gilbert" , Zhang Chen , Yang Hongyang Subject: [Qemu-devel] [PATCH] net/filter: rename qemu_netfilter_pass_to_next() to qemu_netfilter_iterate() 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This API will iterate the filters attached to netdev Signed-off-by: Zhang Chen Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian --- include/net/filter.h | 10 +++++----- net/filter-buffer.c | 2 +- net/filter.c | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/net/filter.h b/include/net/filter.h index 5639976..ab00d54 100644 --- a/include/net/filter.h +++ b/include/net/filter.h @@ -67,10 +67,10 @@ ssize_t qemu_netfilter_receive(NetFilterState *nf, NetPacketSent *sent_cb); /* pass the packet to the next filter */ -ssize_t qemu_netfilter_pass_to_next(NetClientState *sender, - unsigned flags, - const struct iovec *iov, - int iovcnt, - void *opaque); +ssize_t qemu_netfilter_iterate(NetClientState *sender, + unsigned flags, + const struct iovec *iov, + int iovcnt, + void *opaque); #endif /* QEMU_NET_FILTER_H */ diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 12ad2e3..a74f8c8 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -114,7 +114,7 @@ static void filter_buffer_setup(NetFilterState *nf, Error **errp) return; } - s->incoming_queue = qemu_new_net_queue(qemu_netfilter_pass_to_next, nf); + s->incoming_queue = qemu_new_net_queue(qemu_netfilter_iterate, nf); if (s->interval) { timer_init_us(&s->release_timer, QEMU_CLOCK_VIRTUAL, filter_buffer_release_timer, nf); diff --git a/net/filter.c b/net/filter.c index d2a514e..7c504c3 100644 --- a/net/filter.c +++ b/net/filter.c @@ -50,11 +50,11 @@ static NetFilterState *netfilter_next(NetFilterState *nf, return next; } -ssize_t qemu_netfilter_pass_to_next(NetClientState *sender, - unsigned flags, - const struct iovec *iov, - int iovcnt, - void *opaque) +ssize_t qemu_netfilter_iterate(NetClientState *sender, + unsigned flags, + const struct iovec *iov, + int iovcnt, + void *opaque) { int ret = 0; int direction; @@ -80,7 +80,7 @@ ssize_t qemu_netfilter_pass_to_next(NetClientState *sender, next = netfilter_next(nf, direction); while (next) { /* - * if qemu_netfilter_pass_to_next been called, means that + * if qemu_netfilter_iterate been called, means that * the packet has been hold by filter and has already retured size * to the sender, so sent_cb shouldn't be called later, just * pass NULL to next.