mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 19:08:58 +00:00
Fix issue with recovering from transient jumbo mbuf shortage.
Submitted by: Chelsio Inc. MFC after: 3 days
This commit is contained in:
parent
618f3d8c0a
commit
d5e2c3dd04
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=182882
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user