[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4d199f32-092c-1c0a-7a01-6d0d317ef676@nelint.com>
Date: Mon, 26 Sep 2016 11:39:55 -0700
From: Eric Nelson <eric@...int.com>
To: David Laight <David.Laight@...LAB.COM>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Cc: "linux@....linux.org.uk" <linux@....linux.org.uk>,
"andrew@...n.ch" <andrew@...n.ch>,
"fugang.duan@....com" <fugang.duan@....com>,
"otavio@...ystems.com.br" <otavio@...ystems.com.br>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"troy.kisky@...ndarydevices.com" <troy.kisky@...ndarydevices.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"u.kleine-koenig@...gutronix.de" <u.kleine-koenig@...gutronix.de>
Subject: Re: [PATCH 3/3] net: fec: align IP header in hardware
Hi David,
On 09/26/2016 02:26 AM, David Laight wrote:
> From: Eric Nelson
>> Sent: 24 September 2016 15:42
>> The FEC receive accelerator (RACC) supports shifting the data payload of
>> received packets by 16-bits, which aligns the payload (IP header) on a
>> 4-byte boundary, which is, if not required, at least strongly suggested
>> by the Linux networking layer.
> ...
>> + /* align IP header */
>> + val |= FEC_RACC_SHIFT16;
>
> I can't help feeling that there needs to be corresponding
> changes to increase the buffer size by 2 (maybe for large mtu)
> and to discard two bytes from the frame length.
>
In the normal case, the fec driver over-allocates all receive packets to
be of size FEC_ENET_RX_FRSIZE (2048) minus the value of rx_align,
which is either 0x0f (ARM) or 0x03 (PPC).
If the frame length is less than rx_copybreak (typically 256), then
the frame length from the receive buffer descriptor is used to
control the allocation size for a copied buffer, and this will include
the two bytes of padding if RACC_SHIFT16 is set.
> If probably ought to be predicated on NET_IP_ALIGN as well.
>
Can you elaborate?
Please advise,
Eric
Powered by blists - more mailing lists