| 1520 | } |
| 1521 | |
| 1522 | static int |
| 1523 | iflib_fast_intr_rxtx(void *arg) |
| 1524 | { |
| 1525 | iflib_filter_info_t info = arg; |
| 1526 | struct grouptask *gtask = info->ifi_task; |
| 1527 | if_ctx_t ctx; |
| 1528 | iflib_rxq_t rxq = (iflib_rxq_t)info->ifi_ctx; |
| 1529 | iflib_txq_t txq; |
| 1530 | void *sc; |
| 1531 | int i, cidx, result; |
| 1532 | qidx_t txqid; |
| 1533 | bool intr_enable, intr_legacy; |
| 1534 | |
| 1535 | DBG_COUNTER_INC(fast_intrs); |
| 1536 | if (info->ifi_filter != NULL) { |
| 1537 | result = info->ifi_filter(info->ifi_filter_arg); |
| 1538 | if ((result & FILTER_SCHEDULE_THREAD) == 0) |
| 1539 | return (result); |
| 1540 | } |
| 1541 | |
| 1542 | ctx = rxq->ifr_ctx; |
| 1543 | sc = ctx->ifc_softc; |
| 1544 | intr_enable = false; |
| 1545 | intr_legacy = !!(ctx->ifc_flags & IFC_LEGACY); |
| 1546 | MPASS(rxq->ifr_ntxqirq); |
| 1547 | for (i = 0; i < rxq->ifr_ntxqirq; i++) { |
| 1548 | txqid = rxq->ifr_txqid[i]; |
| 1549 | txq = &ctx->ifc_txqs[txqid]; |
| 1550 | bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, |
| 1551 | BUS_DMASYNC_POSTREAD); |
| 1552 | if (!ctx->isc_txd_credits_update(sc, txqid, false)) { |
| 1553 | if (intr_legacy) |
| 1554 | intr_enable = true; |
| 1555 | else |
| 1556 | IFDI_TX_QUEUE_INTR_ENABLE(ctx, txqid); |
| 1557 | continue; |
| 1558 | } |
| 1559 | GROUPTASK_ENQUEUE(&txq->ift_task); |
| 1560 | } |
| 1561 | if (ctx->ifc_sctx->isc_flags & IFLIB_HAS_RXCQ) |
| 1562 | cidx = rxq->ifr_cq_cidx; |
| 1563 | else |
| 1564 | cidx = rxq->ifr_fl[0].ifl_cidx; |
| 1565 | if (iflib_rxd_avail(ctx, rxq, cidx, 1)) |
| 1566 | GROUPTASK_ENQUEUE(gtask); |
| 1567 | else { |
| 1568 | if (intr_legacy) |
| 1569 | intr_enable = true; |
| 1570 | else |
| 1571 | IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); |
| 1572 | DBG_COUNTER_INC(rx_intr_enables); |
| 1573 | } |
| 1574 | if (intr_enable) |
| 1575 | IFDI_INTR_ENABLE(ctx); |
| 1576 | return (FILTER_HANDLED); |
| 1577 | } |
| 1578 | |
| 1579 | static int |
nothing calls this directly
no test coverage detected