Lines Matching defs:rxq
646 aprint_error(": failed to init rxq: %d\n", error);
1237 struct pq3etsec_rxqueue *rxq,
1241 bus_dmamap_sync(sc->sc_dmat, rxq->rxq_descmap,
1242 (rxbd - rxq->rxq_first) * sizeof(*rxbd), count * sizeof(*rxbd),
1249 struct pq3etsec_rxqueue *rxq,
1253 bus_dmamap_sync(sc->sc_dmat, rxq->rxq_descmap,
1254 (rxbd - rxq->rxq_first) * sizeof(*rxbd), count * sizeof(*rxbd),
1478 struct pq3etsec_rxqueue *rxq)
1480 volatile struct rxbd *producer = rxq->rxq_producer;
1482 size_t inuse = rxq->rxq_inuse;
1484 while (rxq->rxq_inuse < rxq->rxq_threshold) {
1498 KASSERT(rxq->rxq_mbufs[producer-rxq->rxq_first] == NULL);
1499 rxq->rxq_mbufs[producer-rxq->rxq_first] = m;
1506 if (__predict_false(rxq->rxq_mhead == NULL)) {
1507 KASSERT(producer == rxq->rxq_consumer);
1508 rxq->rxq_mconsumer = m;
1510 *rxq->rxq_mtail = m;
1511 rxq->rxq_mtail = &m->m_next;
1514 rxq->rxq_inuse++;
1515 if (++producer == rxq->rxq_last) {
1517 pq3etsec_rxq_desc_presync(sc, rxq, rxq->rxq_producer,
1518 rxq->rxq_last - rxq->rxq_producer);
1519 producer = rxq->rxq_producer = rxq->rxq_first;
1522 if (producer != rxq->rxq_producer) {
1524 pq3etsec_rxq_desc_presync(sc, rxq, rxq->rxq_producer,
1525 producer - rxq->rxq_producer);
1526 rxq->rxq_producer = producer;
1530 KASSERT(qhlt & rxq->rxq_qmask);
1532 etsec_write(sc, RSTAT, RSTAT_QHLT & rxq->rxq_qmask);
1537 __func__, inuse, rxq->rxq_inuse);
1614 struct pq3etsec_rxqueue *rxq)
1617 volatile struct rxbd *consumer = rxq->rxq_consumer;
1620 etsec_write(sc, RSTAT, RSTAT_RXF & rxq->rxq_qmask);
1623 if (consumer == rxq->rxq_producer) {
1624 rxq->rxq_consumer = consumer;
1625 rxq->rxq_inuse -= rxconsumed;
1626 KASSERT(rxq->rxq_inuse == 0);
1629 pq3etsec_rxq_desc_postsync(sc, rxq, consumer, 1);
1632 rxq->rxq_consumer = consumer;
1633 rxq->rxq_inuse -= rxconsumed;
1636 KASSERT(rxq->rxq_mconsumer != NULL);
1638 KASSERT(rxq->rxq_mbufs[consumer - rxq->rxq_first] == rxq->rxq_mconsumer);
1643 consumer - rxq->rxq_first, rxbd_flags, consumer->rxbd_len,
1644 mtod(rxq->rxq_mconsumer, int *)[0],
1645 mtod(rxq->rxq_mconsumer, int *)[1],
1646 mtod(rxq->rxq_mconsumer, int *)[2],
1647 mtod(rxq->rxq_mconsumer, int *)[3]);
1661 struct mbuf *m = rxq->rxq_mhead;
1662 struct mbuf *m_last = rxq->rxq_mconsumer;
1663 if ((rxq->rxq_mhead = m_last->m_next) == NULL)
1664 rxq->rxq_mtail = &rxq->rxq_mhead;
1665 rxq->rxq_mconsumer = rxq->rxq_mhead;
1678 for (m = rxq->rxq_mhead;
1679 m != rxq->rxq_mconsumer;
1683 m = rxq->rxq_mconsumer;
1684 if ((rxq->rxq_mhead = m->m_next) == NULL)
1685 rxq->rxq_mtail = &rxq->rxq_mhead;
1686 rxq->rxq_mconsumer = m->m_next;
1689 rxq->rxq_mconsumer = rxq->rxq_mconsumer->m_next;
1692 rxq->rxq_mbufs[consumer - rxq->rxq_first] = NULL;
1699 KASSERT(consumer + 1 == rxq->rxq_last);
1700 consumer = rxq->rxq_first;
1705 KASSERT(rxq->rxq_mbufs[consumer - rxq->rxq_first] == rxq->rxq_mconsumer);
1716 struct pq3etsec_rxqueue *rxq,
1721 if ((m = rxq->rxq_mhead) != NULL) {
1723 memset(rxq->rxq_mbufs, 0, sizeof(rxq->rxq_mbufs));
1739 rxq->rxq_mconsumer = NULL;
1740 rxq->rxq_mhead = NULL;
1741 rxq->rxq_mtail = &rxq->rxq_mhead;
1742 rxq->rxq_inuse = 0;
1748 struct pq3etsec_rxqueue *rxq)
1753 pq3etsec_rxq_desc_postsync(sc, rxq, rxq->rxq_first,
1754 rxq->rxq_last - rxq->rxq_first);
1760 for (rxbd = rxq->rxq_first; rxbd < rxq->rxq_last - 1; rxbd++) {
1772 rxq->rxq_consumer = rxq->rxq_first;
1773 rxq->rxq_producer = rxq->rxq_first;
1774 rxq->rxq_inuse = 0;
1775 if (rxq->rxq_threshold < ETSEC_MINRXMBUFS)
1776 rxq->rxq_threshold = ETSEC_MINRXMBUFS;
1783 etsec_write(sc, rxq->rxq_reg_rbase, rxq->rxq_descmap->dm_segs->ds_addr);
1789 struct pq3etsec_rxqueue *rxq,
1798 &rxq->rxq_descmap_seg, &rxq->rxq_descmap, &descs);
1803 rxq->rxq_first = descs;
1804 rxq->rxq_last = rxq->rxq_first + desc_count;
1805 rxq->rxq_consumer = descs;
1806 rxq->rxq_producer = descs;
1808 pq3etsec_rxq_purge(sc, rxq, true);
1809 pq3etsec_rxq_reset(sc, rxq);
1811 rxq->rxq_reg_rbase = RBASEn(qno);
1812 rxq->rxq_qmask = RSTAT_QHLTn(qno) | RSTAT_RXFn(qno);
2509 struct pq3etsec_rxqueue * const rxq = &sc->sc_rxq;
2510 size_t threshold = 5 * rxq->rxq_threshold / 4;
2511 if (threshold >= rxq->rxq_last - rxq->rxq_first) {
2512 threshold = rxq->rxq_last - rxq->rxq_first - 1;
2518 rxq->rxq_threshold, threshold);
2519 rxq->rxq_threshold = threshold;