Lines Matching refs:vi

1106 t4_setup_vi_queues(struct vi_info *vi)  in t4_setup_vi_queues()  argument
1122 struct adapter *sc = vi->adapter; in t4_setup_vi_queues()
1123 if_t ifp = vi->ifp; in t4_setup_vi_queues()
1127 intr_idx = vi->first_intr; in t4_setup_vi_queues()
1135 MPASS(vi->first_intr >= 0); in t4_setup_vi_queues()
1142 for_each_nm_rxq(vi, i, nm_rxq) { in t4_setup_vi_queues()
1143 rc = alloc_nm_rxq(vi, nm_rxq, intr_idx, i); in t4_setup_vi_queues()
1149 for_each_nm_txq(vi, i, nm_txq) { in t4_setup_vi_queues()
1150 iqidx = vi->first_nm_rxq + (i % vi->nnmrxq); in t4_setup_vi_queues()
1151 rc = alloc_nm_txq(vi, nm_txq, iqidx, i); in t4_setup_vi_queues()
1166 for_each_rxq(vi, i, rxq) { in t4_setup_vi_queues()
1167 rc = alloc_rxq(vi, rxq, i, intr_idx, maxp); in t4_setup_vi_queues()
1175 intr_idx = saved_idx + max(vi->nrxq, vi->nnmrxq); in t4_setup_vi_queues()
1179 for_each_ofld_rxq(vi, i, ofld_rxq) { in t4_setup_vi_queues()
1180 rc = alloc_ofld_rxq(vi, ofld_rxq, i, intr_idx, maxp); in t4_setup_vi_queues()
1191 for_each_txq(vi, i, txq) { in t4_setup_vi_queues()
1192 rc = alloc_txq(vi, txq, i); in t4_setup_vi_queues()
1197 for_each_ofld_txq(vi, i, ofld_txq) { in t4_setup_vi_queues()
1198 rc = alloc_ofld_txq(vi, ofld_txq, i); in t4_setup_vi_queues()
1205 t4_teardown_vi_queues(vi); in t4_setup_vi_queues()
1214 t4_teardown_vi_queues(struct vi_info *vi) in t4_teardown_vi_queues() argument
1231 if (if_getcapabilities(vi->ifp) & IFCAP_NETMAP) { in t4_teardown_vi_queues()
1232 for_each_nm_txq(vi, i, nm_txq) { in t4_teardown_vi_queues()
1233 free_nm_txq(vi, nm_txq); in t4_teardown_vi_queues()
1236 for_each_nm_rxq(vi, i, nm_rxq) { in t4_teardown_vi_queues()
1237 free_nm_rxq(vi, nm_rxq); in t4_teardown_vi_queues()
1247 for_each_txq(vi, i, txq) { in t4_teardown_vi_queues()
1248 free_txq(vi, txq); in t4_teardown_vi_queues()
1251 for_each_ofld_txq(vi, i, ofld_txq) { in t4_teardown_vi_queues()
1252 free_ofld_txq(vi, ofld_txq); in t4_teardown_vi_queues()
1260 for_each_rxq(vi, i, rxq) { in t4_teardown_vi_queues()
1261 free_rxq(vi, rxq); in t4_teardown_vi_queues()
1264 for_each_ofld_rxq(vi, i, ofld_rxq) { in t4_teardown_vi_queues()
1265 free_ofld_rxq(vi, ofld_rxq); in t4_teardown_vi_queues()
1939 struct vi_info *vi = if_getsoftc(ifp); in eth_rx() local
1981 if (vi->pfil != NULL && PFIL_HOOKED_IN(vi->pfil) && in eth_rx()
1991 rc = pfil_mem_in(vi->pfil, frame, slen, ifp, &m0); in eth_rx()
2245 struct vi_info *vi = if_getsoftc(ifp); in t4_update_fl_bufsize() local
2246 struct adapter *sc = vi->adapter; in t4_update_fl_bufsize()
2255 for_each_rxq(vi, i, rxq) { in t4_update_fl_bufsize()
2265 for_each_ofld_rxq(vi, i, ofld_rxq) { in t4_update_fl_bufsize()
3124 struct vi_info *vi = if_getsoftc(ifp); in eth_tx() local
3125 struct adapter *sc = vi->adapter; in eth_tx()
3187 if (vi->flags & TX_USES_VM_WR) in eth_tx()
3201 if (vi->flags & TX_USES_VM_WR) in eth_tx()
3208 if (vi->flags & TX_USES_VM_WR) in eth_tx()
3257 if (vi->flags & TX_USES_VM_WR) in eth_tx()
3301 if (vi->flags & TX_USES_VM_WR) in eth_tx()
3308 if (vi->flags & TX_USES_VM_WR) in eth_tx()
3453 alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl, in alloc_iq_fl() argument
3458 struct adapter *sc = vi->adapter; in alloc_iq_fl()
3520 alloc_iq_fl_hwq(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl) in alloc_iq_fl_hwq() argument
3524 struct adapter *sc = vi->adapter; in alloc_iq_fl_hwq()
3525 struct port_info *pi = vi->pi; in alloc_iq_fl_hwq()
3555 V_FW_IQ_CMD_VIID(vi->viid) | in alloc_iq_fl_hwq()
3758 struct vi_info *vi = &sc->port[0]->vi[0]; in alloc_fwq() local
3768 rc = alloc_iq_fl(vi, fwq, NULL, &sc->ctx, sc->fwq_oid); in alloc_fwq()
3779 rc = alloc_iq_fl_hwq(vi, fwq, NULL); in alloc_fwq()
3938 alloc_rxq(struct vi_info *vi, struct sge_rxq *rxq, int idx, int intr_idx, in alloc_rxq() argument
3942 struct adapter *sc = vi->adapter; in alloc_rxq()
3943 if_t ifp = vi->ifp; in alloc_rxq()
3958 oid = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(vi->rxq_oid), in alloc_rxq()
3962 init_iq(&rxq->iq, sc, vi->tmr_idx, vi->pktc_idx, vi->qsize_rxq, in alloc_rxq()
3971 device_get_nameunit(vi->dev), idx); in alloc_rxq()
3972 init_fl(sc, &rxq->fl, vi->qsize_rxq / 8, maxp, name); in alloc_rxq()
3973 rc = alloc_iq_fl(vi, &rxq->iq, &rxq->fl, &vi->ctx, oid); in alloc_rxq()
3975 CH_ERR(vi, "failed to allocate rxq%d: %d\n", idx, rc); in alloc_rxq()
3984 add_rxq_sysctls(&vi->ctx, oid, rxq); in alloc_rxq()
3989 rc = alloc_iq_fl_hwq(vi, &rxq->iq, &rxq->fl); in alloc_rxq()
3991 CH_ERR(vi, "failed to create hw rxq%d: %d\n", idx, rc); in alloc_rxq()
4020 free_rxq(struct vi_info *vi, struct sge_rxq *rxq) in free_rxq() argument
4024 free_iq_fl_hwq(vi->adapter, &rxq->iq, &rxq->fl); in free_rxq()
4033 free_iq_fl(vi->adapter, &rxq->iq, &rxq->fl); in free_rxq()
4069 alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq, int idx, in alloc_ofld_rxq() argument
4073 struct adapter *sc = vi->adapter; in alloc_ofld_rxq()
4081 oid = SYSCTL_ADD_NODE(&vi->ctx, in alloc_ofld_rxq()
4082 SYSCTL_CHILDREN(vi->ofld_rxq_oid), OID_AUTO, name, in alloc_ofld_rxq()
4085 init_iq(&ofld_rxq->iq, sc, vi->ofld_tmr_idx, vi->ofld_pktc_idx, in alloc_ofld_rxq()
4086 vi->qsize_rxq, intr_idx, ofld_cong_drop, IQ_OFLD); in alloc_ofld_rxq()
4088 device_get_nameunit(vi->dev), idx); in alloc_ofld_rxq()
4089 init_fl(sc, &ofld_rxq->fl, vi->qsize_rxq / 8, maxp, name); in alloc_ofld_rxq()
4090 rc = alloc_iq_fl(vi, &ofld_rxq->iq, &ofld_rxq->fl, &vi->ctx, in alloc_ofld_rxq()
4093 CH_ERR(vi, "failed to allocate ofld_rxq%d: %d\n", idx, in alloc_ofld_rxq()
4105 add_ofld_rxq_sysctls(&vi->ctx, oid, ofld_rxq); in alloc_ofld_rxq()
4110 rc = alloc_iq_fl_hwq(vi, &ofld_rxq->iq, &ofld_rxq->fl); in alloc_ofld_rxq()
4112 CH_ERR(vi, "failed to create hw ofld_rxq%d: %d\n", idx, in alloc_ofld_rxq()
4125 free_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq) in free_ofld_rxq() argument
4129 free_iq_fl_hwq(vi->adapter, &ofld_rxq->iq, &ofld_rxq->fl); in free_ofld_rxq()
4135 free_iq_fl(vi->adapter, &ofld_rxq->iq, &ofld_rxq->fl); in free_ofld_rxq()
4279 eth_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq) in eth_eq_alloc() argument
4293 F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(vi->viid)); in eth_eq_alloc()
4307 device_printf(vi->dev, in eth_eq_alloc()
4325 ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq) in ofld_eq_alloc() argument
4352 device_printf(vi->dev, in ofld_eq_alloc()
4429 alloc_eq_hwq(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq) in alloc_eq_hwq() argument
4448 rc = eth_eq_alloc(sc, vi, eq); in alloc_eq_hwq()
4453 rc = ofld_eq_alloc(sc, vi, eq); in alloc_eq_hwq()
4490 free_eq_hwq(struct adapter *sc, struct vi_info *vi __unused, struct sge_eq *eq) in free_eq_hwq()
4521 alloc_wrq(struct adapter *sc, struct vi_info *vi, struct sge_wrq *wrq, in alloc_wrq() argument
4578 alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx) in alloc_txq() argument
4581 struct port_info *pi = vi->pi; in alloc_txq()
4582 struct adapter *sc = vi->adapter; in alloc_txq()
4592 oid = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(vi->txq_oid), in alloc_txq()
4596 iqidx = vi->first_rxq + (idx % vi->nrxq); in alloc_txq()
4598 device_get_nameunit(vi->dev), idx); in alloc_txq()
4599 init_eq(sc, &txq->eq, EQ_ETH, vi->qsize_txq, pi->port_id, in alloc_txq()
4605 CH_ERR(vi, "failed to allocate mp_ring for txq%d: %d\n", in alloc_txq()
4612 rc = alloc_eq(sc, eq, &vi->ctx, oid); in alloc_txq()
4614 CH_ERR(vi, "failed to allocate txq%d: %d\n", idx, rc); in alloc_txq()
4622 txq->ifp = vi->ifp; in alloc_txq()
4627 add_txq_sysctls(vi, &vi->ctx, oid, txq); in alloc_txq()
4632 rc = alloc_eq_hwq(sc, vi, eq); in alloc_txq()
4634 CH_ERR(vi, "failed to create hw txq%d: %d\n", idx, rc); in alloc_txq()
4652 if (vi->flags & TX_USES_VM_WR && !(sc->flags & IS_VF)) in alloc_txq()
4655 if (vi->flags & TX_USES_VM_WR) in alloc_txq()
4661 V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); in alloc_txq()
4673 free_txq(struct vi_info *vi, struct sge_txq *txq) in free_txq() argument
4675 struct adapter *sc = vi->adapter; in free_txq()
4696 add_txq_sysctls(struct vi_info *vi, struct sysctl_ctx_list *ctx, in add_txq_sysctls() argument
4705 sc = vi->adapter; in add_txq_sysctls()
4711 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, txq - sc->sge.txq, in add_txq_sysctls()
4794 alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx) in alloc_ofld_txq() argument
4797 struct port_info *pi = vi->pi; in alloc_ofld_txq()
4798 struct adapter *sc = vi->adapter; in alloc_ofld_txq()
4804 MPASS(idx < vi->nofldtxq); in alloc_ofld_txq()
4808 oid = SYSCTL_ADD_NODE(&vi->ctx, in alloc_ofld_txq()
4809 SYSCTL_CHILDREN(vi->ofld_txq_oid), OID_AUTO, name, in alloc_ofld_txq()
4813 device_get_nameunit(vi->dev), idx); in alloc_ofld_txq()
4814 if (vi->nofldrxq > 0) { in alloc_ofld_txq()
4815 iqidx = vi->first_ofld_rxq + (idx % vi->nofldrxq); in alloc_ofld_txq()
4816 init_eq(sc, eq, EQ_OFLD, vi->qsize_txq, pi->port_id, in alloc_ofld_txq()
4819 iqidx = vi->first_rxq + (idx % vi->nrxq); in alloc_ofld_txq()
4820 init_eq(sc, eq, EQ_OFLD, vi->qsize_txq, pi->port_id, in alloc_ofld_txq()
4824 rc = alloc_wrq(sc, vi, &ofld_txq->wrq, &vi->ctx, oid); in alloc_ofld_txq()
4826 CH_ERR(vi, "failed to allocate ofld_txq%d: %d\n", idx, in alloc_ofld_txq()
4841 add_ofld_txq_sysctls(&vi->ctx, oid, ofld_txq); in alloc_ofld_txq()
4845 rc = alloc_eq_hwq(sc, vi, eq); in alloc_ofld_txq()
4847 CH_ERR(vi, "failed to create hw ofld_txq%d: %d\n", idx, in alloc_ofld_txq()
4861 free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) in free_ofld_txq() argument
4863 struct adapter *sc = vi->adapter; in free_ofld_txq()
6536 struct vi_info *vi) in send_etid_flowc_wr() argument
6834 struct vi_info *vi = if_getsoftc(ifp); in ethofld_transmit() local
6835 struct port_info *pi = vi->pi; in ethofld_transmit()
6837 const uint32_t rss_mask = vi->rss_size - 1; in ethofld_transmit()
6840 cst->eo_txq = &sc->sge.ofld_txq[vi->first_ofld_txq]; in ethofld_transmit()
6846 cst->iqid = vi->rss[rss_hash & rss_mask]; in ethofld_transmit()
6847 cst->eo_txq += rss_hash % vi->nofldtxq; in ethofld_transmit()
6848 rc = send_etid_flowc_wr(cst, pi, vi); in ethofld_transmit()