| 1627 | } |
| 1628 | |
| 1629 | int cxgbe_poll(struct sge_rspq *q, struct rte_mbuf **rx_pkts, |
| 1630 | unsigned int budget, unsigned int *work_done) |
| 1631 | { |
| 1632 | struct sge_eth_rxq *rxq = container_of(q, struct sge_eth_rxq, rspq); |
| 1633 | unsigned int cidx_inc; |
| 1634 | unsigned int params; |
| 1635 | u32 val; |
| 1636 | |
| 1637 | if (unlikely(rxq->flags & IQ_STOPPED)) { |
| 1638 | *work_done = 0; |
| 1639 | return 0; |
| 1640 | } |
| 1641 | |
| 1642 | *work_done = process_responses(q, budget, rx_pkts); |
| 1643 | |
| 1644 | if (*work_done) { |
| 1645 | cidx_inc = R_IDXDIFF(q, gts_idx); |
| 1646 | |
| 1647 | if (q->offset >= 0 && fl_cap(&rxq->fl) - rxq->fl.avail >= 64) |
| 1648 | __refill_fl(q->adapter, &rxq->fl); |
| 1649 | |
| 1650 | params = q->intr_params; |
| 1651 | q->next_intr_params = params; |
| 1652 | val = V_CIDXINC(cidx_inc) | V_SEINTARM(params); |
| 1653 | |
| 1654 | if (unlikely(!q->bar2_addr)) { |
| 1655 | u32 reg = is_pf4(q->adapter) ? MYPF_REG(A_SGE_PF_GTS) : |
| 1656 | T4VF_SGE_BASE_ADDR + |
| 1657 | A_SGE_VF_GTS; |
| 1658 | |
| 1659 | t4_write_reg(q->adapter, reg, |
| 1660 | val | V_INGRESSQID((u32)q->cntxt_id)); |
| 1661 | } else { |
| 1662 | writel(val | V_INGRESSQID(q->bar2_qid), |
| 1663 | (void *)((uintptr_t)q->bar2_addr + SGE_UDB_GTS)); |
| 1664 | /* This Write memory Barrier will force the |
| 1665 | * write to the User Doorbell area to be |
| 1666 | * flushed. |
| 1667 | */ |
| 1668 | wmb(); |
| 1669 | } |
| 1670 | q->gts_idx = q->cidx; |
| 1671 | } |
| 1672 | return 0; |
| 1673 | } |
| 1674 | |
| 1675 | /** |
| 1676 | * bar2_address - return the BAR2 address for an SGE Queue's Registers |
no test coverage detected