Lines Matching refs:wq

126 #define OCE_WQ_FOREACH(sc, wq, i) 	\
127 for (i = 0, wq = sc->sc_wq[0]; i < sc->sc_nwq; i++, wq = sc->sc_wq[i])
1045 struct oce_wq *wq;
1097 OCE_WQ_FOREACH(sc, wq, i)
1098 oce_arm_cq(wq->cq, 0, TRUE);
1126 struct oce_wq *wq;
1152 OCE_WQ_FOREACH(sc, wq, i)
1153 oce_drain_wq(wq);
1202 struct oce_wq *wq = sc->sc_wq[wqidx];
1217 if ((pkt = oce_pkt_get(&wq->pkt_free)) == NULL)
1240 if (nwqe >= wq->ring->nitems - wq->ring->nused) {
1250 nhe = oce_ring_get(wq->ring);
1281 oce_dma_sync(&wq->ring->dma, BUS_DMASYNC_PREREAD |
1284 wq->ring->nused++;
1288 nfe = oce_ring_get(wq->ring);
1293 wq->ring->nused++;
1296 nfe = oce_ring_get(wq->ring);
1298 wq->ring->nused++;
1302 oce_pkt_put(&wq->pkt_list, pkt);
1304 oce_dma_sync(&wq->ring->dma, BUS_DMASYNC_POSTREAD |
1307 oce_write_db(sc, PD_TXULP_DB, wq->id | (nwqe << 16));
1313 oce_pkt_put(&wq->pkt_free, pkt);
1427 struct oce_wq *wq = (struct oce_wq *)arg;
1428 struct oce_cq *cq = wq->cq;
1430 struct oce_softc *sc = wq->sc;
1436 oce_txeof(wq);
1443 if (wq->ring->nused < (wq->ring->nitems / 2)) {
1448 if (wq->ring->nused == 0)
1456 oce_txeof(struct oce_wq *wq)
1458 struct oce_softc *sc = wq->sc;
1462 if ((pkt = oce_pkt_get(&wq->pkt_list)) == NULL) {
1468 wq->ring->nused -= pkt->nsegs + 1;
1476 oce_pkt_put(&wq->pkt_free, pkt);
1895 struct oce_wq *wq;
1914 OCE_WQ_FOREACH(sc, wq, i) {
1942 struct oce_wq *wq;
1952 OCE_WQ_FOREACH(sc, wq, i) {
1953 if (wq)
1974 struct oce_wq *wq;
1982 wq = malloc(sizeof(struct oce_wq), M_DEVBUF, M_NOWAIT | M_ZERO);
1983 if (!wq)
1986 wq->ring = oce_create_ring(sc, sc->sc_tx_ring_size, NIC_WQE_SIZE, 8);
1987 if (!wq->ring) {
1988 free(wq, M_DEVBUF, 0);
1995 oce_destroy_ring(sc, wq->ring);
1996 free(wq, M_DEVBUF, 0);
2000 wq->id = -1;
2001 wq->sc = sc;
2003 wq->cq = cq;
2004 wq->nitems = sc->sc_tx_ring_size;
2006 SIMPLEQ_INIT(&wq->pkt_free);
2007 SIMPLEQ_INIT(&wq->pkt_list);
2013 oce_destroy_wq(wq);
2016 oce_pkt_put(&wq->pkt_free, pkt);
2019 if (oce_new_wq(sc, wq)) {
2020 oce_destroy_wq(wq);
2026 cq->cb_arg = wq;
2029 return (wq);
2033 oce_drain_wq(struct oce_wq *wq)
2035 struct oce_cq *cq = wq->cq;
2049 oce_destroy_wq(struct oce_wq *wq)
2052 struct oce_softc *sc = wq->sc;
2055 if (wq->id >= 0) {
2057 cmd.params.req.wq_id = htole16(wq->id);
2061 if (wq->cq != NULL)
2062 oce_destroy_cq(wq->cq);
2063 if (wq->ring != NULL)
2064 oce_destroy_ring(sc, wq->ring);
2065 while ((pkt = oce_pkt_get(&wq->pkt_free)) != NULL)
2067 free(wq, M_DEVBUF, 0);
3287 oce_new_wq(struct oce_softc *sc, struct oce_wq *wq)
3294 npages = oce_load_ring(sc, wq->ring, &cmd.params.req.pages[0],
3297 printf("%s: failed to load the wq ring\n", __func__);
3305 cmd.params.req.wq_size = ilog2(wq->nitems) + 1;
3306 cmd.params.req.cq_id = htole16(wq->cq->id);
3315 wq->id = letoh16(cmd.params.rsp.wq_id);