From: Dave Jones <davej@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: velocity driver unmaps incorrect size.
Date: Sun, 21 Jun 2009 22:40:44 -0400 [thread overview]
Message-ID: <20090622024044.GA3157@redhat.com> (raw)
In-Reply-To: <20090621.184345.194558005.davem@davemloft.net>
On Sun, Jun 21, 2009 at 06:43:45PM -0700, David Miller wrote:
> > ------------[ cut here ]------------
> > WARNING: at lib/dma-debug.c:505 check_unmap+0x1f8/0x4d4()
> > Hardware name:
> > via-velocity 0000:00:0e.0: DMA-API: device driver frees DMA memory with different size [device address=0x000000001a456242] [map size=90 bytes] [unmap size=1 bytes]
>
> Ok, bad unmap size is "1".
>
> > [<c05e1029>] ? check_unmap+0x1f8/0x4d4
> > [<c0443533>] warn_slowpath_fmt+0x34/0x48
> > [<c05e1029>] check_unmap+0x1f8/0x4d4
> > [<c05e15a8>] debug_dma_unmap_page+0x71/0x8a
> > [<dcf88829>] pci_unmap_single+0x74/0x90 [via_velocity]
> > [<dcf88922>] velocity_tx_srv+0xdd/0x1a0 [via_velocity]
> > [<dcf89e76>] velocity_intr+0x52f/0x5a1 [via_velocity]
>
> So since this is happening in velocity_tx_srv() it has to be
> velocity_free_tx_buf(). It has two cases, one for when
> VELOCITY_ZERO_COPY_SUPPORT is defined and one for when that
> is not defined.
>
> There is no way to set that define that I can see in the
> tree, so we only need to consider the case where this
> macro is not defined:
>
> static void velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_info *tdinfo)
> {
> ...
> if (tdinfo->skb_dma) {
> pktlen = (skb->len > ETH_ZLEN ? : ETH_ZLEN);
> for (i = 0; i < tdinfo->nskb_dma; i++) {
> pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], pktlen, PCI_DMA_TODEVICE);
> tdinfo->skb_dma[i] = 0;
> }
> }
> ...
> }
>
> It seems to me that it's impossible for 'pktlen' to every be
> '1' here as the DMA debug code is claiming. It must always
> be at least ETH_ZLEN. And that is what is passed in for the
> unmap length.
>
> David is there something wonky in your build or do you have
> any local patches applied?
Nothing obvious that could explain it.
(It's the Fedora 11 kernel, which has no patches to this driver,
nor to net/)
> Is it possible that for some reason
> your build is forcing VELOCITY_ZERO_COPY_SUPPORT to be defined
> for some reason?
Memory corruption maybe?
It's especially odd in that it only happens once during boot,
and never happens again. This is my firewall/router, so there's
more packets going through that box than any other I have.
btw, given the zerocopy stuff has been disabled for so long,
is it worth keeping it ?
Dave
next prev parent reply other threads:[~2009-06-22 2:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-21 17:37 velocity driver unmaps incorrect size Dave Jones
2009-06-22 1:43 ` David Miller
2009-06-22 2:40 ` Dave Jones [this message]
2009-06-22 2:42 ` David Miller
2009-06-22 2:51 ` Dave Jones
2009-06-22 3:37 ` [PATCH] Fix velocity driver unmapping " Dave Jones
2009-06-22 5:15 ` Dave Jones
2009-06-22 5:35 ` [PATCH v2] " Dave Jones
2009-06-22 5:42 ` David Miller
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=20090622024044.GA3157@redhat.com \
--to=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).