Lines Matching refs:iaq
1194 struct intrs_and_queues iaq; in t4_attach() local
1456 rc = cfg_itype_and_nqueues(sc, &iaq); in t4_attach()
1460 num_vis = iaq.num_vis; in t4_attach()
1461 sc->intr_type = iaq.intr_type; in t4_attach()
1462 sc->intr_count = iaq.nirq; in t4_attach()
1465 s->nrxq = nports * iaq.nrxq; in t4_attach()
1466 s->ntxq = nports * iaq.ntxq; in t4_attach()
1468 s->nrxq += nports * (num_vis - 1) * iaq.nrxq_vi; in t4_attach()
1469 s->ntxq += nports * (num_vis - 1) * iaq.ntxq_vi; in t4_attach()
1476 s->nofldtxq = nports * iaq.nofldtxq; in t4_attach()
1478 s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; in t4_attach()
1487 s->nofldrxq = nports * iaq.nofldrxq; in t4_attach()
1489 s->nofldrxq += nports * (num_vis - 1) * iaq.nofldrxq_vi; in t4_attach()
1501 s->nnmrxq += nports * iaq.nnmrxq; in t4_attach()
1502 s->nnmtxq += nports * iaq.nnmtxq; in t4_attach()
1505 s->nnmrxq += nports * (num_vis - 1) * iaq.nnmrxq_vi; in t4_attach()
1506 s->nnmtxq += nports * (num_vis - 1) * iaq.nnmtxq_vi; in t4_attach()
1580 vi->nrxq = j == 0 ? iaq.nrxq : iaq.nrxq_vi; in t4_attach()
1581 vi->ntxq = j == 0 ? iaq.ntxq : iaq.ntxq_vi; in t4_attach()
1593 vi->nofldtxq = j == 0 ? iaq.nofldtxq : iaq.nofldtxq_vi; in t4_attach()
1600 vi->nofldrxq = j == 0 ? iaq.nofldrxq : iaq.nofldrxq_vi; in t4_attach()
1608 vi->nnmrxq = iaq.nnmrxq; in t4_attach()
1609 vi->nnmtxq = iaq.nnmtxq; in t4_attach()
1611 vi->nnmrxq = iaq.nnmrxq_vi; in t4_attach()
1612 vi->nnmtxq = iaq.nnmtxq_vi; in t4_attach()
4322 update_nirq(struct intrs_and_queues *iaq, int nports) in update_nirq() argument
4325 iaq->nirq = T4_EXTRA_INTR; in update_nirq()
4326 iaq->nirq += nports * max(iaq->nrxq, iaq->nnmrxq); in update_nirq()
4327 iaq->nirq += nports * iaq->nofldrxq; in update_nirq()
4328 iaq->nirq += nports * (iaq->num_vis - 1) * in update_nirq()
4329 max(iaq->nrxq_vi, iaq->nnmrxq_vi); in update_nirq()
4330 iaq->nirq += nports * (iaq->num_vis - 1) * iaq->nofldrxq_vi; in update_nirq()
4337 calculate_iaq(struct adapter *sc, struct intrs_and_queues *iaq, int itype, in calculate_iaq() argument
4346 bzero(iaq, sizeof(*iaq)); in calculate_iaq()
4347 iaq->intr_type = itype; in calculate_iaq()
4348 iaq->num_vis = t4_num_vis; in calculate_iaq()
4349 iaq->ntxq = t4_ntxq; in calculate_iaq()
4350 iaq->ntxq_vi = t4_ntxq_vi; in calculate_iaq()
4351 iaq->nrxq = t4_nrxq; in calculate_iaq()
4352 iaq->nrxq_vi = t4_nrxq_vi; in calculate_iaq()
4355 iaq->nofldtxq = t4_nofldtxq; in calculate_iaq()
4356 iaq->nofldtxq_vi = t4_nofldtxq_vi; in calculate_iaq()
4361 iaq->nofldrxq = t4_nofldrxq; in calculate_iaq()
4362 iaq->nofldrxq_vi = t4_nofldrxq_vi; in calculate_iaq()
4367 iaq->nnmtxq = t4_nnmtxq; in calculate_iaq()
4368 iaq->nnmrxq = t4_nnmrxq; in calculate_iaq()
4371 iaq->nnmtxq_vi = t4_nnmtxq_vi; in calculate_iaq()
4372 iaq->nnmrxq_vi = t4_nnmrxq_vi; in calculate_iaq()
4376 update_nirq(iaq, nports); in calculate_iaq()
4377 if (iaq->nirq <= navail && in calculate_iaq()
4378 (itype != INTR_MSI || powerof2(iaq->nirq))) { in calculate_iaq()
4390 while (iaq->num_vis > 1) { in calculate_iaq()
4391 iaq->num_vis--; in calculate_iaq()
4392 update_nirq(iaq, nports); in calculate_iaq()
4393 if (iaq->nirq <= navail && in calculate_iaq()
4394 (itype != INTR_MSI || powerof2(iaq->nirq))) { in calculate_iaq()
4399 iaq->num_vis, t4_num_vis, iaq->nrxq, iaq->nofldrxq, in calculate_iaq()
4400 iaq->nrxq_vi, iaq->nofldrxq_vi, iaq->nnmrxq_vi, in calculate_iaq()
4401 itype, navail, iaq->nirq); in calculate_iaq()
4409 MPASS(iaq->num_vis == 1); in calculate_iaq()
4410 iaq->ntxq_vi = iaq->nrxq_vi = 0; in calculate_iaq()
4411 iaq->nofldtxq_vi = iaq->nofldrxq_vi = 0; in calculate_iaq()
4412 iaq->nnmtxq_vi = iaq->nnmrxq_vi = 0; in calculate_iaq()
4413 if (iaq->num_vis != t4_num_vis) { in calculate_iaq()
4417 iaq->nrxq, iaq->nofldrxq, iaq->nrxq_vi, iaq->nofldrxq_vi, in calculate_iaq()
4418 iaq->nnmrxq_vi, itype, navail, iaq->nirq); in calculate_iaq()
4427 if (iaq->nrxq > 1) { in calculate_iaq()
4428 iaq->nrxq = rounddown_pow_of_two(iaq->nrxq - 1); in calculate_iaq()
4429 if (iaq->nnmrxq > iaq->nrxq) in calculate_iaq()
4430 iaq->nnmrxq = iaq->nrxq; in calculate_iaq()
4432 if (iaq->nofldrxq > 1) in calculate_iaq()
4433 iaq->nofldrxq >>= 1; in calculate_iaq()
4435 old_nirq = iaq->nirq; in calculate_iaq()
4436 update_nirq(iaq, nports); in calculate_iaq()
4437 if (iaq->nirq <= navail && in calculate_iaq()
4438 (itype != INTR_MSI || powerof2(iaq->nirq))) { in calculate_iaq()
4442 "itype %d, navail %u, nirq %d.\n", iaq->nrxq, in calculate_iaq()
4443 iaq->nofldrxq, itype, navail, iaq->nirq); in calculate_iaq()
4446 } while (old_nirq != iaq->nirq); in calculate_iaq()
4451 iaq->nirq = 1; in calculate_iaq()
4452 iaq->nrxq = 1; in calculate_iaq()
4453 iaq->ntxq = 1; in calculate_iaq()
4454 if (iaq->nofldrxq > 0) { in calculate_iaq()
4455 iaq->nofldrxq = 1; in calculate_iaq()
4456 iaq->nofldtxq = 1; in calculate_iaq()
4458 iaq->nnmtxq = 0; in calculate_iaq()
4459 iaq->nnmrxq = 0; in calculate_iaq()
4461 MPASS(iaq->num_vis > 0); in calculate_iaq()
4462 if (iaq->num_vis > 1) { in calculate_iaq()
4463 MPASS(iaq->nrxq_vi > 0); in calculate_iaq()
4464 MPASS(iaq->ntxq_vi > 0); in calculate_iaq()
4466 MPASS(iaq->nirq > 0); in calculate_iaq()
4467 MPASS(iaq->nrxq > 0); in calculate_iaq()
4468 MPASS(iaq->ntxq > 0); in calculate_iaq()
4470 MPASS(powerof2(iaq->nirq)); in calculate_iaq()
4475 cfg_itype_and_nqueues(struct adapter *sc, struct intrs_and_queues *iaq) in cfg_itype_and_nqueues() argument
4494 calculate_iaq(sc, iaq, itype, navail); in cfg_itype_and_nqueues()
4495 nalloc = iaq->nirq; in cfg_itype_and_nqueues()
4503 if (nalloc == iaq->nirq) in cfg_itype_and_nqueues()
4512 itype, iaq->nirq, nalloc); in cfg_itype_and_nqueues()
4520 itype, rc, iaq->nirq, nalloc); in cfg_itype_and_nqueues()