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

Jeff Garzik wrote:

>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.
>
>  
>
The alloc size is never smaller than PKT_BUF_SZ: 
ETH_DATA_LEN+NATSEMI_HEADERS+NATSEMI_PADDING is 1586 bytes [still 
smaller than the 1620 byte skb kmalloc cache]

>2) The final check should not be needed.  The code should guarantee that
>np->rx_buf_sz never exceeds NATSEMI_RX_LIMIT.
>
>  
>
You mean: implement a change_mtu callback and reject mtu values above 
2020 byte?

--
    Manfred

>	Jeff
>
>
>  
>

      reply	other threads:[~2004-06-20 19:31 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
2004-06-20 19:31       ` Manfred Spraul [this message]

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=40D5E60A.10007@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=jgarzik@pobox.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).