From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQAgn-0003KW-PR for qemu-devel@nongnu.org; Mon, 01 Feb 2016 04:22:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQAgi-0005gG-WD for qemu-devel@nongnu.org; Mon, 01 Feb 2016 04:22:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQAgi-0005gB-Qn for qemu-devel@nongnu.org; Mon, 01 Feb 2016 04:22:24 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 850F8C0A5168 for ; Mon, 1 Feb 2016 09:22:24 +0000 (UTC) References: <1454264009-24094-1-git-send-email-wexu@redhat.com> <1454264009-24094-4-git-send-email-wexu@redhat.com> <56AEF339.20504@redhat.com> <56AF1132.3010006@redhat.com> From: Jason Wang Message-ID: <56AF23BD.3040108@redhat.com> Date: Mon, 1 Feb 2016 17:22:05 +0800 MIME-Version: 1.0 In-Reply-To: <56AF1132.3010006@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC Patch v2 03/10] virtio-net rsc: Chain Lookup, Packet Caching and Framework of IPv4 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wei Xu , qemu-devel@nongnu.org Cc: Wei Xu , victork@redhat.com, mst@redhat.com, yvugenfi@redhat.com, marcel@redhat.com, dfleytma@redhat.com On 02/01/2016 04:02 PM, Wei Xu wrote: [...] >> >>> + return NULL; >>> + } >>> + >>> + chain->proto = proto; >>> + chain->do_receive = virtio_net_rsc_receive4; >>> + >>> + QTAILQ_INIT(&chain->buffers); >>> + QTAILQ_INSERT_TAIL(&n->rsc_chains, chain, next); >>> + return chain; >>> +} >> Better to split the chain initialization from lookup. And we can >> initialize ipv4 chain during initialization. > > Since the allocation happens really seldom, is it ok to keep the > mechanism to make the logic clean? Ok for now.