From: "Jan Beulich" Subject: Re: Dom0 physical networking/swiotlb/something issue in 3.7-rc1 Date: Fri, 09 Nov 2012 10:36:20 +0000 Message-ID: <509CEAB402000078000A7772@nat28.tlf.novell.com> References: <1350037688.14806.93.camel@zakaz.uk.xensource.com> <509CD50302000078000A76E4@nat28.tlf.novell.com> <1352452573.21048.35.camel@dagon.hellion.org.uk> <509CDDBA02000078000A772C@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <509CDDBA02000078000A772C@nat28.tlf.novell.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: Ian Campbell , xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 09.11.12 at 10:40, "Jan Beulich" wrote: >>>> On 09.11.12 at 10:16, Ian Campbell wrote: >> On Fri, 2012-11-09 at 09:03 +0000, Jan Beulich wrote: >>> >>> On 12.10.12 at 12:28, Ian Campbell wrote: >>> > The following patch causes fairly large packet loss when transmitting >>> > from dom0 to the physical network, at least with my tg3 hardware, but I >>> > assume it can impact anything which uses this interface. >>> > >>> > I suspect that the issue is that the compound pages allocated in this >>> > way are not backed by contiguous mfns and so things fall apart when the >>> > driver tries to do DMA. >>> >>> Has this seen any sort of resolution yet? Despite having forced >>> NETDEV_FRAG_PAGE_MAX_ORDER to zero for Xen (following >>> your suggested patch, Ian), and with a different NIC (e1000e >>> driven) I'm seeing similar packet loss/corruption on transmits, >>> and only if running a debug hypervisor (in a non-debug one, >>> MFNs are largely contiguous, so this issue should be observable >>> there only very rarely). >> >> I think Konrad is still looking into the underlying swiotlb issue. >> >> If you want to go with the workaround then there is another order>0 to >> frob in net/core/sock.c >> #define SKB_FRAG_PAGE_ORDER get_order(32768) >> which might help. > > Thanks, that indeed helped. And gives me food for thought as > well, since this should - if anything at all - be a performance > improvement, not a something affecting correctness. Okay, one problem in the pv-ops case seems pretty obvious: dma_capable() does (potentially cross-page) arithmetic on a dma_addr_t value, ignoring dis-contiguity altogether. Specifically its first use in swiotlb_map_page() and its only use in swiotlb_map_sg_attrs() are problematic. In the forward ported kernels, those two checks are however accompanied by range_needs_mapping() (aka range_straddles_page_boundary()) checks, which ought to take care of this. There is brokenness there with the invocations of gnttab_dma_map_page(), but only if the initial offset is at least PAGE_SIZE - will have to check whether that occurs. Jan