From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zoltan Kiss Subject: Re: [PATCH net v4] xen-netback: Fix grant ref resolution in RX path Date: Thu, 15 May 2014 11:53:10 +0100 Message-ID: <53749C96.2030102@citrix.com> References: <1400148514-2921-1-git-send-email-zoltan.kiss@citrix.com> <1400150269.4386.30.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , , , , , To: Ian Campbell Return-path: Received: from smtp.citrix.com ([66.165.176.89]:20208 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbaEOKxP (ORCPT ); Thu, 15 May 2014 06:53:15 -0400 In-Reply-To: <1400150269.4386.30.camel@kazak.uk.xensource.com> Sender: netdev-owner@vger.kernel.org List-ID: On 15/05/14 11:37, Ian Campbell wrote: > On Thu, 2014-05-15 at 11:08 +0100, Zoltan Kiss wrote: >> The original series for reintroducing grant mapping for netback had a patch [1] >> to handle receiving of packets from an another VIF. Grant copy on the receiving >> side needs the grant ref of the page to set up the op. >> The original patch assumed (wrongly) that the frags array haven't changed. In >> the case reported by Sander, the sending guest sent a packet where the linear >> buffer and the first frag were under PKT_PROT_LEN (=128) bytes. >> xenvif_tx_submit() then pulled up the linear area to 128 bytes, and ditched the >> first frag. The receiving side had an off-by-one problem when gathered the grant >> refs. >> This patch fixes that by checking whether the actual frag's page pointer is the >> same as the page in the original frag list. It can handle any kind of changes on >> the original frags array, like: >> - removing granted frags from the array at any point >> - adding local pages to the frags list anywhere >> - reordering the frags >> It's optimized to the most common case, when there is 1:1 relation between the >> frags and the list, plus works optimal when frags are removed from the end or >> the beginning. >> >> [1]: 3e2234: xen-netback: Handle foreign mapped pages on the guest RX path >> >> Reported-by: Sander Eikelenboom >> Signed-off-by: Zoltan Kiss > > Acked-by: Ian Campbell > > (Remind me, do we need both this and Eric's fix, or is it either/or?) When you say Eric's fix, which one do you talk about? The one for skb_try_coalesce? That's not too burning, at the moment it is only used from the IP layer and above, as far as I can tell, and zerocopy skbs get copied to local pages in deliver_skb. Zoli