summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-09-09 01:36:02 +0000
committerkmacy <kmacy@FreeBSD.org>2008-09-09 01:36:02 +0000
commit1af31f868a04970e4e460e2e08c563289e42b042 (patch)
tree99597182bb22e5d2a4007be9abfd61ddb09354be
parent3ce5090dce9c7267bfbf724bb1b5128fa94fe71d (diff)
downloadFreeBSD-src-1af31f868a04970e4e460e2e08c563289e42b042.zip
FreeBSD-src-1af31f868a04970e4e460e2e08c563289e42b042.tar.gz
Fix issue with recovering from transient jumbo mbuf shortage.
Submitted by: Chelsio Inc. MFC after: 3 days
-rw-r--r--sys/dev/cxgb/cxgb_adapter.h5
-rw-r--r--sys/dev/cxgb/cxgb_main.c17
-rw-r--r--sys/dev/cxgb/cxgb_sge.c13
3 files changed, 7 insertions, 28 deletions
diff --git a/sys/dev/cxgb/cxgb_adapter.h b/sys/dev/cxgb/cxgb_adapter.h
index 49c9e1c..e49a844 100644
--- a/sys/dev/cxgb/cxgb_adapter.h
+++ b/sys/dev/cxgb/cxgb_adapter.h
@@ -127,16 +127,12 @@ struct port_info {
uint32_t nqsets;
uint8_t hw_addr[ETHER_ADDR_LEN];
- struct taskqueue *tq;
- struct task start_task;
struct task timer_reclaim_task;
struct cdev *port_cdev;
#define PORT_LOCK_NAME_LEN 32
-#define TASKQ_NAME_LEN 32
#define PORT_NAME_LEN 32
char lockbuf[PORT_LOCK_NAME_LEN];
- char taskqbuf[TASKQ_NAME_LEN];
char namebuf[PORT_NAME_LEN];
};
@@ -375,7 +371,6 @@ struct adapter {
struct task ext_intr_task;
struct task slow_intr_task;
struct task tick_task;
- struct task process_responses_task;
struct taskqueue *tq;
struct callout cxgb_tick_ch;
struct callout sge_timer_ch;
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index ad2467b..573c4c4 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -1016,17 +1016,6 @@ cxgb_port_attach(device_t dev)
ifmedia_set(&p->media, IFM_ETHER | IFM_AUTO);
}
-
- snprintf(p->taskqbuf, TASKQ_NAME_LEN, "cxgb_port_taskq%d", p->port_id);
-#ifdef TASKQUEUE_CURRENT
- /* Create a port for handling TX without starvation */
- p->tq = taskqueue_create(p->taskqbuf, M_NOWAIT,
- taskqueue_thread_enqueue, &p->tq);
-#else
- /* Create a port for handling TX without starvation */
- p->tq = taskqueue_create_fast(p->taskqbuf, M_NOWAIT,
- taskqueue_thread_enqueue, &p->tq);
-#endif
/* Get the latest mac address, User can use a LAA */
bcopy(IF_LLADDR(p->ifp), p->hw_addr, ETHER_ADDR_LEN);
t3_sge_init_port(p);
@@ -1049,12 +1038,6 @@ cxgb_port_detach(device_t dev)
cxgb_stop_locked(p);
PORT_UNLOCK(p);
- if (p->tq != NULL) {
- taskqueue_drain(p->tq, &p->start_task);
- taskqueue_free(p->tq);
- p->tq = NULL;
- }
-
ether_ifdetach(p->ifp);
printf("waiting for callout to stop ...");
DELAY(1000000);
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c
index 3ff3977..05b96fe 100644
--- a/sys/dev/cxgb/cxgb_sge.c
+++ b/sys/dev/cxgb/cxgb_sge.c
@@ -764,19 +764,20 @@ sge_timer_cb(void *arg)
int i, j;
int reclaim_ofl, refill_rx;
- for (i = 0; i < sc->params.nports; i++)
- for (j = 0; j < sc->port[i].nqsets; j++) {
- qs = &sc->sge.qs[i + j];
+ for (i = 0; i < sc->params.nports; i++) {
+ pi = &sc->port[i];
+ for (j = 0; j < pi->nqsets; j++) {
+ qs = &sc->sge.qs[pi->first_qset + j];
txq = &qs->txq[0];
reclaim_ofl = txq[TXQ_OFLD].processed - txq[TXQ_OFLD].cleaned;
refill_rx = ((qs->fl[0].credits < qs->fl[0].size) ||
(qs->fl[1].credits < qs->fl[1].size));
if (reclaim_ofl || refill_rx) {
- pi = &sc->port[i];
- taskqueue_enqueue(pi->tq, &pi->timer_reclaim_task);
+ taskqueue_enqueue(sc->tq, &pi->timer_reclaim_task);
break;
}
}
+ }
#endif
if (sc->params.nports > 2) {
int i;
@@ -885,7 +886,7 @@ sge_timer_reclaim(void *arg, int ncount)
panic("%s should not be called with multiqueue support\n", __FUNCTION__);
#endif
for (i = 0; i < nqsets; i++) {
- qs = &sc->sge.qs[i];
+ qs = &sc->sge.qs[pi->first_qset + i];
txq = &qs->txq[TXQ_OFLD];
sge_txq_reclaim_(txq, FALSE);
OpenPOWER on IntegriCloud