Don't call init functions directly from the timer/watchdog function.

Enqueue this in the admin task now that it can process it.

Submitted by:	Matt Macy <mmacy@nextbsd.org>
Sponsored by:	Limelight Networks
This commit is contained in:
sbruno 2017-03-30 16:54:01 +00:00
parent db87858638
commit 15395e4837

View File

@ -1441,15 +1441,17 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid,
driver_filter_t filter, driver_intr_t handler, void *arg,
char *name)
{
int rc;
int rc, flags;
struct resource *res;
void *tag;
void *tag = NULL;
device_t dev = ctx->ifc_dev;
flags = RF_ACTIVE;
if (ctx->ifc_flags & IFC_LEGACY)
flags |= RF_SHAREABLE;
MPASS(rid < 512);
irq->ii_rid = rid;
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq->ii_rid,
RF_SHAREABLE | RF_ACTIVE);
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq->ii_rid, flags);
if (res == NULL) {
device_printf(dev,
"failed to allocate IRQ for rid %d, name %s.\n", rid, name);
@ -2122,7 +2124,8 @@ hung:
ctx->ifc_watchdog_events++;
ctx->ifc_pause_frames = 0;
iflib_init_locked(ctx);
ctx->ifc_flags |= IFC_DO_RESET;
iflib_admin_intr_deferred(ctx);
CTX_UNLOCK(ctx);
}
@ -2600,7 +2603,7 @@ txq_max_rs_deferred(iflib_txq_t txq)
return (notify_count >> 1);
if (txq->ift_in_use > minthresh)
return (notify_count >> 2);
return (notify_count >> 4);
return (2);
}
#define M_CSUM_FLAGS(m) ((m)->m_pkthdr.csum_flags)