From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agRQG-0003vo-3p for qemu-devel@nongnu.org; Thu, 17 Mar 2016 02:28:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agRQC-0006aX-Tp for qemu-devel@nongnu.org; Thu, 17 Mar 2016 02:28:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agRQC-0006Zx-Ok for qemu-devel@nongnu.org; Thu, 17 Mar 2016 02:28:36 -0400 References: <1458036214-867-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> <1458036214-867-2-git-send-email-zhangchen.fnst@cn.fujitsu.com> <56E916EB.3050704@redhat.com> <56E928C2.60100@cn.fujitsu.com> <56EA4A3B.8060909@redhat.com> <56EA4C21.9000205@cn.fujitsu.com> From: Jason Wang Message-ID: <56EA4E8E.2070100@redhat.com> Date: Thu, 17 Mar 2016 14:28:30 +0800 MIME-Version: 1.0 In-Reply-To: <56EA4C21.9000205@cn.fujitsu.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V4 1/2] net/filter-mirror: implement filter-redirector List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang , Zhang Chen , qemu devel Cc: zhanghailiang , Li Zhijian , Gui jianfeng , "eddie.dong" , "Dr. David Alan Gilbert" , Yang Hongyang On 03/17/2016 02:18 PM, Wen Congyang wrote: >>>>>>> >>>>>> + s->state = 0; >>>>>>> >>>>>> + /* FIXME: do something ? */ >>>>> >>>> >>>>> >>>> This needs some thought, but at least reset the fd handler and state is >>>>> >>>> needed. >>> >> Maybe we can read the data from the chardev, and drop it? >>> >> >>> >> Thanks >>> >> Wen Congyang >>> >> >> > >> > No function difference, but reading and dropping will cost extra cpu >> > which seems not good. > If we reset and receive it again, the unread data will be auto dropped? If socket receive queue is not full, the data will be buffered there (but the queue will be purged after qemu process exits). Otherwise it will be dropped. > If so, I think reset the fd handler is better choice. > > Thanks > Wen Congyang >