netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v6 0/2] stmmac: fix kernel crashes for jumbo frames
@ 2014-01-20 11:38 Vince Bridgers
  2014-01-20 11:39 ` [PATCH net-next v6 1/2] dts: Add a binding for Synopsys emac max-frame-size Vince Bridgers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vince Bridgers @ 2014-01-20 11:38 UTC (permalink / raw)
  To: devicetree, netdev
  Cc: peppe.cavallaro, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, dinguyen, rayagond, vbridgers2013

v6:
* no changes since v5, respin for updated net-next

v5:
* Simplify use notes for max-frame-size in stmmac.txt, in the
  devicetree patch. No change to the stmmac driver patch
  from v4.

v4:
* Address inconsistent comment with use, add comments about inconsistency
  of max-frame-size definition and use in the ePAPR v1.1 specification.

v3:
* change snps,max-frame-size to max-frame-size

v2:
* change snps,max-mtu to snps,max-frame-size

These patches address two kernel crashes seen when using jumbo frames on 
the Synopsys stmmac driver, and adds device tree configurability for the 
maximum mtu. The Synopsys emac fifo sizes can be configured when a logic
design is synthesized, but does not provide a way for a driver to query the
exact fifo size. 

The crashes seen were due to two issues. 

1) The dma buffer size was being set after the dma buffers were allocated.
This caused a crash when changing the mtu since it was possible the buffers
would subsequently be freed using an incorrect dma buffer size. This could
also cause kernel panics due to memory corruption since a large mtu size could
have been configured, but the dma buffers were not sized accordingly. 

2) Jumbo frames were being enabled by default, but the dma buffers were not
sized accordingly. This caused memory corruption in the context of certain
types of network traffic, leading to kernel panics. 

I've tested these changes using automated, reproducible testware. I can
demonstrate the panics described before the fixes and show that the fixes
address the problems described. 

Testing and improvements continue through the use of the mentioned automated
and reproducible testware. 

Vince Bridgers

Vince Bridgers (2):
  dts: Add a binding for Synopsys emac max-frame-size
  stmmac: Fix kernel crashes for jumbo frames

 Documentation/devicetree/bindings/net/stmmac.txt   |    3 +++
 drivers/net/ethernet/stmicro/stmmac/common.h       |    4 +++-
 drivers/net/ethernet/stmicro/stmmac/dwmac1000.h    |    7 ++-----
 .../net/ethernet/stmicro/stmmac/dwmac1000_core.c   |    7 ++++++-
 .../net/ethernet/stmicro/stmmac/dwmac100_core.c    |    2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |   11 +++++++----
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   13 +++++++++++++
 include/linux/stmmac.h                             |    1 +
 8 files changed, 36 insertions(+), 12 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-22  1:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-20 11:38 [PATCH net-next v6 0/2] stmmac: fix kernel crashes for jumbo frames Vince Bridgers
2014-01-20 11:39 ` [PATCH net-next v6 1/2] dts: Add a binding for Synopsys emac max-frame-size Vince Bridgers
2014-01-20 11:39 ` [PATCH net-next v6 2/2] stmmac: Fix kernel crashes for jumbo frames Vince Bridgers
2014-01-22  1:05 ` [PATCH net-next v6 0/2] stmmac: fix " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).