msk watchdog timeout

Pyun YongHyeon pyunyh at gmail.com
Mon Oct 1 01:04:47 PDT 2007


On Mon, Oct 01, 2007 at 03:39:47PM +0800, Kudo Chien wrote:
 > Hi,
 > 
 > Once again, I had the msk watchdog timeout problem under moderate load. I've
 > surveyed msk related posts before.
 > There are many reports and solutions, but they seems not help for me.
 > 
 > Whenever I try to get a FreeBSD iso file through ftp (transfer rate is about
 > 3 MB/s), msk would be down. Some messages from dmesg are like:
 > msk0: watchdog timeout
 > msk0: link state changed to DOWN
 > msk0: link state changed to UP
 > mskc0: Tx descriptor error
 > mskc0: Tx descriptor error
 > msk0: watchdog timeout
 > msk0: link state changed to DOWN
 > msk0: link state changed to UP
 > 
 > I used FreeBSD 6.2-STABLE before, since there is some related patch for msk
 > at FreeBSD-Current (if_msk.c rev. 1.18). I upgrade to Current, but the
 > problem seems not solved. Certainly, I tried to add hw.msk.legacy_intr="1"
 > in /boot/loader.conf. Whether disabling  MSI or not, the problem is as
 > before. In order to avoid shared interrupt, I've also disabled USB device in
 > BIOS, but not help.
 > 
 > Could you please tell me how to solve this problem.
 > Thanks a lot
 > 
 > ---
 > My host is Intel Core 2 Duo E6300 + Onboard Marvel 8056 Gigabit LAN
 > Controller (My MB is GA-965G-DS3 of Gigabyte,
 > http://www.gigabyte.com.tw/Products/Motherboard/Products_Spec.aspx?ClassValue=Motherboard&ProductID=2417&ProductName=GA-965G-DS3
 > )
 > 
 > uname:
 > 7.0-CURRENT FreeBSD 7.0-CURRENT #2: Thu Sep 27 00:11:01 CST 2007
 > root at localhost:/usr/obj/usr/src/sys/SMP  i386
 > 
 > ifconfig:
 > msk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
 >         options=9a<TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
 >         ether 00:16:e6:de:bf:ed
 >         inet x.x.x.x netmask 0xffffff00 broadcast x.x.x.x
 >         media: Ethernet autoselect (1000baseTX <full-duplex,flag2>)
 >         status: active
 > 
 > boot message:
 > msk0: <Marvell Technology Group Ltd. Yukon EC Ultra Id 0xb4 Rev 0x02> on
 > mskc0
 > msk0: Ethernet address: 00:16:e6:de:bf:ed
 > miibus0: <MII bus> on msk0
 > e1000phy0: <Marvell 88E1149 Gigabit PHY> PHY 0 on miibus0
 > e1000phy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX,
 > auto
 > mskc0: [ITHREAD]
 > 
 > vmstat -i:
 > interrupt                          total       rate
 > irq1: atkbd0                           6          0
 > irq6: fdc0                             1          0
 > irq14: ata0                        97074          0
 > irq15: ata1                          629          0
 > irq16: mskc0                      288008          1
 > irq19: atapci0+                     1522          0
 > cpu0: timer                    421587304       1922
 > cpu1: timer                    421586922       1922
 > Total                          843561466       3846
 > 
 > 
 > pciconf -lv:
 > mskc0 at pci3:0:0: class=0x020000 card=0xe0001458 chip=0x436411ab rev=0x14
 > hdr=0x00
 >     vendor     = 'Marvell Semiconductor (Was: Galileo Technology Ltd)'
 >     class      = network
 >     subclass   = ethernet
 > 

It seems that you have Yukon EC Ultra and 88E1149 PHY. Due to lack of
hardwares Yukon EC Ultra was not tested by me and it may have bugs.
It's also known that 88E1149 PHY has some issues which were not solved
yet. I have a WIP version that may fix Yukon EC Ultra issues but I'm
not sure whether it would work or not. Would you try attached patch?

-- 
Regards,
Pyun YongHyeon
-------------- next part --------------
Index: if_msk.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/msk/if_msk.c,v
retrieving revision 1.18
diff -u -r1.18 if_msk.c
--- if_msk.c	20 Jul 2007 00:25:20 -0000	1.18
+++ if_msk.c	1 Oct 2007 07:59:48 -0000
@@ -916,7 +916,7 @@
 			error = EINVAL;
 			break;
 		}
-		if (sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_EC_U &&
+		if (sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_FE &&
 		    ifr->ifr_mtu > MSK_MAX_FRAMELEN) {
 			error = EINVAL;
 			break;
@@ -983,6 +983,16 @@
 			else
 				ifp->if_hwassist &= ~CSUM_TSO;
 		}
+		if (sc_if->msk_framesize > MSK_MAX_FRAMELEN &&
+		    sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_EC_U) {
+			/*
+			 * In Yukon EC Ultra, TSO & checksum offload is not
+			 * supported for jumbo frame.
+			 */
+			ifp->if_hwassist &= ~(MSK_CSUM_FEATURES | CSUM_TSO);
+			ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM);
+		}
+
 		VLAN_CAPABILITIES(ifp);
 		MSK_IF_UNLOCK(sc_if);
 		break;
@@ -1453,13 +1463,8 @@
 	 * compute the checksum? I think there is no reason to spend time to
 	 * make Rx checksum offload work on Yukon II hardware.
 	 */
-	ifp->if_capabilities = IFCAP_TXCSUM;
-	ifp->if_hwassist = MSK_CSUM_FEATURES;
-	if (sc->msk_hw_id != CHIP_ID_YUKON_EC_U) {
-		/* It seems Yukon EC Ultra doesn't support TSO. */
-		ifp->if_capabilities |= IFCAP_TSO4;
-		ifp->if_hwassist |= CSUM_TSO;
-	}
+	ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4;
+	ifp->if_hwassist = MSK_CSUM_FEATURES | CSUM_TSO;
 	ifp->if_capenable = ifp->if_capabilities;
 	ifp->if_ioctl = msk_ioctl;
 	ifp->if_start = msk_start;
@@ -1505,6 +1510,9 @@
 	 */
         ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 
+	sc_if->msk_framesize = ifp->if_mtu + ETHER_HDR_LEN +
+	    ETHER_VLAN_ENCAP_LEN;
+
 	/*
 	 * Do miibus setup.
 	 */
@@ -3706,6 +3714,15 @@
 
 	sc_if->msk_framesize = ifp->if_mtu + ETHER_HDR_LEN +
 	    ETHER_VLAN_ENCAP_LEN;
+	if (sc_if->msk_framesize > MSK_MAX_FRAMELEN &&
+	    sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_EC_U) {
+		/*
+		 * In Yukon EC Ultra, TSO & checksum offload is not
+		 * supported for jumbo frame.
+		 */
+		ifp->if_hwassist &= ~(MSK_CSUM_FEATURES | CSUM_TSO);
+		ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM);
+	}
 
 	/*
 	 * Initialize GMAC first.
@@ -3796,27 +3813,25 @@
 	/* Configure hardware VLAN tag insertion/stripping. */
 	msk_setvlan(sc_if, ifp);
 
-	/* XXX It seems STFW is requried for all cases. */
-	CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), TX_STFW_ENA);
-
 	if (sc->msk_hw_id == CHIP_ID_YUKON_EC_U) {
 		/* Set Rx Pause threshould. */
 		CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, RX_GMF_LP_THR),
 		    MSK_ECU_LLPP);
 		CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, RX_GMF_UP_THR),
 		    MSK_ECU_ULPP);
+		/*
+		 * Set Tx GMAC FIFO Almost Empty Threshold.
+		 */
+		CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR),
+		    MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR);
 		if (sc_if->msk_framesize > MSK_MAX_FRAMELEN) {
-			/*
-			 * Can't sure the following code is needed as Yukon
-			 * Yukon EC Ultra may not support jumbo frames.
-			 *
-			 * Set Tx GMAC FIFO Almost Empty Threshold.
-			 */
-			CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR),
-			    MSK_ECU_AE_THR);
 			/* Disable Store & Forward mode for Tx. */
 			CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T),
-			    TX_STFW_DIS);
+			    TX_JUMBO_ENA | TX_STFW_DIS);
+		} else {
+			/* Enable Store & Forward mode for Tx. */
+			CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T),
+			    TX_JUMBO_DIS | TX_STFW_ENA);
 		}
 	}
 
Index: if_mskreg.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/msk/if_mskreg.h,v
retrieving revision 1.6
diff -u -r1.6 if_mskreg.h
--- if_mskreg.h	12 Jun 2007 10:50:32 -0000	1.6
+++ if_mskreg.h	1 Oct 2007 07:59:49 -0000
@@ -1082,8 +1082,9 @@
 /* Threshold values for Yukon-EC Ultra */
 #define	MSK_ECU_ULPP	0x0080	/* Upper Pause Threshold (multiples of 8) */
 #define	MSK_ECU_LLPP	0x0060	/* Lower Pause Threshold (multiples of 8) */
-#define	MSK_ECU_AE_THR	0x0180  /* Almost Empty Threshold */
+#define	MSK_ECU_AE_THR	0x0070  /* Almost Empty Threshold */
 #define	MSK_ECU_TXFF_LEV	0x01a0	/* Tx BMU FIFO Level */
+#define	MSK_ECU_JUMBO_WM	0x01
 
 #define MSK_BMU_RX_WM		0x600	/* BMU Rx Watermark */
 #define MSK_BMU_TX_WM		0x600	/* BMU Tx Watermark */
@@ -1863,6 +1864,8 @@
 #define	TX_STFW_ENA	BIT_30	/* Enable Store & Forward (Yukon-EC Ultra) */
 #define TX_VLAN_TAG_ON	BIT_25	/* enable  VLAN tagging */
 #define TX_VLAN_TAG_OFF	BIT_24	/* disable VLAN tagging */
+#define	TX_JUMBO_ENA	BIT_23	/* Enable Jumbo Mode (Yukon-EC Ultra) */
+#define	TX_JUMBO_DIS	BIT_22	/* Disable Jumbo Mode (Yukon-EC Ultra) */
 #define GMF_WSP_TST_ON	BIT_18	/* Write Shadow Pointer Test On */
 #define GMF_WSP_TST_OFF	BIT_17	/* Write Shadow Pointer Test Off */
 #define GMF_WSP_STEP	BIT_16	/* Write Shadow Pointer Step/Increment */


More information about the freebsd-current mailing list