G'day,

This patch fixes the bug discussed in PV 892552, where a tg3 driver
workaround for a bug in BCM5701 cards (the ones we currently ship
standard in the Altix) causes multiple kernel unaligned exceptions
for every UDP or TCP packet received, and ruins network performance,

A very similar and functionally identical fix to the one below was
originally checked into LBS, and replaced with this one in PV 903046.
This patch is a port to 2.6 of the PV 903046 patch.

STATUS
tg3-unaligned.patch
  S: pushed to SuSE; not in Linus' or Marcello's trees.
  O: johnip
  D: fix kernel unaligned exceptions on BCM5701 based cards
  N: PV 903046, PV 892552
  
ORDER
(anywhere)


--- 2.6.0-test11-ia64-sn1/drivers/net/Kconfig	Mon Oct 20 11:14:53 2003
+++ 2.6.0-test11-work/drivers/net/Kconfig	Fri Dec  5 22:28:34 2003
@@ -2017,6 +2017,12 @@
 	  To compile this driver as a module, choose M here: the module
 	  will be called tg3.  This is recommended.
 
+
+config UNALIGNED_EXPENSIVE
+	bool
+	depends on TIGON3 && IA64
+	default y
+
 endmenu
 
 #
--- 2.6.0-test11-ia64-sn1/drivers/net/tg3.c	Fri Dec  5 13:54:18 2003
+++ 2.6.0-test11-work/drivers/net/tg3.c	Fri Dec  5 22:14:23 2003
@@ -2257,7 +2257,11 @@
 
 		len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */
 
-		if (len > RX_COPY_THRESHOLD) {
+		if (len > RX_COPY_THRESHOLD
+#if defined(CONFIG_UNALIGNED_EXPENSIVE)
+		&& tp->rx_offset == 2
+#endif
+		) {
 			int skb_size;
 
 			skb_size = tg3_alloc_rx_skb(tp, opaque_key,
--- 2.6.0-test11-ia64-sn1/arch/ia64/configs/generic_defconfig	Fri Dec  5 13:54:14
2003
+++ 2.6.0-test11-work/arch/ia64/configs/generic_defconfig	Fri Dec  5 22:36:34 2003
@@ -335,6 +335,7 @@
 # CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=y
+CONFIG_UNALIGNED_EXPENSIVE=y
 
 #
 # Ethernet (10000 Mbit)
--- 2.6.0-test11-ia64-sn1/arch/ia64/configs/sn2_defconfig	Fri Dec  5 13:54:14 2003
+++ 2.6.0-test11-work/arch/ia64/configs/sn2_defconfig	Fri Dec  5 22:36:29 2003
@@ -307,6 +307,7 @@
 # CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=y
+CONFIG_UNALIGNED_EXPENSIVE=y
 
 #
 # Ethernet (10000 Mbit)




Greg.
-- 
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.
