From: "Steven J. Hill" <sjhill@realitydiluted.com>
To: Brian Murphy <brian@murphy.dk>
Cc: linux-mips@linux-mips.org
Subject: Re: BUG in pcnet32.c?
Date: Mon, 29 Mar 2004 15:25:49 -0500 [thread overview]
Message-ID: <4068864D.1020209@realitydiluted.com> (raw)
In-Reply-To: <4068809F.8070103@murphy.dk>
Brian Murphy wrote:
> In pcnet32.c where the driver writer sets up her receive buffers there
> is this line
>
> lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail,
> rx_skbuff->len, PCI_DMA_FROMDEVICE);
>
> the length value turns out to be 0 and crashes the running
> process,ifconfig.
> Is making a map for a buffer of length 0 valid at all? If not what the
> hell is going on here.
>
> I feel this should say PKT_BUF_SZ instead of rx_skbuff->len which is the
> length of skbuff which has been
> allocated at this point in the code, this is line 986 in todays checkout.
>
> Something is wrong in any case, any pointers?
>
Excellent. So my new BUG code detected another bad network driver. Your network
driver is broken and it needs fixed. I will refer you to these posts between
Jeff Garzik and myself when I found a similar issue on the 'natsemi.c' driver.
Mapping a PCI address with length zero is a BUG, period. You length should
be the maximum RX buffer length + 2. You will see from the patches in the
messages below that this is for IP header alignment. Good luck and please let
use know how it turns out.
-Steve
http://lkml.org/lkml/2004/3/16/218
http://lkml.org/lkml/2004/3/16/244
next prev parent reply other threads:[~2004-03-29 20:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-29 20:01 BUG in pcnet32.c? Brian Murphy
2004-03-29 20:25 ` Steven J. Hill [this message]
2004-03-29 20:55 ` Kevin D. Kissell
2004-03-29 20:55 ` Kevin D. Kissell
2004-03-29 20:58 ` Steven J. Hill
2004-03-30 1:24 ` Ralf Baechle
2004-03-30 2:30 ` Steven J. Hill
2004-03-31 20:48 ` Brian Murphy
2004-04-01 8:31 ` Geert Uytterhoeven
2004-04-01 17:31 ` Ralf Baechle
2004-04-02 8:27 ` Brian Murphy
2004-04-02 8:39 ` Ralf Baechle
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=4068864D.1020209@realitydiluted.com \
--to=sjhill@realitydiluted.com \
--cc=brian@murphy.dk \
--cc=linux-mips@linux-mips.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