From: Wei Liu Subject: Re: [PATCH RFC] xen-netback: coalesce frags before copying Date: Fri, 15 Mar 2013 15:17:01 +0000 Message-ID: <1363360621.29093.170.camel@zion.uk.xensource.com> References: <1363285576-10480-1-git-send-email-wei.liu2@citrix.com> <1363344142.32410.315.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1363344142.32410.315.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "netwiz@crc.id.au" , "konrad.wilk@oracle.com" , "npegg@linode.com" , "xen-devel@lists.xen.org" , "linux@eikelenboom.it" , "annie.li@oracle.com" , wei.liu2@citrix.com, "jacekowski@jacekowski.org" List-Id: xen-devel@lists.xenproject.org On Fri, 2013-03-15 at 10:42 +0000, Ian Campbell wrote: > > goto err; > > > > - gop->source.u.ref = txp->gref; > > - gop->source.domid = vif->domid; > > - gop->source.offset = txp->offset; > > - > > - gop->dest.u.gmfn = virt_to_mfn(page_address(page)); > > - gop->dest.domid = DOMID_SELF; > > - gop->dest.offset = txp->offset; > > - > > - gop->len = txp->size; > > - gop->flags = GNTCOPY_source_gref; > > + nr_txp = 0; > > + dst_offset = 0; > > + first = NULL; > > + while (dst_offset < PAGE_SIZE && j < nr_frags) { > > I think splitting the handling of a single request slot into a function > would be useful for clarity. e.g. xen_netbk_handle_one_request or > something. > Regarding this comment, I think it looks better as-is. This loop is closely related to the outer loop. Wei.