Lines Matching defs:vi

1387 		 * XXX: vi[0] is special so we can't delay this allocation until
1390 pi->vi = malloc(sizeof(struct vi_info) * t4_num_vis, M_CXGBE,
1401 free(pi->vi, M_CXGBE);
1451 pi->vi[0].dev = pi->dev;
1566 struct vi_info *vi;
1572 for_each_vi(pi, j, vi) {
1573 vi->pi = pi;
1574 vi->adapter = sc;
1575 vi->first_intr = -1;
1576 vi->qsize_rxq = t4_qsize_rxq;
1577 vi->qsize_txq = t4_qsize_txq;
1579 vi->first_rxq = rqidx;
1580 vi->first_txq = tqidx;
1581 vi->tmr_idx = t4_tmr_idx;
1582 vi->pktc_idx = t4_pktc_idx;
1583 vi->nrxq = j == 0 ? iaq.nrxq : iaq.nrxq_vi;
1584 vi->ntxq = j == 0 ? iaq.ntxq : iaq.ntxq_vi;
1586 rqidx += vi->nrxq;
1587 tqidx += vi->ntxq;
1589 if (j == 0 && vi->ntxq > 1)
1590 vi->rsrv_noflowq = t4_rsrv_noflowq ? 1 : 0;
1592 vi->rsrv_noflowq = 0;
1595 vi->first_ofld_txq = ofld_tqidx;
1596 vi->nofldtxq = j == 0 ? iaq.nofldtxq : iaq.nofldtxq_vi;
1597 ofld_tqidx += vi->nofldtxq;
1600 vi->ofld_tmr_idx = t4_tmr_idx_ofld;
1601 vi->ofld_pktc_idx = t4_pktc_idx_ofld;
1602 vi->first_ofld_rxq = ofld_rqidx;
1603 vi->nofldrxq = j == 0 ? iaq.nofldrxq : iaq.nofldrxq_vi;
1605 ofld_rqidx += vi->nofldrxq;
1608 vi->first_nm_rxq = nm_rqidx;
1609 vi->first_nm_txq = nm_tqidx;
1611 vi->nnmrxq = iaq.nnmrxq;
1612 vi->nnmtxq = iaq.nnmtxq;
1614 vi->nnmrxq = iaq.nnmrxq_vi;
1615 vi->nnmtxq = iaq.nnmtxq_vi;
1617 nm_rqidx += vi->nnmrxq;
1618 nm_tqidx += vi->nnmtxq;
1809 t4_free_vi(sc, sc->mbox, sc->pf, 0, pi->vi[0].viid);
1812 free(pi->vi, M_CXGBE);
2008 struct vi_info *vi;
2039 for_each_vi(pi, j, vi) {
2040 vi->xact_addr_filt = -1;
2041 mtx_lock(&vi->tick_mtx);
2042 vi->flags |= VI_SKIP_STATS;
2043 mtx_unlock(&vi->tick_mtx);
2044 if (!(vi->flags & VI_INIT_DONE))
2047 ifp = vi->ifp;
2049 mtx_lock(&vi->tick_mtx);
2050 callout_stop(&vi->tick);
2051 mtx_unlock(&vi->tick_mtx);
2052 callout_drain(&vi->tick);
2058 for_each_txq(vi, k, txq) {
2064 for_each_ofld_txq(vi, k, ofld_txq) {
2070 for_each_rxq(vi, k, rxq) {
2074 for_each_ofld_rxq(vi, k, ofld_rxq) {
2079 quiesce_vi(vi);
2304 struct vi_info *vi;
2354 MPASS(pi->vi != NULL);
2355 MPASS(pi->vi[0].dev == pi->dev);
2369 for_each_vi(pi, j, vi) {
2370 if (IS_MAIN_VI(vi))
2372 rc = alloc_extra_vi(sc, pi, vi);
2374 CH_ERR(vi,
2400 for_each_vi(pi, j, vi) {
2401 mtx_lock(&vi->tick_mtx);
2402 vi->flags &= ~VI_SKIP_STATS;
2403 mtx_unlock(&vi->tick_mtx);
2404 if (!(vi->flags & VI_INIT_DONE))
2406 rc = vi_full_init(vi);
2408 CH_ERR(vi, "failed to re-initialize "
2412 if (sc->traceq < 0 && IS_MAIN_VI(vi)) {
2413 sc->traceq = sc->sge.rxq[vi->first_rxq].iq.abs_id;
2422 ifp = vi->ifp;
2434 CH_ERR(vi, "failed to re-configure MAC: %d\n", rc);
2437 rc = -t4_enable_vi(sc, sc->mbox, vi->viid, true,
2440 CH_ERR(vi, "failed to re-enable VI: %d\n", rc);
2443 for_each_txq(vi, k, txq) {
2448 mtx_lock(&vi->tick_mtx);
2449 callout_schedule(&vi->tick, hz);
2450 mtx_unlock(&vi->tick_mtx);
2467 for_each_vi(pi, j, vi) {
2468 if (!(vi->flags & VI_INIT_DONE))
2470 ifp = vi->ifp;
2475 CH_ERR(vi, "failed to re-configure MCAST MACs: %d\n", rc);
2607 cxgbe_vi_attach(device_t dev, struct vi_info *vi)
2611 struct sysctl_ctx_list *ctx = &vi->ctx;
2614 struct adapter *sc = vi->adapter;
2617 children = SYSCTL_CHILDREN(device_get_sysctl_tree(vi->dev));
2618 vi->rxq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "rxq",
2620 vi->txq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "txq",
2623 vi->nm_rxq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "nm_rxq",
2625 vi->nm_txq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "nm_txq",
2629 vi->ofld_rxq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "ofld_rxq",
2633 vi->ofld_txq_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "ofld_txq",
2637 vi->xact_addr_filt = -1;
2638 mtx_init(&vi->tick_mtx, "vi tick", NULL, MTX_DEF);
2639 callout_init_mtx(&vi->tick, &vi->tick_mtx, 0);
2641 vi->flags |= TX_USES_VM_WR;
2645 vi->ifp = ifp;
2646 if_setsoftc(ifp, vi);
2655 if (vi->pi->nvi > 1 || sc->flags & IS_VF)
2679 if (vi->nofldrxq != 0)
2683 if (is_ethoffload(sc) && vi->nofldtxq != 0) {
2690 if (vi->flags & TX_USES_VM_WR)
2695 if (is_ethoffload(sc) && vi->nofldtxq != 0)
2707 ether_ifattach(ifp, vi->hw_addr);
2709 if (vi->nnmrxq != 0)
2710 cxgbe_nm_attach(vi);
2713 sbuf_printf(sb, "%d txq, %d rxq (NIC)", vi->ntxq, vi->nrxq);
2717 sbuf_printf(sb, "; %d txq (TOE)", vi->nofldtxq);
2720 sbuf_printf(sb, "; %d txq (TOE/ETHOFLD)", vi->nofldtxq);
2723 sbuf_printf(sb, "; %d txq (ETHOFLD)", vi->nofldtxq);
2729 sbuf_printf(sb, ", %d rxq (TOE)", vi->nofldrxq);
2734 vi->nnmtxq, vi->nnmrxq);
2740 vi_sysctls(vi);
2746 vi->pfil = pfil_head_register(&pa);
2754 struct vi_info *vi;
2759 cxgbe_vi_attach(dev, &pi->vi[0]);
2761 for_each_vi(pi, i, vi) {
2764 vi->dev = device_add_child(dev, sc->names->vi_ifnet_name, DEVICE_UNIT_ANY);
2765 if (vi->dev == NULL) {
2769 device_set_softc(vi->dev, vi);
2780 cxgbe_vi_detach(struct vi_info *vi)
2782 if_t ifp = vi->ifp;
2784 if (vi->pfil != NULL) {
2785 pfil_head_unregister(vi->pfil);
2786 vi->pfil = NULL;
2794 cxgbe_nm_detach(vi);
2796 cxgbe_uninit_synchronized(vi);
2797 callout_drain(&vi->tick);
2798 mtx_destroy(&vi->tick_mtx);
2799 sysctl_ctx_free(&vi->ctx);
2800 vi_full_uninit(vi);
2802 if_free(vi->ifp);
2803 vi->ifp = NULL;
2819 begin_vi_detach(sc, &pi->vi[0]);
2824 cxgbe_vi_detach(&pi->vi[0]);
2826 end_vi_detach(sc, &pi->vi[0]);
2834 struct vi_info *vi = arg;
2835 struct adapter *sc = vi->adapter;
2837 if (begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4init") != 0)
2839 cxgbe_init_synchronized(vi);
2847 struct vi_info *vi = if_getsoftc(ifp);
2848 struct port_info *pi = vi->pi;
2859 rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4mtu");
2863 if (vi->flags & VI_INIT_DONE) {
2873 rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4flg");
2884 flags = vi->if_flags;
2891 rc = cxgbe_init_synchronized(vi);
2893 vi->if_flags = if_getflags(ifp);
2895 rc = cxgbe_uninit_synchronized(vi);
2902 rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4multi");
2911 rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4cap");
2975 for_each_rxq(vi, i, rxq) {
2987 rc = toe_capability(vi, enable);
3017 for_each_rxq(vi, i, rxq) {
3077 rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4i2c");
3101 struct vi_info *vi = if_getsoftc(ifp);
3102 struct port_info *pi = vi->pi;
3120 rc = parse_pkt(&m, vi->flags & TX_USES_VM_WR);
3134 sc = vi->adapter;
3135 txq = &sc->sge.txq[vi->first_txq];
3137 txq += ((m->m_pkthdr.flowid % (vi->ntxq - vi->rsrv_noflowq)) +
3138 vi->rsrv_noflowq);
3151 struct vi_info *vi = if_getsoftc(ifp);
3156 if (vi->flags & VI_INIT_DONE) {
3157 for_each_txq(vi, i, txq) {
3176 struct vi_info *vi = if_getsoftc(ifp);
3177 struct fw_vi_stats_vf *s = &vi->stats;
3179 mtx_lock(&vi->tick_mtx);
3180 vi_refresh_stats(vi);
3181 mtx_unlock(&vi->tick_mtx);
3208 if (vi->flags & VI_INIT_DONE) {
3212 for_each_txq(vi, i, txq)
3228 struct vi_info *vi = if_getsoftc(ifp);
3229 struct port_info *pi = vi->pi;
3232 mtx_lock(&vi->tick_mtx);
3233 cxgbe_refresh_stats(vi);
3234 mtx_unlock(&vi->tick_mtx);
3271 if (vi->flags & VI_INIT_DONE) {
3275 for_each_txq(vi, i, txq)
3304 struct vi_info *vi = if_getsoftc(ifp);
3306 if (is_t6(vi->pi->adapter))
3327 struct vi_info *vi = if_getsoftc(ifp);
3328 struct port_info *pi = vi->pi;
3516 struct vi_info *vi = if_getsoftc(ifp);
3517 struct port_info *pi = vi->pi;
3521 if (begin_synchronized_op(sc, vi , SLEEP_OK | INTR_OK, "t4med") != 0)
3559 struct vi_info *vi = device_get_softc(dev);
3561 device_set_descf(dev, "port %d vi %td", vi->pi->port_id,
3562 vi - vi->pi->vi);
3568 alloc_extra_vi(struct adapter *sc, struct port_info *pi, struct vi_info *vi)
3575 index = vi - pi->vi;
3579 device_get_nameunit(vi->dev)));
3582 vi->hw_addr, &vi->rss_size, &vi->vfvld, &vi->vin, func, 0);
3584 CH_ERR(vi, "failed to allocate virtual interface %d"
3588 vi->viid = rc;
3590 if (vi->rss_size == 1) {
3597 device_printf(vi->dev, "RSS table not available.\n");
3598 vi->rss_base = 0xffff;
3605 V_FW_PARAMS_PARAM_YZ(vi->viid);
3608 vi->rss_base = 0xffff;
3610 MPASS((val >> 16) == vi->rss_size);
3611 vi->rss_base = val & 0xffff;
3620 struct vi_info *vi;
3625 vi = device_get_softc(dev);
3626 pi = vi->pi;
3629 rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4via");
3632 rc = alloc_extra_vi(sc, pi, vi);
3637 cxgbe_vi_attach(dev, vi);
3645 struct vi_info *vi;
3648 vi = device_get_softc(dev);
3649 sc = vi->adapter;
3651 begin_vi_detach(sc, vi);
3652 cxgbe_vi_detach(vi);
3653 t4_free_vi(sc, sc->mbox, sc->pf, 0, vi->viid);
3654 end_vi_detach(sc, vi);
6149 struct vi_info *vi = if_getsoftc(ctx->ifp);
6150 struct port_info *pi = vi->pi;
6161 ctx->rc = t4_alloc_mac_filt(sc, sc->mbox, vi->viid, ctx->del,
6193 struct vi_info *vi = if_getsoftc(ifp);
6194 struct port_info *pi = vi->pi;
6215 rc = -t4_set_rxmode(sc, sc->mbox, vi->viid, mtu, promisc,
6228 rc = t4_change_mac(sc, sc->mbox, vi->viid, vi->xact_addr_filt,
6229 ucaddr, true, &vi->smt_idx);
6235 vi->xact_addr_filt = rc;
6264 rc = t4_alloc_mac_filt(sc, sc->mbox, vi->viid,
6285 rc = -t4_set_addr_hash(sc, sc->mbox, vi->viid, 0, ctx.hash, 0);
6295 if (IS_MAIN_VI(vi) && sc->vxlan_refcount > 0 &&
6297 rc = t4_alloc_raw_mac_filt(sc, vi->viid, match_all_mac,
6318 begin_synchronized_op(struct adapter *sc, struct vi_info *vi, int flags,
6338 if (vi && IS_DETACHING(vi)) {
6380 begin_vi_detach(struct adapter *sc, struct vi_info *vi)
6383 SET_DETACHING(vi);
6397 end_vi_detach(struct adapter *sc, struct vi_info *vi)
6402 CLR_DETACHING(vi);
6426 cxgbe_init_synchronized(struct vi_info *vi)
6428 struct port_info *pi = vi->pi;
6430 if_t ifp = vi->ifp;
6442 if (!(vi->flags & VI_INIT_DONE) && ((rc = vi_init(vi)) != 0))
6457 rc = -t4_enable_vi(sc, sc->mbox, vi->viid, true, true);
6469 for_each_txq(vi, i, txq) {
6478 if (sc->traceq < 0 && IS_MAIN_VI(vi)) {
6479 sc->traceq = sc->sge.rxq[vi->first_rxq].iq.abs_id;
6493 mtx_lock(&vi->tick_mtx);
6494 if (vi->pi->nvi > 1 || sc->flags & IS_VF)
6495 callout_reset(&vi->tick, hz, vi_tick, vi);
6497 callout_reset(&vi->tick, hz, cxgbe_tick, vi);
6498 mtx_unlock(&vi->tick_mtx);
6501 cxgbe_uninit_synchronized(vi);
6510 cxgbe_uninit_synchronized(struct vi_info *vi)
6512 struct port_info *pi = vi->pi;
6514 if_t ifp = vi->ifp;
6520 if (!(vi->flags & VI_INIT_DONE)) {
6524 "vi->flags 0x%016lx, if_flags 0x%08x, "
6525 "if_drv_flags 0x%08x\n", vi->flags, if_getflags(ifp),
6538 rc = -t4_enable_vi(sc, sc->mbox, vi->viid, false, false);
6544 for_each_txq(vi, i, txq) {
6550 mtx_lock(&vi->tick_mtx);
6551 callout_stop(&vi->tick);
6552 mtx_unlock(&vi->tick_mtx);
6586 struct vi_info *vi;
6633 for_each_vi(pi, v, vi) {
6634 vi->first_intr = rid - 1;
6636 if (vi->nnmrxq > 0) {
6637 int n = max(vi->nrxq, vi->nnmrxq);
6639 rxq = &sge->rxq[vi->first_rxq];
6641 nm_rxq = &sge->nm_rxq[vi->first_nm_rxq];
6646 if (q < vi->nrxq)
6649 if (q < vi->nnmrxq)
6674 if (q < vi->nrxq) {
6681 vi->nintr++;
6684 for_each_rxq(vi, q, rxq) {
6697 vi->nintr++;
6701 for_each_ofld_rxq(vi, q, ofld_rxq) {
6709 vi->nintr++;
6883 vi_full_init(struct vi_info *vi)
6885 struct adapter *sc = vi->adapter;
6899 rc = t4_setup_vi_queues(vi);
6906 if (vi->nrxq > vi->rss_size) {
6907 CH_ALERT(vi, "nrxq (%d) > hw RSS table size (%d); "
6908 "some queues will never receive traffic.\n", vi->nrxq,
6909 vi->rss_size);
6910 } else if (vi->rss_size % vi->nrxq) {
6911 CH_ALERT(vi, "nrxq (%d), hw RSS table size (%d); "
6912 "expect uneven traffic distribution.\n", vi->nrxq,
6913 vi->rss_size);
6916 if (vi->nrxq != nbuckets) {
6917 CH_ALERT(vi, "nrxq (%d) != kernel RSS buckets (%d);"
6918 "performance will be impacted.\n", vi->nrxq, nbuckets);
6921 if (vi->rss == NULL)
6922 vi->rss = malloc(vi->rss_size * sizeof (*vi->rss), M_CXGBE,
6924 for (i = 0; i < vi->rss_size;) {
6927 j %= vi->nrxq;
6928 rxq = &sc->sge.rxq[vi->first_rxq + j];
6929 vi->rss[i++] = rxq->iq.abs_id;
6931 for_each_rxq(vi, j, rxq) {
6932 vi->rss[i++] = rxq->iq.abs_id;
6933 if (i == vi->rss_size)
6939 rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size,
6940 vi->rss, vi->rss_size);
6942 CH_ERR(vi, "rss_config failed: %d\n", rc);
6947 vi->hashen = hashconfig_to_hashen(hashconfig);
6954 extra = hashen_to_hashconfig(vi->hashen) ^ hashconfig;
6966 CH_ALERT(vi,
6971 CH_ALERT(vi, "IPv4 2-tuple hashing forced on.\n");
6973 CH_ALERT(vi, "TCP/IPv4 4-tuple hashing forced on.\n");
6975 CH_ALERT(vi, "IPv6 2-tuple hashing forced on.\n");
6977 CH_ALERT(vi, "TCP/IPv6 4-tuple hashing forced on.\n");
6979 CH_ALERT(vi, "UDP/IPv4 4-tuple hashing forced on.\n");
6981 CH_ALERT(vi, "UDP/IPv6 4-tuple hashing forced on.\n");
6983 vi->hashen = F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN |
6988 rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, vi->rss[0],
6991 CH_ERR(vi, "rss hash/defaultq config failed: %d\n", rc);
6999 vi_init(struct vi_info *vi)
7003 ASSERT_SYNCHRONIZED_OP(vi->adapter);
7004 KASSERT((vi->flags & VI_INIT_DONE) == 0,
7007 rc = vi_full_init(vi);
7009 vi_full_uninit(vi);
7011 vi->flags |= VI_INIT_DONE;
7020 vi_full_uninit(struct vi_info *vi)
7023 if (vi->flags & VI_INIT_DONE) {
7024 quiesce_vi(vi);
7025 free(vi->rss, M_CXGBE);
7026 free(vi->nm_rss, M_CXGBE);
7029 t4_teardown_vi_queues(vi);
7030 vi->flags &= ~VI_INIT_DONE;
7135 quiesce_vi(struct vi_info *vi)
7138 struct adapter *sc = vi->adapter;
7148 if (!(vi->flags & VI_INIT_DONE))
7151 for_each_txq(vi, i, txq) {
7156 for_each_ofld_txq(vi, i, ofld_txq) {
7161 for_each_rxq(vi, i, rxq) {
7166 for_each_ofld_rxq(vi, i, ofld_rxq) {
7301 vi_refresh_stats(struct vi_info *vi)
7306 mtx_assert(&vi->tick_mtx, MA_OWNED);
7308 if (vi->flags & VI_SKIP_STATS)
7313 if (timevalcmp(&tv, &vi->last_refreshed, <))
7316 t4_get_vi_stats(vi->adapter, vi->vin, &vi->stats);
7317 getmicrotime(&vi->last_refreshed);
7321 cxgbe_refresh_stats(struct vi_info *vi)
7329 mtx_assert(&vi->tick_mtx, MA_OWNED);
7331 if (vi->flags & VI_SKIP_STATS)
7336 if (timevalcmp(&tv, &vi->last_refreshed, <))
7339 pi = vi->pi;
7340 sc = vi->adapter;
7354 getmicrotime(&vi->last_refreshed);
7360 struct vi_info *vi = arg;
7362 MPASS(IS_MAIN_VI(vi));
7363 mtx_assert(&vi->tick_mtx, MA_OWNED);
7365 cxgbe_refresh_stats(vi);
7366 callout_schedule(&vi->tick, hz);
7372 struct vi_info *vi = arg;
7374 mtx_assert(&vi->tick_mtx, MA_OWNED);
7376 vi_refresh_stats(vi);
7377 callout_schedule(&vi->tick, hz);
7910 vi_sysctls(struct vi_info *vi)
7912 struct sysctl_ctx_list *ctx = &vi->ctx;
7919 oid = device_get_sysctl_tree(vi->dev);
7923 vi->viid, "VI identifer");
7925 &vi->nrxq, 0, "# of rx queues");
7927 &vi->ntxq, 0, "# of tx queues");
7929 &vi->first_rxq, 0, "index of first rx queue");
7931 &vi->first_txq, 0, "index of first tx queue");
7933 vi->rss_base, "start of RSS indirection table");
7935 vi->rss_size, "size of RSS indirection table");
7937 if (IS_MAIN_VI(vi)) {
7939 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0,
7944 if (vi->adapter->flags & IS_VF) {
7945 MPASS(vi->flags & TX_USES_VM_WR);
7950 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0,
7955 if (vi->nofldrxq != 0) {
7957 &vi->nofldrxq, 0,
7960 CTLFLAG_RD, &vi->first_ofld_rxq, 0,
7963 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0,
7967 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0,
7973 if (vi->nofldtxq != 0) {
7975 &vi->nofldtxq, 0,
7978 CTLFLAG_RD, &vi->first_ofld_txq, 0,
7983 if (vi->nnmrxq != 0) {
7985 &vi->nnmrxq, 0, "# of netmap rx queues");
7987 &vi->nnmtxq, 0, "# of netmap tx queues");
7989 CTLFLAG_RD, &vi->first_nm_rxq, 0,
7992 CTLFLAG_RD, &vi->first_nm_txq, 0,
7998 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0,
8001 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0,
8005 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0,
8008 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0,
8272 rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4btt");
8295 struct vi_info *vi = arg1;
8298 val = vi->rsrv_noflowq;
8303 if ((val >= 1) && (vi->ntxq > 1))
8304 vi->rsrv_noflowq = 1;
8306 vi->rsrv_noflowq = 0;
8314 struct vi_info *vi = arg1;
8315 struct adapter *sc = vi->adapter;
8320 val = vi->flags & TX_USES_VM_WR ? 1 : 0;
8328 rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
8334 else if (if_getdrvflags(vi->ifp) & IFF_DRV_RUNNING) {
8342 struct port_info *pi = vi->pi;
8348 vi->flags |= TX_USES_VM_WR;
8349 if_sethwtsomaxsegcount(vi->ifp, TX_SGL_SEGS_VM_TSO);
8355 vi->flags &= ~TX_USES_VM_WR;
8356 if_sethwtsomaxsegcount(vi->ifp, TX_SGL_SEGS_TSO);
8359 V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld));
8361 for_each_txq(vi, i, txq) {
8373 struct vi_info *vi = arg1;
8374 struct adapter *sc = vi->adapter;
8379 idx = vi->tmr_idx;
8388 rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
8393 v = V_QINTR_TIMER_IDX(idx) | V_QINTR_CNT_EN(vi->pktc_idx != -1);
8394 for_each_rxq(vi, i, rxq) {
8401 vi->tmr_idx = idx;
8410 struct vi_info *vi = arg1;
8411 struct adapter *sc = vi->adapter;
8414 idx = vi->pktc_idx;
8423 rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
8428 if (vi->flags & VI_INIT_DONE)
8431 vi->pktc_idx = idx;
8440 struct vi_info *vi = arg1;
8441 struct adapter *sc = vi->adapter;
8444 qsize = vi->qsize_rxq;
8453 rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
8458 if (vi->flags & VI_INIT_DONE)
8461 vi->qsize_rxq = qsize;
8470 struct vi_info *vi = arg1;
8471 struct adapter *sc = vi->adapter;
8474 qsize = vi->qsize_txq;
8483 rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
8488 if (vi->flags & VI_INIT_DONE)
8491 vi->qsize_txq = qsize;
8542 rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK,
8622 rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK,
8736 rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK,
8776 rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4ff");
11245 struct vi_info *vi;
11263 for_each_vi(sc->port[i], j, vi) {
11264 if (vi->flags & VI_INIT_DONE)
11265 t4_update_fl_bufsize(vi->ifp);
11442 struct vi_info *vi = arg1;
11443 struct adapter *sc = vi->adapter;
11448 idx = vi->ofld_tmr_idx;
11457 rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
11462 v = V_QINTR_TIMER_IDX(idx) | V_QINTR_CNT_EN(vi->ofld_pktc_idx != -1);
11463 for_each_ofld_rxq(vi, i, ofld_rxq) {
11470 vi->ofld_tmr_idx = idx;
11479 struct vi_info *vi = arg1;
11480 struct adapter *sc = vi->adapter;
11483 idx = vi->ofld_pktc_idx;
11492 rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
11497 if (vi->flags & VI_INIT_DONE)
11500 vi->ofld_pktc_idx = idx;
11927 struct vi_info *vi;
11954 for_each_vi(pi, v, vi) {
11955 if (vi->flags & VI_INIT_DONE)
11956 t4_clr_vi_stats(sc, vi->vin);
11975 for_each_vi(pi, v, vi) {
11976 if (vi->flags & VI_INIT_DONE) {
11978 for_each_rxq(vi, i, rxq) {
11992 for_each_txq(vi, i, txq) {
12023 for_each_ofld_txq(vi, i, ofld_txq) {
12036 for_each_ofld_rxq(vi, i, ofld_rxq) {
12059 if (IS_MAIN_VI(vi)) {
12137 struct vi_info *vi;
12146 vi = &pi->vi[0];
12147 if (begin_synchronized_op(sc, vi, HOLD_LOCK, "t4mod") == 0) {
12158 ifp = vi->ifp;
12177 struct vi_info *vi;
12205 for_each_vi(pi, v, vi) {
12206 ifp = vi->ifp;
12207 if (ifp == NULL || IS_DETACHING(vi))
12385 toe_capability(struct vi_info *vi, bool enable)
12388 struct port_info *pi = vi->pi;
12432 if ((if_getcapenable(vi->ifp) & IFCAP_TOE) != 0) {
12442 if (!(vi->flags & VI_INIT_DONE) && ((rc = vi_init(vi)) != 0))
12444 if (!(pi->vi[0].flags & VI_INIT_DONE) &&
12445 ((rc = vi_init(&pi->vi[0])) != 0))
12479 if ((if_getcapenable(vi->ifp) & IFCAP_TOE) == 0) {
13067 rc = t4_alloc_raw_mac_filt(sc, pi->vi[0].viid, match_all_mac,
13072 CH_ERR(&pi->vi[0],