netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH] cleanup large frame handling for natsemi.c
Date: Sun, 20 Jun 2004 14:38:55 -0400	[thread overview]
Message-ID: <20040620183855.GA26392@havoc.gtf.org> (raw)
In-Reply-To: <40D5BE9B.9040106@colorfullife.com>

On Sun, Jun 20, 2004 at 06:43:07PM +0200, Manfred Spraul wrote:
> @@ -1909,9 +1916,13 @@
>  	np->dirty_rx = 0;
>  	np->cur_rx = RX_RING_SIZE;
>  	np->oom = 0;
> -	np->rx_buf_sz = PKT_BUF_SZ;
> -	if (dev->mtu > ETH_DATA_LEN)
> -		np->rx_buf_sz += dev->mtu - ETH_DATA_LEN;
> +	if (dev->mtu <= ETH_DATA_LEN)
> +		np->rx_buf_sz = ETH_DATA_LEN + NATSEMI_HEADERS;
> +	else
> +		np->rx_buf_sz = dev->mtu + NATSEMI_HEADERS;
> +	if (np->rx_buf_sz > NATSEMI_RX_LIMIT)
> +		np->rx_buf_sz = NATSEMI_RX_LIMIT;
> +

Double NAK:

1) Use PKT_BUF_SZ, don't alloc smaller than that.

2) The final check should not be needed.  The code should guarantee that
np->rx_buf_sz never exceeds NATSEMI_RX_LIMIT.

	Jeff

  reply	other threads:[~2004-06-20 18:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-20 12:14 [PATCH] cleanup large frame handling for natsemi.c Manfred Spraul
2004-06-20 16:30 ` Jeff Garzik
2004-06-20 16:43   ` Manfred Spraul
2004-06-20 18:38     ` Jeff Garzik [this message]
2004-06-20 19:31       ` Manfred Spraul

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=20040620183855.GA26392@havoc.gtf.org \
    --to=jgarzik@pobox.com \
    --cc=manfred@colorfullife.com \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).