From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v2 2/7] vhost: refactor virtio_dev_rx Date: Tue, 8 Mar 2016 20:27:11 +0800 Message-ID: <20160308122711.GR14300@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-3-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 mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8F3752C50 for ; Tue, 8 Mar 2016 13:24:53 +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 Mon, Mar 07, 2016 at 03:34:53AM +0000, Xie, Huawei wrote: > On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > > + while (1) { > > + /* done with current mbuf, fetch next */ > > + if (mbuf_avail == 0) { > > + m = m->next; > > + if (m == NULL) > > + break; > > + > > + mbuf_offset = 0; > > + mbuf_avail = rte_pktmbuf_data_len(m); > > + } > > + > > You could use while (mbuf_avail || m->next) to align with the style of > coyp_desc_to_mbuf? Good suggestion, will do that. Thanks. --yliu