On 29 May 2015, at 08:53, Yuzhou (C) <vitas.yuz...@huawei.com> wrote: > Hi, > > About rx zerocopy, I have a question: > > If some application make a socket, then listen and accept, the client > sends packets to it, but it doesn't recv from this socket right now, all > persistent grant page would be in used. > So other application cannot receive any packets. Is my guess right or wrong?
I believe that doesn’t happen: before the skb gets delivered to the protocol stack, skb_orphan_frags gets called which releases the original pages (i.e. the persistent grants) and memcpy to new ones (if the skb is fragmented). This happens because I previously set the flag SKBTX_DEV_ZEROCOPY, which also invokes a callback in such event. Once the callback is invoked, the released pages are added a pool within xen-netfront which later will use for new requests to the backend. Note that part of the data is previously copied on pskb_pull_tail and may unref the initial frag before skb_orphan_frags is called. The callback is still invoked and this page is added to the pool as well. Joao > YuZhou > > -----Original Message----- > From: xen-devel-boun...@lists.xen.org > [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of Joao Martins > Sent: Friday, May 22, 2015 6:27 PM > To: Wei Liu > Cc: ian.campb...@citrix.com; net...@vger.kernel.org; david.vra...@citrix.com; > xen-de...@lists.xenproject.org;boris.ostrov...@oracle.com > Subject: Re: [Xen-devel] [RFC PATCH 00/13] Persistent grant maps for xen net > drivers > > > On 19 May 2015, at 17:39, Wei Liu <wei.l...@citrix.com> wrote: > >> On Tue, May 12, 2015 at 07:18:24PM +0200, Joao Martins wrote: >> >>> There have been recently[3] some discussions and issues raised on >>> persistent grants for the block layer, though the numbers above show >>> some significant improvements specially on more network intensive >>> workloads and provide a margin for comparison against future >>> map/unmap improvements. >>> >>> Any comments or suggestions are welcome, Thanks! >> >> Thanks, the numbers certainly look interesting. >> >> I'm just a bit concerned about the complexity of netback. I've >> commented on individual patches, we can discuss the issues there. > > Thanks a lot for the review! It does add more complexity, mainly for the TX > path, but I also would like to mention that a portion of this changeset is > also the persistent grants ops that could potentially live outside. > > Joao > >>> [1] http://article.gmane.org/gmane.linux.network/249383 >>> [2] http://bit.ly/1IhJfXD >>> [3] >>> http://lists.xen.org/archives/html/xen-devel/2015-02/msg02292.html >>> >>> Joao Martins (13): >>> xen-netback: add persistent grant tree ops >>> xen-netback: xenbus feature persistent support >>> xen-netback: implement TX persistent grants >>> xen-netback: implement RX persistent grants >>> xen-netback: refactor xenvif_rx_action >>> xen-netback: copy buffer on xenvif_start_xmit() >>> xen-netback: add persistent tree counters to debugfs >>> xen-netback: clone skb if skb->xmit_more is set >>> xen-netfront: move grant_{ref,page} to struct grant >>> xen-netfront: refactor claim/release grant >>> xen-netfront: feature-persistent xenbus support >>> xen-netfront: implement TX persistent grants >>> xen-netfront: implement RX persistent grants >>> >>> drivers/net/xen-netback/common.h | 79 ++++ >>> drivers/net/xen-netback/interface.c | 78 +++- >>> drivers/net/xen-netback/netback.c | 873 >>> ++++++++++++++++++++++++++++++------ >>> drivers/net/xen-netback/xenbus.c | 24 + >>> drivers/net/xen-netfront.c | 362 ++++++++++++--- >>> 5 files changed, 1216 insertions(+), 200 deletions(-) >>> >>> -- >>> 2.1.3 > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel =================================================================== João Martins Research Scientist, Networked Systems and Data Analytics Group NEC Laboratories Europe Kurfuerstenanlage 36 D-69115 Heidelberg Tel. +49 (0)6221 4342-208 Fax: +49 (0)6221 4342-155 e-mail: joao.mart...@neclab.eu =================================================================== NEC Europe Ltd | Registered Office: Athene, Odyssey Business Park, West End Road, London, HA4 6QE, GB | Registered in England 2832014 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel