Fix "taskqgroup_attach: setaffinity failed: 3" with iflib drivers
Improved logging added in r323879 exposed an error during attach. We need the irq, not the rid to work correctly. em uses shared irqs, so it will use the same irq for TX as RX. bnxt does not use shared irqs, or TX irqs at all, so there's no need to set the TX irq affinity. Reviewed by: sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12496
This commit is contained in:
parent
ca2b4c393c
commit
bb993c697a
@ -1649,8 +1649,7 @@ bnxt_msix_intr_assign(if_ctx_t ctx, int msix)
|
||||
}
|
||||
|
||||
for (i=0; i<softc->scctx->isc_ntxqsets; i++)
|
||||
iflib_softirq_alloc_generic(ctx, i + 1, IFLIB_INTR_TX, NULL, i,
|
||||
"tx_cp");
|
||||
iflib_softirq_alloc_generic(ctx, NULL, IFLIB_INTR_TX, NULL, i, "tx_cp");
|
||||
|
||||
return rc;
|
||||
|
||||
|
@ -1954,7 +1954,9 @@ em_if_msix_intr_assign(if_ctx_t ctx, int msix)
|
||||
rid = vector + 1;
|
||||
snprintf(buf, sizeof(buf), "txq%d", i);
|
||||
tx_que = &adapter->tx_queues[i];
|
||||
iflib_softirq_alloc_generic(ctx, rid, IFLIB_INTR_TX, tx_que, tx_que->me, buf);
|
||||
iflib_softirq_alloc_generic(ctx,
|
||||
&adapter->rx_queues[i % adapter->rx_num_queues].que_irq,
|
||||
IFLIB_INTR_TX, tx_que, tx_que->me, buf);
|
||||
|
||||
tx_que->msix = (vector % adapter->tx_num_queues);
|
||||
|
||||
|
@ -681,7 +681,7 @@ taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *gtask,
|
||||
mtx_unlock(&qgroup->tqg_lock);
|
||||
error = intr_setaffinity(irq, CPU_WHICH_IRQ, &mask);
|
||||
if (error)
|
||||
printf("%s: setaffinity failed: %d\n", __func__, error);
|
||||
printf("%s: setaffinity failed for %s: %d\n", __func__, gtask->gt_name, error);
|
||||
} else
|
||||
mtx_unlock(&qgroup->tqg_lock);
|
||||
}
|
||||
|
@ -5003,21 +5003,22 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid,
|
||||
|
||||
if (tqrid != -1) {
|
||||
cpuid = find_nth(ctx, &cpus, qid);
|
||||
taskqgroup_attach_cpu(tqg, gtask, q, cpuid, irq->ii_rid, name);
|
||||
taskqgroup_attach_cpu(tqg, gtask, q, cpuid, rman_get_start(irq->ii_res), name);
|
||||
} else {
|
||||
taskqgroup_attach(tqg, gtask, q, tqrid, name);
|
||||
taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
iflib_softirq_alloc_generic(if_ctx_t ctx, int rid, iflib_intr_type_t type, void *arg, int qid, char *name)
|
||||
iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, char *name)
|
||||
{
|
||||
struct grouptask *gtask;
|
||||
struct taskqgroup *tqg;
|
||||
gtask_fn_t *fn;
|
||||
void *q;
|
||||
int irq_num = -1;
|
||||
|
||||
switch (type) {
|
||||
case IFLIB_INTR_TX:
|
||||
@ -5025,25 +5026,28 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, int rid, iflib_intr_type_t type, void
|
||||
gtask = &ctx->ifc_txqs[qid].ift_task;
|
||||
tqg = qgroup_if_io_tqg;
|
||||
fn = _task_fn_tx;
|
||||
if (irq != NULL)
|
||||
irq_num = rman_get_start(irq->ii_res);
|
||||
break;
|
||||
case IFLIB_INTR_RX:
|
||||
q = &ctx->ifc_rxqs[qid];
|
||||
gtask = &ctx->ifc_rxqs[qid].ifr_task;
|
||||
tqg = qgroup_if_io_tqg;
|
||||
fn = _task_fn_rx;
|
||||
if (irq != NULL)
|
||||
irq_num = rman_get_start(irq->ii_res);
|
||||
break;
|
||||
case IFLIB_INTR_IOV:
|
||||
q = ctx;
|
||||
gtask = &ctx->ifc_vflr_task;
|
||||
tqg = qgroup_if_config_tqg;
|
||||
rid = -1;
|
||||
fn = _task_fn_iov;
|
||||
break;
|
||||
default:
|
||||
panic("unknown net intr type");
|
||||
}
|
||||
GROUPTASK_INIT(gtask, 0, fn, q);
|
||||
taskqgroup_attach(tqg, gtask, q, rid, name);
|
||||
taskqgroup_attach(tqg, gtask, q, irq_num, name);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -361,7 +361,7 @@ int iflib_irq_alloc(if_ctx_t, if_irq_t, int, driver_filter_t, void *filter_arg,
|
||||
int iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid,
|
||||
iflib_intr_type_t type, driver_filter_t *filter,
|
||||
void *filter_arg, int qid, char *name);
|
||||
void iflib_softirq_alloc_generic(if_ctx_t ctx, int rid, iflib_intr_type_t type, void *arg, int qid, char *name);
|
||||
void iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, void *arg, int qid, char *name);
|
||||
|
||||
void iflib_irq_free(if_ctx_t ctx, if_irq_t irq);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user