summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi-Zhen You <Li-Zhen.You@Sun.COM>2009-12-31 10:19:44 +0800
committerLi-Zhen You <Li-Zhen.You@Sun.COM>2009-12-31 10:19:44 +0800
commit9e1a9180bec2232328687ae8e96007921a6ed05d (patch)
tree2ac20e969e88244d3bc026c1681349f4cfd68e03
parent774da1090d9df03b9b531b40a433b8f652f44fcd (diff)
downloadillumos-joyent-9e1a9180bec2232328687ae8e96007921a6ed05d.tar.gz
6840151 network dies when copying to raidz utilizing realtek gbit nics
6890566 rge should not call mi_strtol 6906422 rge doesn't restart nic on SYS_ERR interrupt
-rw-r--r--usr/src/uts/common/io/rge/rge.h1
-rw-r--r--usr/src/uts/common/io/rge/rge_chip.c14
-rw-r--r--usr/src/uts/common/io/rge/rge_hw.h2
-rw-r--r--usr/src/uts/common/io/rge/rge_ndd.c7
-rw-r--r--usr/src/uts/common/io/rge/rge_rxtx.c7
5 files changed, 21 insertions, 10 deletions
diff --git a/usr/src/uts/common/io/rge/rge.h b/usr/src/uts/common/io/rge/rge.h
index d6236ab5d7..7765276082 100644
--- a/usr/src/uts/common/io/rge/rge.h
+++ b/usr/src/uts/common/io/rge/rge.h
@@ -761,6 +761,7 @@ void rge_nd_cleanup(rge_t *rgep);
/* rge_rxtx.c */
void rge_rx_recycle(caddr_t arg);
void rge_receive(rge_t *rgep);
+void rge_send_recycle(rge_t *rgep);
mblk_t *rge_m_tx(void *arg, mblk_t *mp);
uint_t rge_reschedule(caddr_t arg1, caddr_t arg2);
diff --git a/usr/src/uts/common/io/rge/rge_chip.c b/usr/src/uts/common/io/rge/rge_chip.c
index 1bf894e3e2..4f8dba24b8 100644
--- a/usr/src/uts/common/io/rge/rge_chip.c
+++ b/usr/src/uts/common/io/rge/rge_chip.c
@@ -42,7 +42,7 @@ static uint32_t rge_autorecover = 1;
* globals:
*/
#define RGE_DBG RGE_DBG_REGS /* debug flag for this code */
-static uint32_t rge_watchdog_count = 1 << 16;
+static uint32_t rge_watchdog_count = 1 << 5;
/*
* Operating register get/set access routines
@@ -1486,6 +1486,16 @@ rge_intr(caddr_t arg1, caddr_t arg2)
}
/*
+ * System error interrupt
+ */
+ if (int_status & SYS_ERR_INT) {
+ RGE_REPORT((rgep, "sys error happened, resetting the chip "));
+ mutex_enter(rgep->genlock);
+ rgep->rge_chip_state = RGE_CHIP_ERROR;
+ mutex_exit(rgep->genlock);
+ }
+
+ /*
* Re-enable interrupt for PCIE chipset or install new int_mask
*/
if (update_int_mask)
@@ -1670,6 +1680,8 @@ rge_chip_cyclic(void *arg)
case RGE_CHIP_RUNNING:
rge_phy_check(rgep);
+ if (rgep->tx_free < RGE_SEND_SLOTS)
+ rge_send_recycle(rgep);
break;
case RGE_CHIP_FAULT:
diff --git a/usr/src/uts/common/io/rge/rge_hw.h b/usr/src/uts/common/io/rge/rge_hw.h
index eee4d26337..237706578c 100644
--- a/usr/src/uts/common/io/rge/rge_hw.h
+++ b/usr/src/uts/common/io/rge/rge_hw.h
@@ -138,7 +138,7 @@ extern "C" {
NO_RXDESC_INT)
#define RGE_INT_MASK (TX_OK_INT | TX_ERR_INT | \
RGE_RX_INT | LINK_CHANGE_INT | \
- TIME_OUT_INT)
+ TIME_OUT_INT | SYS_ERR_INT)
/*
* Transmit configuration register
diff --git a/usr/src/uts/common/io/rge/rge_ndd.c b/usr/src/uts/common/io/rge/rge_ndd.c
index 35f14e8b94..acdcebb700 100644
--- a/usr/src/uts/common/io/rge/rge_ndd.c
+++ b/usr/src/uts/common/io/rge/rge_ndd.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -166,14 +166,11 @@ rge_param_set(queue_t *q, mblk_t *mp, char *value, caddr_t cp, cred_t *credp)
{
nd_param_t *ndp;
long new_value;
- char *end;
_NOTE(ARGUNUSED(q, mp, credp))
ndp = (nd_param_t *)cp;
- new_value = mi_strtol(value, &end, 10);
- if (end == value)
- return (EINVAL);
+ (void) ddi_strtol(value, (char **)NULL, 0, &new_value);
if (new_value < ndp->ndp_min || new_value > ndp->ndp_max)
return (EINVAL);
diff --git a/usr/src/uts/common/io/rge/rge_rxtx.c b/usr/src/uts/common/io/rge/rge_rxtx.c
index 916b2e8aef..4cf866473a 100644
--- a/usr/src/uts/common/io/rge/rge_rxtx.c
+++ b/usr/src/uts/common/io/rge/rge_rxtx.c
@@ -413,10 +413,10 @@ rge_send_claim(rge_t *rgep)
* h/w transmit done in ISR. Instead, we call this function in the
* rge_send() when there're few or no free tx BDs remained.
*/
-static void rge_send_recycle(rge_t *rgep);
+void rge_send_recycle(rge_t *rgep);
#pragma inline(rge_send_recycle)
-static void
+void
rge_send_recycle(rge_t *rgep)
{
rge_bd_t *hw_sbd_p;
@@ -441,7 +441,8 @@ rge_send_recycle(rge_t *rgep)
* thus guaranteeing that it's nonzero
* (watchdog activated).
*/
- rgep->watchdog += 1;
+ if (rgep->watchdog == 0)
+ rgep->watchdog = 1;
mutex_exit(rgep->tc_lock);
return;
}