stmmac: fix oversized frame reception
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>
Thu, 26 Nov 2015 07:35:45 +0000 (08:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Nov 2015 19:52:52 +0000 (14:52 -0500)
commite527c4a769d375ac0472450c52bde29087f49cd9
tree3418a8c1016d017de9260e0c544a5b19d9a53568
parentae26c1c6cb9bd5ad6fa1dbfdf1fe430ac09b0d28
stmmac: fix oversized frame reception

The receive skb buffers can be preallocated when the link is opened
according to mtu size.
While testing on a network environment with not standard MTU (e.g. 3000),
a panic occurred if an incoming packet had a length greater than rx skb
buffer size. This is because the HW is programmed to copy, from the DMA,
an Jumbo frame and the Sw must check if the allocated buffer is enough to
store the frame.

Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c