WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] x86_64 eth0 e1000_clean_tx_irq tx hang

To: "Kamble, Nitin A" <nitin.a.kamble@xxxxxxxxx>
Subject: Re: [Xen-devel] x86_64 eth0 e1000_clean_tx_irq tx hang
From: Chris Wright <chrisw@xxxxxxxxxxxx>
Date: Wed, 15 Feb 2006 19:07:15 -0800
Cc: Chris Wright <chrisw@xxxxxxxxxxxx>, Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, adam@xxxxxxxxxxx
Delivery-date: Thu, 16 Feb 2006 03:16:46 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E305A4AFB7947540BC487567B5449BA8096F525E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E305A4AFB7947540BC487567B5449BA8096F525E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
* Kamble, Nitin A (nitin.a.kamble@xxxxxxxxx) wrote:
> >  - limiting to 2G works fine, sounds like something with swiotlb
> 
> I noticed it too and exactly same. I also notice this in the dom0 dmesg.

After spending hours trying to find something -- anything -- wrong with
irq delivery and e1000 hung tx unit, I went back to my original hunch,
which was swiotlb related.  When TSO is enabled, some debugging showed
this:

swiotlb_map_page: returns d586a000
dma_map_page: returns ffffffffd586a000

Indeed.

 a43:   e8 00 00 00 00          callq  a48 <dma_map_page+0xc8>        a44: 
R_X86_64_PC32      swiotlb_map_page+0xfffffffffffffffc
 a48:   48 63 d8                movslq %eax,%rbx

Whoops.  Prototype mismatch.

And had we been paying attention:

/home/chrisw/hg/xen/xen-unstable/linux-2.6.16-rc2-xen0/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:107:
 warning: implicit declaration of function ‘swiotlb_map_page’
/home/chrisw/hg/xen/xen-unstable/linux-2.6.16-rc2-xen0/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:
 In function ‘dma_unmap_page’:
/home/chrisw/hg/xen/xen-unstable/linux-2.6.16-rc2-xen0/arch/x86_64/kernel/../../i386/kernel/pci-dma-xen.c:125:
 warning: implicit declaration of function ‘swiotlb_unmap_page’

Here's a quick patch that fixes the issue (not ready to apply to
-unstable, since it's a file that's not in sparse tree).  Nitin, this
should fix your problem as well.  I'll work on a proper patch later this
evening or tomorrow morning.

thanks,
-chris
--

--- linux-2.6.16-rc2/include/asm-x86_64/swiotlb.h       2006-02-15 
21:42:24.000000000 -0500
+++ linux-2.6.16-rc2-xen0/include/asm-x86_64/swiotlb.h  2006-02-15 
21:19:15.000000000 -0500
@@ -38,6 +38,11 @@
 extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg,
                         int nents, int direction);
 extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr);
+extern dma_addr_t swiotlb_map_page(struct device *hwdev, struct page *page,
+                                   unsigned long offset, size_t size,
+                                   enum dma_data_direction direction);
+extern void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dma_address,
+                               size_t size, enum dma_data_direction direction);
 extern void swiotlb_free_coherent (struct device *hwdev, size_t size,
                                   void *vaddr, dma_addr_t dma_handle);
 extern int swiotlb_dma_supported(struct device *hwdev, u64 mask);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel