netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Sven Schuster <schuster.sven@gmx.de>
Cc: Jeff Garzik <jgarzik@pobox.com>, netdev@oss.sgi.com
Subject: Re: [patch] tg3 ring buffer allocation error handling
Date: Wed, 14 Apr 2004 16:45:10 -0500	[thread overview]
Message-ID: <20040414214510.GH1175@waste.org> (raw)
In-Reply-To: <20040414205959.GA22051@zion.homelinux.com>

On Wed, Apr 14, 2004 at 10:59:59PM +0200, Sven Schuster wrote:
> On Wed, Apr 14, 2004 at 01:46:42PM -0500, Matt Mackall told us:
> >  	if (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) {
> >  		for (i = 0; i < tp->rx_jumbo_pending; i++) {
> >  			if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_JUMBO,
> > -					     -1, i) < 0)
> > -				break;
> > +					     -1, i) < 0) {
> > +				printk("tg3_alloc_rx_skb %d failed\n", i);
> > +				return -ENOMEM;
> 
> Please correct me if I'm wrong, but shouldn't the buffers from the 
> irst allocation (RXD_OPAQUE_RING_STD) be freed (maybe via 
> tg3_free_rings??) when we get an error here??

The buffers are freed in the module release path, which is invoked
when we return failure here. Without this, we don't notice the
allocation failure and instead blow up when we get traffic.

FYI, I last tested this on a mem=4M box, where it was very obvious
that the 1M of ring buffers weren't leaking.

-- 
Matt Mackall : http://www.selenic.com : Linux development and consulting

  reply	other threads:[~2004-04-14 21:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 18:46 [patch] tg3 ring buffer allocation error handling Matt Mackall
2004-04-14 20:59 ` Sven Schuster
2004-04-14 21:45   ` Matt Mackall [this message]
2004-04-14 22:02     ` Sven Schuster

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=20040414214510.GH1175@waste.org \
    --to=mpm@selenic.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    --cc=schuster.sven@gmx.de \
    /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).