From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfUgn-0001cY-27 for qemu-devel@nongnu.org; Fri, 25 Sep 2015 11:13:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfUgj-0008Ds-2A for qemu-devel@nongnu.org; Fri, 25 Sep 2015 11:13:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfUgi-0008DT-TE for qemu-devel@nongnu.org; Fri, 25 Sep 2015 11:13:28 -0400 From: Markus Armbruster References: <1442405768-23019-1-git-send-email-yanghy@cn.fujitsu.com> <1442405768-23019-10-git-send-email-yanghy@cn.fujitsu.com> <87si64qiyr.fsf@blackfin.pond.sub.org> <5604F54F.1000509@cn.fujitsu.com> <5605035D.7070801@redhat.com> Date: Fri, 25 Sep 2015 17:13:25 +0200 In-Reply-To: <5605035D.7070801@redhat.com> (Jason Wang's message of "Fri, 25 Sep 2015 16:18:37 +0800") Message-ID: <877fney1ka.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v11 09/12] netfilter: add a netbuffer filter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com, qemu-devel@nongnu.org, stefanha@redhat.com, Yang Hongyang Jason Wang writes: > On 09/25/2015 03:18 PM, Yang Hongyang wrote: >> >> >> On 09/24/2015 05:12 PM, Markus Armbruster wrote: >>> Yang Hongyang writes: [...] >>>> +static ssize_t filter_buffer_receive_iov(NetFilterState *nf, >>>> + NetClientState *sender, >>>> + unsigned flags, >>>> + const struct iovec *iov, >>>> + int iovcnt, >>>> + NetPacketSent *sent_cb) >>>> +{ >>>> + FilterBufferState *s = FILTER_BUFFER(nf); >>>> + >>>> + /* >>>> + * we return size when buffer a packet, the sender will take it as >>>> + * a already sent packet, so sent_cb should not be called later [...] >>>> + * FIXME: even if guest can't receive packet for some reasons. >>>> Filter >>>> + * can still accept packet until its internal queue is full. >>>> + */ >>> >>> I'm not sure I understand the comment. >> >> This is taken from Jason's comments, may be he can have a better explain? > > For example. For some reason, receiver could not receive more packets > (.can_receive() returns zero). Without a filter, at most one packet will > be queued in incoming queue and sender's poll will be disabled unit its > sent_cb() was called. With a filter, it will keep receive the packets > without caring about the receiver. This is suboptimal. May need more > thoughts (e.g keeping sent_cb). Aha. Perhaps you can work that explanation into the comment.