netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] skge: fiber related fixes
@ 2006-10-05 22:49 Stephen Hemminger
  2006-10-05 22:49 ` [PATCH 1/4] skge: fix stuck irq when fiber down Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Stephen Hemminger @ 2006-10-05 22:49 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

These patches address the problems that were causing a fiber
connected SysKonnect board to revert to have performance problems.
They fix flow control, duplex, and irq masking issues.

--
Stephen Hemminger <shemminger@osdl.org>


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

* [PATCH 1/4] skge: fix stuck irq when fiber down
  2006-10-05 22:49 [PATCH 0/4] skge: fiber related fixes Stephen Hemminger
@ 2006-10-05 22:49 ` Stephen Hemminger
  2006-10-05 22:49 ` [PATCH 2/4] skge: pause mapping for fiber Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2006-10-05 22:49 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: skge-irq-link-down.patch --]
[-- Type: text/plain, Size: 3619 bytes --]

The PHY interrupt from the internal fiber is getting
stuck on when the link is down. Add code to handle the
transition and mask it.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


---
 drivers/net/skge.c |   53 +++++++++++++++++++++++++++++++++++------------------
 drivers/net/skge.h |    3 ++-
 2 files changed, 37 insertions(+), 19 deletions(-)

--- linux-2.6.orig/drivers/net/skge.c
+++ linux-2.6/drivers/net/skge.c
@@ -884,6 +884,29 @@ static void skge_link_down(struct skge_p
 		printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name);
 }
 
+
+static void xm_link_down(struct skge_hw *hw, int port)
+{
+	struct net_device *dev = hw->dev[port];
+	struct skge_port *skge = netdev_priv(dev);
+	u16 cmd, msk;
+
+	if (hw->phy_type == SK_PHY_XMAC) {
+		msk = xm_read16(hw, port, XM_IMSK);
+		msk |= XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE | XM_IS_AND;
+		xm_write16(hw, port, XM_IMSK, msk);
+	}
+
+	cmd = xm_read16(hw, port, XM_MMU_CMD);
+	cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
+	xm_write16(hw, port, XM_MMU_CMD, cmd);
+	/* dummy read to ensure writing */
+	(void) xm_read16(hw, port, XM_MMU_CMD);
+
+	if (netif_carrier_ok(dev))
+		skge_link_down(skge);
+}
+
 static int __xm_phy_read(struct skge_hw *hw, int port, u16 reg, u16 *val)
 {
 	int i;
@@ -1008,14 +1031,7 @@ static void bcom_check_link(struct skge_
 	status = xm_phy_read(hw, port, PHY_BCOM_STAT);
 
 	if ((status & PHY_ST_LSYNC) == 0) {
-		u16 cmd = xm_read16(hw, port, XM_MMU_CMD);
-		cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
-		xm_write16(hw, port, XM_MMU_CMD, cmd);
-		/* dummy read to ensure writing */
-		(void) xm_read16(hw, port, XM_MMU_CMD);
-
-		if (netif_carrier_ok(dev))
-			skge_link_down(skge);
+		xm_link_down(hw, port);
 		return;
 	}
 
@@ -1235,14 +1251,7 @@ static void xm_check_link(struct net_dev
 	status = xm_phy_read(hw, port, PHY_XMAC_STAT);
 
 	if ((status & PHY_ST_LSYNC) == 0) {
-		u16 cmd = xm_read16(hw, port, XM_MMU_CMD);
-		cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX);
-		xm_write16(hw, port, XM_MMU_CMD, cmd);
-		/* dummy read to ensure writing */
-		(void) xm_read16(hw, port, XM_MMU_CMD);
-
-		if (netif_carrier_ok(dev))
-			skge_link_down(skge);
+		xm_link_down(hw, port);
 		return;
 	}
 
@@ -1568,6 +1577,10 @@ static void genesis_mac_intr(struct skge
 		printk(KERN_DEBUG PFX "%s: mac interrupt status 0x%x\n",
 		       skge->netdev->name, status);
 
+	if (hw->phy_type == SK_PHY_XMAC &&
+	    (status & (XM_IS_INP_ASS | XM_IS_LIPA_RC)))
+		xm_link_down(hw, port);
+
 	if (status & XM_IS_TXF_UR) {
 		xm_write32(hw, port, XM_MODE, XM_MD_FTF);
 		++skge->net_stats.tx_fifo_errors;
@@ -1582,7 +1595,7 @@ static void genesis_link_up(struct skge_
 {
 	struct skge_hw *hw = skge->hw;
 	int port = skge->port;
-	u16 cmd;
+	u16 cmd, msk;
 	u32 mode;
 
 	cmd = xm_read16(hw, port, XM_MMU_CMD);
@@ -1631,7 +1644,11 @@ static void genesis_link_up(struct skge_
 	}
 
 	xm_write32(hw, port, XM_MODE, mode);
-	xm_write16(hw, port, XM_IMSK, XM_DEF_MSK);
+	msk = XM_DEF_MSK;
+	if (hw->phy_type != SK_PHY_XMAC)
+		msk |= XM_IS_INP_ASS;	/* disable GP0 interrupt bit */
+
+	xm_write16(hw, port, XM_IMSK, msk);
 	xm_read16(hw, port, XM_ISRC);
 
 	/* get MMU Command Reg. */
--- linux-2.6.orig/drivers/net/skge.h
+++ linux-2.6/drivers/net/skge.h
@@ -2195,7 +2195,8 @@ enum {
 	XM_IS_RX_COMP	= 1<<0,	/* Bit  0:	Frame Rx Complete */
 };
 
-#define XM_DEF_MSK	(~(XM_IS_RXC_OV | XM_IS_TXC_OV | XM_IS_RXF_OV | XM_IS_TXF_UR))
+#define XM_DEF_MSK	(~(XM_IS_INP_ASS | XM_IS_LIPA_RC | \
+			   XM_IS_RXF_OV | XM_IS_TXF_UR))
 
 
 /*	XM_HW_CFG	16 bit r/w	Hardware Config Register */

--
Stephen Hemminger <shemminger@osdl.org>


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

* [PATCH 2/4] skge: pause mapping for fiber
  2006-10-05 22:49 [PATCH 0/4] skge: fiber related fixes Stephen Hemminger
  2006-10-05 22:49 ` [PATCH 1/4] skge: fix stuck irq when fiber down Stephen Hemminger
@ 2006-10-05 22:49 ` Stephen Hemminger
  2006-10-05 22:49 ` [PATCH 3/4] skge: better flow control negotiation Stephen Hemminger
  2006-10-05 22:49 ` [PATCH 4/4] skge: version 1.9 Stephen Hemminger
  3 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2006-10-05 22:49 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: skge-fiber-half.patch --]
[-- Type: text/plain, Size: 2511 bytes --]

Do correct mapping of pause and duplex when using 1000BaseX fiber
versions of the board.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


---
 drivers/net/skge.c |   38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

--- linux-2.6.orig/drivers/net/skge.c
+++ linux-2.6/drivers/net/skge.c
@@ -197,8 +197,8 @@ static u32 skge_supported_modes(const st
 		else if (hw->chip_id == CHIP_ID_YUKON)
 			supported &= ~SUPPORTED_1000baseT_Half;
 	} else
-		supported = SUPPORTED_1000baseT_Full | SUPPORTED_FIBRE
-			| SUPPORTED_Autoneg;
+		supported = SUPPORTED_1000baseT_Full | SUPPORTED_1000baseT_Half
+			| SUPPORTED_FIBRE | SUPPORTED_Autoneg;
 
 	return supported;
 }
@@ -1018,6 +1018,14 @@ static const u16 phy_pause_map[] = {
 	[FLOW_MODE_REM_SEND]  = PHY_AN_PAUSE_CAP | PHY_AN_PAUSE_ASYM,
 };
 
+/* special defines for FIBER (88E1011S only) */
+static const u16 fiber_pause_map[] = {
+	[FLOW_MODE_NONE]	= PHY_X_P_NO_PAUSE,
+	[FLOW_MODE_LOC_SEND]	= PHY_X_P_ASYM_MD,
+	[FLOW_MODE_SYMMETRIC]	= PHY_X_P_SYM_MD,
+	[FLOW_MODE_REM_SEND]	= PHY_X_P_BOTH_MD,
+};
+
 
 /* Check status of Broadcom phy link */
 static void bcom_check_link(struct skge_hw *hw, int port)
@@ -1207,17 +1215,7 @@ static void xm_phy_init(struct skge_port
 		if (skge->advertising & ADVERTISED_1000baseT_Full)
 			ctrl |= PHY_X_AN_FD;
 
-		switch(skge->flow_control) {
-		case FLOW_MODE_NONE:
-			ctrl |= PHY_X_P_NO_PAUSE;
-			break;
-		case FLOW_MODE_LOC_SEND:
-			ctrl |= PHY_X_P_ASYM_MD;
-			break;
-		case FLOW_MODE_SYMMETRIC:
-			ctrl |= PHY_X_P_BOTH_MD;
-			break;
-		}
+		ctrl |= fiber_pause_map[skge->flow_control];
 
 		xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl);
 
@@ -1796,11 +1794,17 @@ static void yukon_init(struct skge_hw *h
 				adv |= PHY_M_AN_10_FD;
 			if (skge->advertising & ADVERTISED_10baseT_Half)
 				adv |= PHY_M_AN_10_HD;
-		} else	/* special defines for FIBER (88E1011S only) */
-			adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD;
 
-		/* Set Flow-control capabilities */
-		adv |= phy_pause_map[skge->flow_control];
+			/* Set Flow-control capabilities */
+			adv |= phy_pause_map[skge->flow_control];
+		} else {
+			if (skge->advertising & ADVERTISED_1000baseT_Full)
+				adv |= PHY_M_AN_1000X_AFD;
+			if (skge->advertising & ADVERTISED_1000baseT_Half)
+				adv |= PHY_M_AN_1000X_AHD;
+
+			adv |= fiber_pause_map[skge->flow_control];
+		}
 
 		/* Restart Auto-negotiation */
 		ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG;

--
Stephen Hemminger <shemminger@osdl.org>


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

* [PATCH 3/4] skge: better flow control negotiation
  2006-10-05 22:49 [PATCH 0/4] skge: fiber related fixes Stephen Hemminger
  2006-10-05 22:49 ` [PATCH 1/4] skge: fix stuck irq when fiber down Stephen Hemminger
  2006-10-05 22:49 ` [PATCH 2/4] skge: pause mapping for fiber Stephen Hemminger
@ 2006-10-05 22:49 ` Stephen Hemminger
  2006-10-05 22:49 ` [PATCH 4/4] skge: version 1.9 Stephen Hemminger
  3 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2006-10-05 22:49 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: skge-default-both.patch --]
[-- Type: text/plain, Size: 10332 bytes --]

Do flow control negotiation properly. Don't let auto negotiation
status limit renegotiation. Separate desired pause values from
the result of auto negotiation.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

---
 drivers/net/skge.c |  129 ++++++++++++++++++++++++++++++++---------------------
 drivers/net/skge.h |   22 ++++++---
 2 files changed, 95 insertions(+), 56 deletions(-)

--- linux-2.6.orig/drivers/net/skge.c
+++ linux-2.6/drivers/net/skge.c
@@ -487,31 +487,37 @@ static void skge_get_pauseparam(struct n
 {
 	struct skge_port *skge = netdev_priv(dev);
 
-	ecmd->tx_pause = (skge->flow_control == FLOW_MODE_LOC_SEND)
-		|| (skge->flow_control == FLOW_MODE_SYMMETRIC);
-	ecmd->rx_pause = (skge->flow_control == FLOW_MODE_REM_SEND)
-		|| (skge->flow_control == FLOW_MODE_SYMMETRIC);
+	ecmd->rx_pause = (skge->flow_control == FLOW_MODE_SYMMETRIC)
+		|| (skge->flow_control == FLOW_MODE_SYM_OR_REM);
+	ecmd->tx_pause = ecmd->rx_pause || (skge->flow_control == FLOW_MODE_LOC_SEND);
 
-	ecmd->autoneg = skge->autoneg;
+	ecmd->autoneg = ecmd->rx_pause || ecmd->tx_pause;
 }
 
 static int skge_set_pauseparam(struct net_device *dev,
 			       struct ethtool_pauseparam *ecmd)
 {
 	struct skge_port *skge = netdev_priv(dev);
+	struct ethtool_pauseparam old;
 
-	skge->autoneg = ecmd->autoneg;
-	if (ecmd->rx_pause && ecmd->tx_pause)
-		skge->flow_control = FLOW_MODE_SYMMETRIC;
-	else if (ecmd->rx_pause && !ecmd->tx_pause)
-		skge->flow_control = FLOW_MODE_REM_SEND;
-	else if (!ecmd->rx_pause && ecmd->tx_pause)
-		skge->flow_control = FLOW_MODE_LOC_SEND;
-	else
-		skge->flow_control = FLOW_MODE_NONE;
+	skge_get_pauseparam(dev, &old);
+
+	if (ecmd->autoneg != old.autoneg)
+		skge->flow_control = ecmd->autoneg ? FLOW_MODE_NONE : FLOW_MODE_SYMMETRIC;
+	else {
+		if (ecmd->rx_pause && ecmd->tx_pause)
+			skge->flow_control = FLOW_MODE_SYMMETRIC;
+		else if (ecmd->rx_pause && !ecmd->tx_pause)
+			skge->flow_control = FLOW_MODE_SYM_OR_REM;
+		else if (!ecmd->rx_pause && ecmd->tx_pause)
+			skge->flow_control = FLOW_MODE_LOC_SEND;
+		else
+			skge->flow_control = FLOW_MODE_NONE;
+	}
 
 	if (netif_running(dev))
 		skge_phy_reset(skge);
+
 	return 0;
 }
 
@@ -854,6 +860,23 @@ static int skge_rx_fill(struct net_devic
 	return 0;
 }
 
+static const char *skge_pause(enum pause_status status)
+{
+	switch(status) {
+	case FLOW_STAT_NONE:
+		return "none";
+	case FLOW_STAT_REM_SEND:
+		return "rx only";
+	case FLOW_STAT_LOC_SEND:
+		return "tx_only";
+	case FLOW_STAT_SYMMETRIC:		/* Both station may send PAUSE */
+		return "both";
+	default:
+		return "indeterminated";
+	}
+}
+
+
 static void skge_link_up(struct skge_port *skge)
 {
 	skge_write8(skge->hw, SK_REG(skge->port, LNK_LED_REG),
@@ -862,16 +885,13 @@ static void skge_link_up(struct skge_por
 	netif_carrier_on(skge->netdev);
 	netif_wake_queue(skge->netdev);
 
-	if (netif_msg_link(skge))
+	if (netif_msg_link(skge)) {
 		printk(KERN_INFO PFX
 		       "%s: Link is up at %d Mbps, %s duplex, flow control %s\n",
 		       skge->netdev->name, skge->speed,
 		       skge->duplex == DUPLEX_FULL ? "full" : "half",
-		       (skge->flow_control == FLOW_MODE_NONE) ? "none" :
-		       (skge->flow_control == FLOW_MODE_LOC_SEND) ? "tx only" :
-		       (skge->flow_control == FLOW_MODE_REM_SEND) ? "rx only" :
-		       (skge->flow_control == FLOW_MODE_SYMMETRIC) ? "tx and rx" :
-		       "unknown");
+		       skge_pause(skge->flow_status));
+	}
 }
 
 static void skge_link_down(struct skge_port *skge)
@@ -1015,7 +1035,7 @@ static const u16 phy_pause_map[] = {
 	[FLOW_MODE_NONE] =	0,
 	[FLOW_MODE_LOC_SEND] =	PHY_AN_PAUSE_ASYM,
 	[FLOW_MODE_SYMMETRIC] = PHY_AN_PAUSE_CAP,
-	[FLOW_MODE_REM_SEND]  = PHY_AN_PAUSE_CAP | PHY_AN_PAUSE_ASYM,
+	[FLOW_MODE_SYM_OR_REM]  = PHY_AN_PAUSE_CAP | PHY_AN_PAUSE_ASYM,
 };
 
 /* special defines for FIBER (88E1011S only) */
@@ -1023,7 +1043,7 @@ static const u16 fiber_pause_map[] = {
 	[FLOW_MODE_NONE]	= PHY_X_P_NO_PAUSE,
 	[FLOW_MODE_LOC_SEND]	= PHY_X_P_ASYM_MD,
 	[FLOW_MODE_SYMMETRIC]	= PHY_X_P_SYM_MD,
-	[FLOW_MODE_REM_SEND]	= PHY_X_P_BOTH_MD,
+	[FLOW_MODE_SYM_OR_REM]	= PHY_X_P_BOTH_MD,
 };
 
 
@@ -1072,20 +1092,19 @@ static void bcom_check_link(struct skge_
 			return;
 		}
 
-
 		/* We are using IEEE 802.3z/D5.0 Table 37-4 */
 		switch (aux & PHY_B_AS_PAUSE_MSK) {
 		case PHY_B_AS_PAUSE_MSK:
-			skge->flow_control = FLOW_MODE_SYMMETRIC;
+			skge->flow_status = FLOW_STAT_SYMMETRIC;
 			break;
 		case PHY_B_AS_PRR:
-			skge->flow_control = FLOW_MODE_REM_SEND;
+			skge->flow_status = FLOW_STAT_REM_SEND;
 			break;
 		case PHY_B_AS_PRT:
-			skge->flow_control = FLOW_MODE_LOC_SEND;
+			skge->flow_status = FLOW_STAT_LOC_SEND;
 			break;
 		default:
-			skge->flow_control = FLOW_MODE_NONE;
+			skge->flow_status = FLOW_STAT_NONE;
 		}
 		skge->speed = SPEED_1000;
 	}
@@ -1283,15 +1302,20 @@ static void xm_check_link(struct net_dev
 		}
 
 		/* We are using IEEE 802.3z/D5.0 Table 37-4 */
-		if (lpa & PHY_X_P_SYM_MD)
-			skge->flow_control = FLOW_MODE_SYMMETRIC;
-		else if ((lpa & PHY_X_RS_PAUSE) == PHY_X_P_ASYM_MD)
-			skge->flow_control = FLOW_MODE_REM_SEND;
-		else if ((lpa & PHY_X_RS_PAUSE) == PHY_X_P_BOTH_MD)
-			skge->flow_control = FLOW_MODE_LOC_SEND;
+		if ((skge->flow_control == FLOW_MODE_SYMMETRIC ||
+		     skge->flow_control == FLOW_MODE_SYM_OR_REM) &&
+		    (lpa & PHY_X_P_SYM_MD))
+			skge->flow_status = FLOW_STAT_SYMMETRIC;
+		else if (skge->flow_control == FLOW_MODE_SYM_OR_REM &&
+			 (lpa & PHY_X_RS_PAUSE) == PHY_X_P_ASYM_MD)
+			/* Enable PAUSE receive, disable PAUSE transmit */
+			skge->flow_status  = FLOW_STAT_REM_SEND;
+		else if (skge->flow_control == FLOW_MODE_LOC_SEND &&
+			 (lpa & PHY_X_RS_PAUSE) == PHY_X_P_BOTH_MD)
+			/* Disable PAUSE receive, enable PAUSE transmit */
+			skge->flow_status = FLOW_STAT_LOC_SEND;
 		else
-			skge->flow_control = FLOW_MODE_NONE;
-
+			skge->flow_status = FLOW_STAT_NONE;
 
 		skge->speed = SPEED_1000;
 	}
@@ -1602,8 +1626,8 @@ static void genesis_link_up(struct skge_
 	 * enabling pause frame reception is required for 1000BT
 	 * because the XMAC is not reset if the link is going down
 	 */
-	if (skge->flow_control == FLOW_MODE_NONE ||
-	    skge->flow_control == FLOW_MODE_LOC_SEND)
+	if (skge->flow_status == FLOW_STAT_NONE ||
+	    skge->flow_status == FLOW_STAT_LOC_SEND)
 		/* Disable Pause Frame Reception */
 		cmd |= XM_MMU_IGN_PF;
 	else
@@ -1613,8 +1637,8 @@ static void genesis_link_up(struct skge_
 	xm_write16(hw, port, XM_MMU_CMD, cmd);
 
 	mode = xm_read32(hw, port, XM_MODE);
-	if (skge->flow_control == FLOW_MODE_SYMMETRIC ||
-	    skge->flow_control == FLOW_MODE_LOC_SEND) {
+	if (skge->flow_status== FLOW_STAT_SYMMETRIC ||
+	    skge->flow_status == FLOW_STAT_LOC_SEND) {
 		/*
 		 * Configure Pause Frame Generation
 		 * Use internal and external Pause Frame Generation.
@@ -1938,6 +1962,11 @@ static void yukon_mac_init(struct skge_h
 	case FLOW_MODE_LOC_SEND:
 		/* disable Rx flow-control */
 		reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS;
+		break;
+	case FLOW_MODE_SYMMETRIC:
+	case FLOW_MODE_SYM_OR_REM:
+		/* enable Tx & Rx flow-control */
+		break;
 	}
 
 	gma_write16(hw, port, GM_GP_CTRL, reg);
@@ -2132,13 +2161,11 @@ static void yukon_link_down(struct skge_
 	ctrl &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA);
 	gma_write16(hw, port, GM_GP_CTRL, ctrl);
 
-	if (skge->flow_control == FLOW_MODE_REM_SEND) {
+	if (skge->flow_status == FLOW_STAT_REM_SEND) {
+		ctrl = gm_phy_read(hw, port, PHY_MARV_AUNE_ADV);
+		ctrl |= PHY_M_AN_ASP;
 		/* restore Asymmetric Pause bit */
-		gm_phy_write(hw, port, PHY_MARV_AUNE_ADV,
-				  gm_phy_read(hw, port,
-						   PHY_MARV_AUNE_ADV)
-				  | PHY_M_AN_ASP);
-
+		gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, ctrl);
 	}
 
 	yukon_reset(hw, port);
@@ -2185,19 +2212,19 @@ static void yukon_phy_intr(struct skge_p
 		/* We are using IEEE 802.3z/D5.0 Table 37-4 */
 		switch (phystat & PHY_M_PS_PAUSE_MSK) {
 		case PHY_M_PS_PAUSE_MSK:
-			skge->flow_control = FLOW_MODE_SYMMETRIC;
+			skge->flow_status = FLOW_STAT_SYMMETRIC;
 			break;
 		case PHY_M_PS_RX_P_EN:
-			skge->flow_control = FLOW_MODE_REM_SEND;
+			skge->flow_status = FLOW_STAT_REM_SEND;
 			break;
 		case PHY_M_PS_TX_P_EN:
-			skge->flow_control = FLOW_MODE_LOC_SEND;
+			skge->flow_status = FLOW_STAT_LOC_SEND;
 			break;
 		default:
-			skge->flow_control = FLOW_MODE_NONE;
+			skge->flow_status = FLOW_STAT_NONE;
 		}
 
-		if (skge->flow_control == FLOW_MODE_NONE ||
+		if (skge->flow_status == FLOW_STAT_NONE ||
 		    (skge->speed < SPEED_1000 && skge->duplex == DUPLEX_HALF))
 			skge_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
 		else
@@ -3420,7 +3447,7 @@ static struct net_device *skge_devinit(s
 
 	/* Auto speed and flow control */
 	skge->autoneg = AUTONEG_ENABLE;
-	skge->flow_control = FLOW_MODE_SYMMETRIC;
+	skge->flow_control = FLOW_MODE_SYM_OR_REM;
 	skge->duplex = -1;
 	skge->speed = -1;
 	skge->advertising = skge_supported_modes(hw);
--- linux-2.6.orig/drivers/net/skge.h
+++ linux-2.6/drivers/net/skge.h
@@ -2427,13 +2427,24 @@ struct skge_hw {
 	struct mutex	     phy_mutex;
 };
 
-enum {
-	FLOW_MODE_NONE 		= 0, /* No Flow-Control */
-	FLOW_MODE_LOC_SEND	= 1, /* Local station sends PAUSE */
-	FLOW_MODE_REM_SEND	= 2, /* Symmetric or just remote */
+enum pause_control {
+	FLOW_MODE_NONE 		= 1, /* No Flow-Control */
+	FLOW_MODE_LOC_SEND	= 2, /* Local station sends PAUSE */
 	FLOW_MODE_SYMMETRIC	= 3, /* Both stations may send PAUSE */
+	FLOW_MODE_SYM_OR_REM	= 4, /* Both stations may send PAUSE or
+				      * just the remote station may send PAUSE
+				      */
 };
 
+enum pause_status {
+	FLOW_STAT_INDETERMINATED=0,	/* indeterminated */
+	FLOW_STAT_NONE,			/* No Flow Control */
+	FLOW_STAT_REM_SEND,		/* Remote Station sends PAUSE */
+	FLOW_STAT_LOC_SEND,		/* Local station sends PAUSE */
+	FLOW_STAT_SYMMETRIC,		/* Both station may send PAUSE */
+};
+
+
 struct skge_port {
 	u32		     msg_enable;
 	struct skge_hw	     *hw;
@@ -2446,9 +2457,10 @@ struct skge_port {
 	struct net_device_stats net_stats;
 
 	struct work_struct   link_thread;
+	enum pause_control   flow_control;
+	enum pause_status    flow_status;
 	u8		     rx_csum;
 	u8		     blink_on;
-	u8		     flow_control;
 	u8		     wol;
 	u8		     autoneg;	/* AUTONEG_ENABLE, AUTONEG_DISABLE */
 	u8		     duplex;	/* DUPLEX_HALF, DUPLEX_FULL */

--
Stephen Hemminger <shemminger@osdl.org>


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

* [PATCH 4/4] skge: version 1.9
  2006-10-05 22:49 [PATCH 0/4] skge: fiber related fixes Stephen Hemminger
                   ` (2 preceding siblings ...)
  2006-10-05 22:49 ` [PATCH 3/4] skge: better flow control negotiation Stephen Hemminger
@ 2006-10-05 22:49 ` Stephen Hemminger
  2006-11-07 13:25   ` Michael Stone
  3 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2006-10-05 22:49 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: skge-v1.9.patch --]
[-- Type: text/plain, Size: 425 bytes --]

Want to be able to track downstream impact of fiber related
fixes.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

--- linux-2.6.orig/drivers/net/skge.c
+++ linux-2.6/drivers/net/skge.c
@@ -43,7 +43,7 @@
 #include "skge.h"
 
 #define DRV_NAME		"skge"
-#define DRV_VERSION		"1.8"
+#define DRV_VERSION		"1.9"
 #define PFX			DRV_NAME " "
 
 #define DEFAULT_TX_RING_SIZE	128

--
Stephen Hemminger <shemminger@osdl.org>


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

* Re: [PATCH 4/4] skge: version 1.9
  2006-10-05 22:49 ` [PATCH 4/4] skge: version 1.9 Stephen Hemminger
@ 2006-11-07 13:25   ` Michael Stone
  2006-11-07 17:51     ` Stephen Hemminger
  2006-11-07 20:28     ` Jay Vosburgh
  0 siblings, 2 replies; 13+ messages in thread
From: Michael Stone @ 2006-11-07 13:25 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

The skge 1.9 patch is looking good on older syskonnect fiber cards.  
Stability issues seem to be taken care of and performance is good. There 
are some strange interactions with bonding, however. If I try to put 
both interfaces of an sk-9844 into a bonded interface, I only see 
traffic from one of them. If I try to config the bonded interface down, 
the system hangs. If I tcpdump either of the individual interfaces 
(before bonding them) I see all the expected traffic.

Mike Stone

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

* Re: [PATCH 4/4] skge: version 1.9
  2006-11-07 13:25   ` Michael Stone
@ 2006-11-07 17:51     ` Stephen Hemminger
  2006-11-07 18:58       ` Michael Stone
  2006-11-07 20:28     ` Jay Vosburgh
  1 sibling, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2006-11-07 17:51 UTC (permalink / raw)
  To: Michael Stone; +Cc: netdev

On Tue, 07 Nov 2006 08:25:07 -0500
Michael Stone <mstone@mathom.us> wrote:

> The skge 1.9 patch is looking good on older syskonnect fiber cards.  
> Stability issues seem to be taken care of and performance is good. There 
> are some strange interactions with bonding, however. If I try to put 
> both interfaces of an sk-9844 into a bonded interface, I only see 
> traffic from one of them. If I try to config the bonded interface down, 
> the system hangs. If I tcpdump either of the individual interfaces 
> (before bonding them) I see all the expected traffic.
> 
> Mike Stone

Which form of bonding link checking are you using. It could be that
bonding MII checking is confused.

-- 
Stephen Hemminger <shemminger@osdl.org>

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

* Re: [PATCH 4/4] skge: version 1.9
  2006-11-07 17:51     ` Stephen Hemminger
@ 2006-11-07 18:58       ` Michael Stone
  2006-11-07 19:18         ` Stephen Hemminger
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Stone @ 2006-11-07 18:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Tue, Nov 07, 2006 at 09:51:04AM -0800, Stephen Hemminger wrote:
>Which form of bonding link checking are you using. It could be that
>bonding MII checking is confused.

I'm not specifying anything, just "ifenslave bond0 eth2 eth3"

Mike Stone

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

* Re: [PATCH 4/4] skge: version 1.9
  2006-11-07 18:58       ` Michael Stone
@ 2006-11-07 19:18         ` Stephen Hemminger
  2006-11-07 19:33           ` Michael Stone
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2006-11-07 19:18 UTC (permalink / raw)
  To: Michael Stone; +Cc: netdev

On Tue, 07 Nov 2006 13:58:31 -0500
Michael Stone <mstone@mathom.us> wrote:

> On Tue, Nov 07, 2006 at 09:51:04AM -0800, Stephen Hemminger wrote:
> >Which form of bonding link checking are you using. It could be that
> >bonding MII checking is confused.
> 
> I'm not specifying anything, just "ifenslave bond0 eth2 eth3"
> 
> Mike Stone

Do both ports report carrier present?
	ethtool eth2
	ethtool eth3



-- 
Stephen Hemminger <shemminger@osdl.org>

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

* Re: [PATCH 4/4] skge: version 1.9
  2006-11-07 19:18         ` Stephen Hemminger
@ 2006-11-07 19:33           ` Michael Stone
  0 siblings, 0 replies; 13+ messages in thread
From: Michael Stone @ 2006-11-07 19:33 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Tue, Nov 07, 2006 at 11:18:07AM -0800, Stephen Hemminger wrote:
>Do both ports report carrier present?
>	ethtool eth2
>	ethtool eth3

Link detected? yes

Mike Stone

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

* Re: [PATCH 4/4] skge: version 1.9
  2006-11-07 13:25   ` Michael Stone
  2006-11-07 17:51     ` Stephen Hemminger
@ 2006-11-07 20:28     ` Jay Vosburgh
  2006-11-10  0:34       ` Michael Stone
  1 sibling, 1 reply; 13+ messages in thread
From: Jay Vosburgh @ 2006-11-07 20:28 UTC (permalink / raw)
  To: Michael Stone; +Cc: Stephen Hemminger, netdev

Michael Stone <mstone@mathom.us> wrote:

>The skge 1.9 patch is looking good on older syskonnect fiber cards.
>Stability issues seem to be taken care of and performance is good. There
>are some strange interactions with bonding, however. If I try to put both
>interfaces of an sk-9844 into a bonded interface, I only see traffic from
>one of them. If I try to config the bonded interface down, the system
>hangs. If I tcpdump either of the individual interfaces (before bonding
>them) I see all the expected traffic.

	Can you provide some bonding configuration details?  Which mode,
options, etc, as well as the relevant bits from dmesg (you can send it
to me privately if it's huge)?  I don't have any skge hardware, so I'm
not able to test this locally.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

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

* Re: [PATCH 4/4] skge: version 1.9
  2006-11-07 20:28     ` Jay Vosburgh
@ 2006-11-10  0:34       ` Michael Stone
  2006-11-10  0:47         ` Jay Vosburgh
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Stone @ 2006-11-10  0:34 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: netdev

On Tue, Nov 07, 2006 at 12:28:26PM -0800, Jay Vosburgh wrote:
>	Can you provide some bonding configuration details?  Which mode,
>options, etc, as well as the relevant bits from dmesg (you can send it
>to me privately if it's huge)?  

I think I sent another message that I'm just doing 
ifenslave bond0 eth2
ifenslave bond0 eth3
with no particular options set. The application is a network sniffer, 
and the cards are forced to 1000Mbps/full duplex because the other end 
doesn't negotiate. What's the relevant part of dmesg?

Mike Stone

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

* Re: [PATCH 4/4] skge: version 1.9
  2006-11-10  0:34       ` Michael Stone
@ 2006-11-10  0:47         ` Jay Vosburgh
  0 siblings, 0 replies; 13+ messages in thread
From: Jay Vosburgh @ 2006-11-10  0:47 UTC (permalink / raw)
  To: Michael Stone; +Cc: netdev

Michael Stone <mstone@mathom.us> wrote:

>On Tue, Nov 07, 2006 at 12:28:26PM -0800, Jay Vosburgh wrote:
>>	Can you provide some bonding configuration details?  Which mode,
>>options, etc, as well as the relevant bits from dmesg (you can send it
>> to me privately if it's huge)?
>
>I think I sent another message that I'm just doing ifenslave bond0 eth2
>ifenslave bond0 eth3 with no particular options set.

	I was thinking of the options to the bonding driver (probably in
the network configuration or /etc/modprobe.conf); a reasonable set of
information is in /proc/net/bonding/bond0, so that's a good place to
start, along with whatever "uname -a" prints (kernel version,
architecture, mostly).

[...] The application is a network sniffer, and
>the cards are forced to 1000Mbps/full duplex because the other end doesn't
>negotiate. What's the relevant part of dmesg?

	Well, pretty much anything from the bonding driver or the
ethernet driver.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

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

end of thread, other threads:[~2006-11-10  0:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-05 22:49 [PATCH 0/4] skge: fiber related fixes Stephen Hemminger
2006-10-05 22:49 ` [PATCH 1/4] skge: fix stuck irq when fiber down Stephen Hemminger
2006-10-05 22:49 ` [PATCH 2/4] skge: pause mapping for fiber Stephen Hemminger
2006-10-05 22:49 ` [PATCH 3/4] skge: better flow control negotiation Stephen Hemminger
2006-10-05 22:49 ` [PATCH 4/4] skge: version 1.9 Stephen Hemminger
2006-11-07 13:25   ` Michael Stone
2006-11-07 17:51     ` Stephen Hemminger
2006-11-07 18:58       ` Michael Stone
2006-11-07 19:18         ` Stephen Hemminger
2006-11-07 19:33           ` Michael Stone
2006-11-07 20:28     ` Jay Vosburgh
2006-11-10  0:34       ` Michael Stone
2006-11-10  0:47         ` Jay Vosburgh

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).