From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst Date: Fri, 4 Mar 2016 10:11:54 +0800 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 Cc: "Michael S. Tsirkin" , "dev@dpdk.org" , Victor Kaplansky To: "Xie, Huawei" 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) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. >