]> asedeno.scripts.mit.edu Git - linux.git/commit
gianfar: Maximize Rx buffer size
authorClaudiu Manoil <claudiu.manoil@nxp.com>
Tue, 5 Nov 2019 18:18:21 +0000 (20:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Nov 2019 18:25:20 +0000 (10:25 -0800)
commita9b97286fec1a87976ac7852ad65f2013faad9f6
tree4798956fc7b88f5103141dffe29120625705fd91
parent9439bb0f3656003308a479a9a785ec2e79cfeb39
gianfar: Maximize Rx buffer size

Until now the size of a Rx buffer was artificially limited
to 1536B (which happens to be the default, after reset, hardware
value for a Rx buffer). This approach however leaves unused
memory space for Rx packets, since the driver uses a paged
allocation scheme that reserves half a page for each Rx skb.
There's also the inconvenience that frames around 1536 bytes
can get scattered if the limit is slightly exceeded. This limit
can be exceeded even for standard MTU of 1500B traffic, for common
cases like stacked VLANs, or DSA tags.
To address these issues, let's just compute the buffer size
starting from the upper limit of 2KB (half a page) and
subtract the skb overhead and alignment restrictions.

Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar.h