| To: | Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] cleanup large frame handling for natsemi.c |
| From: | Jeff Garzik <jgarzik@xxxxxxxxx> |
| Date: | Sun, 20 Jun 2004 14:38:55 -0400 |
| Cc: | netdev@xxxxxxxxxxx |
| In-reply-to: | <40D5BE9B.9040106@xxxxxxxxxxxxxxxx> |
| References: | <40D57FC3.9040008@xxxxxxxxxxxxxxxx> <20040620163036.GD16038@xxxxxxxxxxxxx> <40D5BE9B.9040106@xxxxxxxxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mutt/1.4.1i |
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
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 1/1 2.4] e1000 management reset fix, Jeff Garzik |
|---|---|
| Next by Date: | Re: [PATCH] cleanup large frame handling for natsemi.c, Manfred Spraul |
| Previous by Thread: | Re: [PATCH] cleanup large frame handling for natsemi.c, Manfred Spraul |
| Next by Thread: | Re: [PATCH] cleanup large frame handling for natsemi.c, Manfred Spraul |
| Indexes: | [Date] [Thread] [Top] [All Lists] |