From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 85B9C2BAD for ; Fri, 4 Mar 2016 03:10:25 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 03 Mar 2016 18:10:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,534,1449561600"; d="scan'208";a="663534179" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by FMSMGA003.fm.intel.com with ESMTP; 03 Mar 2016 18:10:18 -0800 Date: Fri, 4 Mar 2016 10:11:54 +0800 From: Yuanhan Liu To: "Xie, Huawei" Message-ID: <20160304021154.GS14300@yliu-dev.sh.intel.com> References: <1449122773-25510-1-git-send-email-yuanhan.liu@linux.intel.com> <1455803352-5518-1-git-send-email-yuanhan.liu@linux.intel.com> <1455803352-5518-2-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "Michael S. Tsirkin" , "dev@dpdk.org" , Victor Kaplansky Subject: Re: [dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 02:10:26 -0000 On Thu, Mar 03, 2016 at 05:19:42PM +0000, Xie, Huawei wrote: > On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > > [...] > CCed changchun, the author for the chained handling of desc and mbuf. > The change makes the code more readable, but i think the following > commit message is simple and enough. Hmm.., my commit log tells a full story: - What is the issue? (messy/logic twisted code) - What the code does? (And what are the challenges: few tricky places) - What's the proposed solution to fix it. (the below pseudo code) And you suggest me to get rid of the first 2 items and leave 3rd item (a solution) only? --yliu > > > > while (this_desc_is_not_drained_totally || has_next_desc) { > > if (this_desc_has_drained_totally) { > > this_desc = next_desc(); > > } > > > > if (mbuf_has_no_room) { > > mbuf = allocate_a_new_mbuf(); > > } > > > > COPY(mbuf, desc); > > } > > > > [...] > > > > This refactor makes the code much more readable (IMO), yet it reduces > > binary code size (nearly 2K). > I guess the reduced binary code size comes from reduced inline calls to > mbuf allocation. >