Subject: Re: [PATCH] cleanup large frame handling for natsemi.c

From: Manfred Spraul <[email-masked]>
Date: Sun, 20 Jun 2004 21:31:22 +0200

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