All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prashant Sreedharan <prashant@broadcom.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Michael Chan <mchan@broadcom.com>, <cascardo@linux.vnet.ibm.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	"Vlad Yasevich" <vyasevich@gmail.com>,
	<xen-devel@lists.xensource.com>, <netdev@vger.kernel.org>,
	"Siva Reddy (Siva) Kallam" <siva.kallam@broadcom.com>,
	Sanjeev Bansal <sanjeevb@broadcom.com>
Subject: Re: tg3 NIC driver bug in 3.14.x under Xen [and 3 more messages]
Date: Thu, 16 Apr 2015 15:51:34 -0700	[thread overview]
Message-ID: <1429224694.4720.68.camel@prashant> (raw)
In-Reply-To: <21807.60995.462892.714138@mariner.uk.xensource.com>

On Thu, 2015-04-16 at 18:15 +0100, Ian Jackson wrote:
> Michael Chan writes ("Re: tg3 NIC driver bug in 3.14.x under Xen [and 3 more messages]"):
> > On Thu, 2015-04-16 at 09:24 -0300, cascardo@linux.vnet.ibm.com wrote: 
> > > Yes, this looks like the driver is not syncing the DMA buffers. Unmap is
> > > supposed to synchronize as well.
> > 
> > For small rx packets (< 256 bytes), we sync the DMA buffer before we
> > copy the data to another SKB.  For larger packets, we unmap the DMA
> > buffer.  Do we see the corruption in both cases?
> 
> Yes, at least with swiotlb=force iommu=soft.

Ok this is what is causing the problem, the driver uses
DEFINE_DMA_UNMAP_ADDR(), dma_unmap_addr_set() to keep a copy of the dma
"mapping" and dma_unmap_addr() to get the "mapping" value. On most of
the platforms this is a no-op, but it appears with "iommu=soft and
swiotlb=force" this house keeping is required, when I pass the correct
dma_addr instead of 0 while calling pci_unmap_/pci_dma_sync_ I don't see
the corruption. ie If you set CONFIG_NEED_DMA_MAP_STATE=y in your kernel
config you should not see the problem. Can you confirm ? Thanks

WARNING: multiple messages have this Message-ID (diff)
From: Prashant Sreedharan <prashant@broadcom.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Michael Chan <mchan@broadcom.com>,
	cascardo@linux.vnet.ibm.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Vlad Yasevich <vyasevich@gmail.com>,
	xen-devel@lists.xensource.com, netdev@vger.kernel.org,
	"Siva Reddy (Siva) Kallam" <siva.kallam@broadcom.com>,
	Sanjeev Bansal <sanjeevb@broadcom.com>
Subject: Re: tg3 NIC driver bug in 3.14.x under Xen [and 3 more messages]
Date: Thu, 16 Apr 2015 15:51:34 -0700	[thread overview]
Message-ID: <1429224694.4720.68.camel@prashant> (raw)
In-Reply-To: <21807.60995.462892.714138@mariner.uk.xensource.com>

On Thu, 2015-04-16 at 18:15 +0100, Ian Jackson wrote:
> Michael Chan writes ("Re: tg3 NIC driver bug in 3.14.x under Xen [and 3 more messages]"):
> > On Thu, 2015-04-16 at 09:24 -0300, cascardo@linux.vnet.ibm.com wrote: 
> > > Yes, this looks like the driver is not syncing the DMA buffers. Unmap is
> > > supposed to synchronize as well.
> > 
> > For small rx packets (< 256 bytes), we sync the DMA buffer before we
> > copy the data to another SKB.  For larger packets, we unmap the DMA
> > buffer.  Do we see the corruption in both cases?
> 
> Yes, at least with swiotlb=force iommu=soft.

Ok this is what is causing the problem, the driver uses
DEFINE_DMA_UNMAP_ADDR(), dma_unmap_addr_set() to keep a copy of the dma
"mapping" and dma_unmap_addr() to get the "mapping" value. On most of
the platforms this is a no-op, but it appears with "iommu=soft and
swiotlb=force" this house keeping is required, when I pass the correct
dma_addr instead of 0 while calling pci_unmap_/pci_dma_sync_ I don't see
the corruption. ie If you set CONFIG_NEED_DMA_MAP_STATE=y in your kernel
config you should not see the problem. Can you confirm ? Thanks

  reply	other threads:[~2015-04-16 23:15 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 15:12 tg3 NIC driver bug in 3.14.x under Xen Ian Jackson
2015-04-07 15:12 ` Ian Jackson
2015-04-07 15:37 ` Konrad Rzeszutek Wilk
2015-04-07 15:37   ` Konrad Rzeszutek Wilk
2015-04-07 18:25   ` Ian Jackson
2015-04-07 18:25     ` Ian Jackson
2015-04-07 16:55 ` Michael Chan
2015-04-07 16:55   ` Michael Chan
2015-04-07 17:58   ` Ian Jackson
2015-04-07 17:58     ` Ian Jackson
2015-04-07 18:13     ` Ian Jackson
2015-04-07 18:13       ` Ian Jackson
2015-04-07 23:21       ` Michael Chan
2015-04-07 23:21         ` Michael Chan
2015-04-07 23:22         ` Prashant Sreedharan
2015-04-07 23:22           ` Prashant Sreedharan
2015-04-08 13:59           ` tg3 NIC driver bug in 3.14.x under Xen [and 3 more messages] Ian Jackson
2015-04-08 13:59             ` Ian Jackson
2015-04-09  1:43             ` Prashant Sreedharan
2015-04-09  1:43               ` Prashant Sreedharan
2015-04-09 11:11               ` Ian Jackson
2015-04-09 11:11                 ` Ian Jackson
2015-04-09 16:10                 ` Prashant Sreedharan
2015-04-09 16:10                   ` Prashant Sreedharan
2015-04-09 16:57                   ` Ian Jackson
2015-04-09 16:57                     ` Ian Jackson
2015-04-09 17:25                     ` Ian Jackson
2015-04-09 17:25                       ` Ian Jackson
2015-04-09 18:08                       ` Prashant Sreedharan
2015-04-09 18:08                         ` Prashant Sreedharan
2015-04-10 15:06                         ` Ian Jackson
2015-04-10 15:06                           ` Ian Jackson
2015-04-11  8:01                           ` Prashant
2015-04-11  8:01                             ` Prashant
2015-04-15 10:54                             ` Ian Jackson
2015-04-15 10:54                               ` Ian Jackson
2015-04-16  2:53                               ` Prashant
2015-04-16  2:53                                 ` Prashant
2015-04-16 10:18                                 ` Ian Jackson
2015-04-16 10:18                                   ` Ian Jackson
2015-04-16 12:24                                   ` cascardo
2015-04-16 16:39                                     ` Michael Chan
2015-04-16 16:39                                       ` Michael Chan
2015-04-16 17:15                                       ` Ian Jackson
2015-04-16 17:15                                         ` Ian Jackson
2015-04-16 22:51                                         ` Prashant Sreedharan [this message]
2015-04-16 22:51                                           ` Prashant Sreedharan
2015-04-17 16:29                                           ` Ian Jackson
2015-04-17 16:29                                             ` Ian Jackson
2015-04-17 17:19                                             ` David Miller
2015-04-17 17:46                                               ` Michael Chan
2015-04-17 17:46                                                 ` Michael Chan
2015-04-17 19:04                                                 ` Konrad Rzeszutek Wilk
2015-04-17 19:12                                                   ` David Miller
2015-04-17 18:52                                                     ` Prashant Sreedharan
2015-04-17 18:52                                                       ` Prashant Sreedharan
2015-04-21 15:05                                                       ` Ian Jackson
2015-04-21 15:05                                                         ` Ian Jackson
2015-04-21 15:36                                                         ` [OSSTEST PATCH] ts-kernel-build: Enable x86 IOMMU options Ian Jackson
2015-04-21 15:44                                                           ` Ian Campbell
2015-04-21 16:51                                                             ` Konrad Rzeszutek Wilk
2015-04-18 12:39                                                   ` [tip:x86/urgent] config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected tip-bot for Konrad Rzeszutek Wilk
2015-04-16 18:14                                       ` tg3 NIC driver bug in 3.14.x under Xen [and 3 more messages] David Miller
2015-04-09 18:26                       ` Michael Chan
2015-04-09 18:26                         ` Michael Chan
2015-04-10 11:43                         ` Ian Jackson
2015-04-10 11:43                           ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429224694.4720.68.camel@prashant \
    --to=prashant@broadcom.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=cascardo@linux.vnet.ibm.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=sanjeevb@broadcom.com \
    --cc=siva.kallam@broadcom.com \
    --cc=vyasevich@gmail.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.