Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: "Alexey Zaytsev" <alexey.zaytsev@gmail.com>,
	"Michael Büsch" <m@bues.ch>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	netdev@vger.kernel.org, "Gary Zambrano" <zambrano@broadcom.com>,
	bugme-daemon@bugzilla.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Pekka Pietikainen" <pp@ee.oulu.fi>,
	"Florian Schirmer" <jolt@tuxbox.org>,
	"Felix Fietkau" <nbd@openwrt.org>,
	"Michael Buesch" <mb@bu3sch.de>
Subject: Re: [Bugme-new] [Bug 38102] New: BUG kmalloc-2048: Poison overwritten
Date: Tue, 05 Jul 2011 20:13:54 +0200	[thread overview]
Message-ID: <1309889634.2545.2.camel@edumazet-laptop> (raw)
In-Reply-To: <20110705180650.GF2959@hmsreliant.think-freely.org>

Le mardi 05 juillet 2011 à 14:06 -0400, Neil Horman a écrit :
> On Tue, Jul 05, 2011 at 06:47:21PM +0200, Eric Dumazet wrote:
> > Le mardi 05 juillet 2011 à 12:42 -0400, Neil Horman a écrit :
> > > On Tue, Jul 05, 2011 at 06:12:32PM +0200, Eric Dumazet wrote:
> > 
> > > > So all descriptors before prod are guaranteed to be ready for host
> > > > consume... Fact that a dma access is running on 'next descriptor' should
> > > > be irrelevant.
> > > > 
> > > But we handle more than one descriptor per b44_rx call - theres a while loop in
> > > there where we do advance to the next descriptor.
> > 
> > Yes, but we advance up to 'prod', which is the very last safe
> > descriptor.
> > 
> > If hardware advertises descriptor X being ready to be handled by host,
> > while DMA on this X descriptor is not yet finished, this would be a
> > really useless hardware ;)
> > 
> > 
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
> 
> 
> Something else just jumped out at me.  During b44_open, we call b44_init_rings.
> This function allocates bp->rx_pending skb's and iteratively puts them in the rx
> dma ring. bp->rx_pending is initalized to B44_DEF_RX_RING_PENDING, which is
> defined as 200 (just about half of the 512 entries that the dma ring actually
> supports in the hardware.  This is normally ok, as subsequent calls to
> b44_alloc_rx_skb will fill in entries in the ring as those skbs are consumed.
> The problem with this however is that b44_alloc_rx_skb only sets the
> DESC_CTRL_EOT bit in the descriptor of the 512th entry, indicating that the
> hardware should wrap around and reset the index counter.  If a large volume of
> traffic is pushed through the adapter early on after initalization, or if the
> cpu is busy during init, it would be possible that the ring buffer would fill up
> prior to having additional entries added to the ring, the result being that the
> dma engine would reach the end of the allocated descriptors, not see an EOT bit
> set, and continue on using unallocated descriptors.
> 
> Just a theory, but it would be interesting to see if the problem subsided if you
> ensured that you allocated  a full descriptor ring on b44_open
> Neil
>  
> diff --git a/drivers/net/b44.c b/drivers/net/b44.c
> index 3d247f3..1b58a7c 100644
> --- a/drivers/net/b44.c
> +++ b/drivers/net/b44.c
> @@ -57,7 +57,7 @@
>  #define B44_MAX_MTU			1500
>  
>  #define B44_RX_RING_SIZE		512
> -#define B44_DEF_RX_RING_PENDING		200
> +#define B44_DEF_RX_RING_PENDING		512
>  #define B44_RX_RING_BYTES	(sizeof(struct dma_desc) * \
>  				 B44_RX_RING_SIZE)
>  #define B44_TX_RING_SIZE		512

No

Please take time to read the driver again.

200 desc are setup, and NIC is not allowed to use more than 200 descs.

( B44_DMARX_PTR )

We carefuly advance this pointer after a new desc(s) is(are) setup




  reply	other threads:[~2011-07-05 18:13 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-38102-10286@https.bugzilla.kernel.org/>
2011-06-29 21:51 ` [Bugme-new] [Bug 38102] New: BUG kmalloc-2048: Poison overwritten Andrew Morton
2011-07-01  6:01   ` Alexey Zaytsev
2011-07-02 21:25     ` Alexey Zaytsev
2011-07-03 15:46       ` Eric Dumazet
2011-07-04 11:48         ` Alexey Zaytsev
2011-07-04 13:05           ` Michael Büsch
2011-07-04 13:57             ` Eric Dumazet
2011-07-04 14:27               ` Michael Büsch
2011-07-04 14:43                 ` Michael Büsch
2011-07-04 14:53                   ` Eric Dumazet
2011-07-04 15:12                   ` Eric Dumazet
2011-07-04 20:25                     ` Alexey Zaytsev
2011-07-04 22:29                       ` Alexey Zaytsev
2011-07-05  3:44                         ` Eric Dumazet
2011-07-05  3:56                           ` Alexey Zaytsev
2011-07-05  4:11                             ` Eric Dumazet
2011-07-05  4:14                               ` Eric Dumazet
2011-07-05  4:17                                 ` Alexey Zaytsev
2011-07-05  4:18                                   ` Alexey Zaytsev
2011-07-05  4:25                                   ` Eric Dumazet
2011-07-05  4:29                                     ` Alexey Zaytsev
2011-07-05  4:38                                       ` Eric Dumazet
2011-07-05  4:57                                         ` Alexey Zaytsev
2011-07-05  5:10                                           ` Eric Dumazet
2011-07-05  5:18                                             ` Alexey Zaytsev
2011-07-05  5:33                                               ` Eric Dumazet
2011-07-05  5:59                                                 ` Eric Dumazet
2011-07-05 16:05                                                   ` Neil Horman
2011-07-05 16:12                                                     ` Eric Dumazet
2011-07-05 16:27                                                       ` Michael Büsch
2011-07-05 16:42                                                       ` Neil Horman
2011-07-05 16:47                                                         ` Eric Dumazet
2011-07-05 16:57                                                           ` Eric Dumazet
2011-07-05 17:01                                                             ` Joe Perches
2011-07-05 17:21                                                           ` Neil Horman
2011-07-05 18:06                                                           ` Neil Horman
2011-07-05 18:13                                                             ` Eric Dumazet [this message]
2011-07-05 18:32                                                               ` Eric Dumazet
2011-07-05 18:45                                                                 ` Eric Dumazet
2011-07-05 19:53                                                                   ` Neil Horman
2011-07-05 20:02                                                                     ` Eric Dumazet
2011-07-05 20:15                                                                       ` Eric Dumazet
2011-07-05 22:06                                                                         ` Neil Horman
2011-07-06 15:32                                                                           ` Michael Büsch
2011-07-06 16:00                                                                             ` Eric Dumazet
2011-07-06 16:12                                                                               ` Michael Büsch
2011-07-06 16:35                                                                                 ` Eric Dumazet
2011-07-06 16:56                                                                             ` Eric Dumazet
2011-07-07  6:32                                                                               ` Alexey Zaytsev
2011-07-07  6:48                                                                                 ` Eric Dumazet
2011-07-07  7:45                                                                                   ` Alexey Zaytsev
2011-07-07  9:20                                                                                     ` Eric Dumazet
2011-07-07  9:34                                                                                       ` Alexey Zaytsev
2011-07-07  9:37                                                                                         ` Alexey Zaytsev
2011-07-07  9:43                                                                                           ` Alexey Zaytsev
2011-07-07  9:52                                                                                             ` Eric Dumazet
2011-07-05  4:21                           ` Eric Dumazet
2011-07-04 14:00           ` Eric Dumazet
2011-07-04 14:31             ` Michael Büsch
2011-07-04 14:45               ` Eric Dumazet
2011-07-04 14:51                 ` Michael Büsch

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=1309889634.2545.2.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexey.zaytsev@gmail.com \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=davem@davemloft.net \
    --cc=jolt@tuxbox.org \
    --cc=m@bues.ch \
    --cc=mb@bu3sch.de \
    --cc=nbd@openwrt.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=pp@ee.oulu.fi \
    --cc=zambrano@broadcom.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox