netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/7] sfc: Work around XMAC bug causing packet loss with some peers
@ 2009-08-26 18:17 Ben Hutchings
  2009-08-27  1:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2009-08-26 18:17 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

Received frames must be re-clocked by the local XGXS to the 156.25 MHz
(DDR) clock of the XGMII.  If the remote clock is slightly faster this
can reduce a minimum IPG of 64 bit-times (1 cycle) to 32 bit-times
(half a cycle).  If the XMAC detects that a frame has reached the
maximum RX frame length in the same cycle that it receives one of
these reduced IPGs, it may miss the IPG, causing two valid frames to
be treated as a single invalid frame (over-length with bad CRC).

We work around this by increasing the maximum RX frame length so that
peers with matched MTU will not provoke this bug.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/net_driver.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 5eabede..298566d 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -984,9 +984,14 @@ static inline void clear_bit_le(unsigned nr, unsigned char *addr)
  *
  * The 10G MAC used in Falcon requires 8-byte alignment on the frame
  * length, so we round up to the nearest 8.
+ *
+ * Re-clocking by the XGXS on RX can reduce an IPG to 32 bits (half an
+ * XGMII cycle).  If the frame length reaches the maximum value in the
+ * same cycle, the XMAC can miss the IPG altogether.  We work around
+ * this by adding a further 16 bytes.
  */
 #define EFX_MAX_FRAME_LEN(mtu) \
-	((((mtu) + ETH_HLEN + VLAN_HLEN + 4/* FCS */) + 7) & ~7)
+	((((mtu) + ETH_HLEN + VLAN_HLEN + 4/* FCS */ + 7) & ~7) + 16)
 

 #endif /* EFX_NET_DRIVER_H */

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


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

* Re: [PATCH 5/7] sfc: Work around XMAC bug causing packet loss with some peers
  2009-08-26 18:17 [PATCH 5/7] sfc: Work around XMAC bug causing packet loss with some peers Ben Hutchings
@ 2009-08-27  1:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-08-27  1:04 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev, linux-net-drivers

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 26 Aug 2009 19:17:59 +0100

> Received frames must be re-clocked by the local XGXS to the 156.25 MHz
> (DDR) clock of the XGMII.  If the remote clock is slightly faster this
> can reduce a minimum IPG of 64 bit-times (1 cycle) to 32 bit-times
> (half a cycle).  If the XMAC detects that a frame has reached the
> maximum RX frame length in the same cycle that it receives one of
> these reduced IPGs, it may miss the IPG, causing two valid frames to
> be treated as a single invalid frame (over-length with bad CRC).
> 
> We work around this by increasing the maximum RX frame length so that
> peers with matched MTU will not provoke this bug.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Applied.

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

end of thread, other threads:[~2009-08-27  1:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 18:17 [PATCH 5/7] sfc: Work around XMAC bug causing packet loss with some peers Ben Hutchings
2009-08-27  1:04 ` 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).