Lines Matching refs:cq

78 static void oce_cq_del(POCE_SOFTC sc, struct oce_cq *cq);
314 struct oce_cq *cq;
318 cq = oce_cq_create(sc,
322 if (!cq)
325 wq->cq = cq;
336 eq->cq[eq->cq_valid] = cq;
338 cq->cb_arg = wq;
339 cq->cq_handler = oce_wq_handler;
370 if (wq->cq != NULL) {
371 oce_cq_del(sc, wq->cq);
372 wq->cq = NULL;
490 struct oce_cq *cq;
492 cq = oce_cq_create(sc, eq,
496 if (!cq)
499 rq->cq = cq;
506 eq->cq[eq->cq_valid] = cq;
508 cq->cb_arg = rq;
509 cq->cq_handler = oce_rq_handler;
542 if (rq->cq != NULL) {
543 oce_cq_del(sc, rq->cq);
544 rq->cq = NULL;
636 struct oce_cq *cq;
641 cq = oce_cq_create(sc, eq, CQ_LEN_256,
643 if (!cq)
649 oce_cq_del(sc, cq);
677 ctx->v1.cq_id = cq->cq_id;
679 ctx->v1.async_cq_id = cq->cq_id;
689 ctx->v0.cq_id = cq->cq_id;
709 mq->cq = cq;
710 eq->cq[eq->cq_valid] = cq;
712 mq->cq->eq = eq;
717 mq->cq->cb_arg = mq;
718 mq->cq->cq_handler = oce_mq_handler;
757 if (mq->cq != NULL) {
758 oce_cq_del(sc, mq->cq);
759 mq->cq = NULL;
829 * @param eq optional eq to be associated with to the cq
836 * @returns pointer to the cq created, NULL on failure
846 struct oce_cq *cq = NULL;
849 cq = malloc(sizeof(struct oce_cq), M_DEVBUF, M_NOWAIT | M_ZERO);
850 if (!cq)
853 cq->ring = oce_create_ring_buffer(sc, q_len, item_size);
854 if (!cq->ring)
857 cq->parent = sc;
858 cq->eq = eq;
859 cq->cq_cfg.q_len = q_len;
860 cq->cq_cfg.item_size = item_size;
861 cq->cq_cfg.nodelay = (uint8_t) nodelay;
863 rc = oce_mbox_cq_create(cq, ncoalesce, is_eventable);
867 sc->cq[sc->ncqs++] = cq;
869 return cq;
873 oce_cq_del(sc, cq);
880 * @param cq pointer to a completion queue
883 oce_cq_del(POCE_SOFTC sc, struct oce_cq *cq)
888 if (cq->ring != NULL) {
892 fwcmd->params.req.id = cq->cq_id;
896 oce_destroy_ring_buffer(sc, cq->ring);
897 cq->ring = NULL;
900 free(cq, M_DEVBUF);
901 cq = NULL;
920 oce_arm_cq(rq->parent, rq->cq->cq_id, 0, TRUE);
932 oce_arm_cq(wq->parent, wq->cq->cq_id, 0, TRUE);
943 oce_arm_cq(mq->parent, mq->cq->cq_id, 0, TRUE);
1023 struct oce_cq *cq = wq->cq;
1027 bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map,
1031 cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_tx_cqe);
1035 bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map,
1037 RING_GET(cq->ring, 1);
1042 oce_arm_cq(sc, cq->cq_id, num_cqes, FALSE);
1049 * @param cq pointer to the cq to drain
1069 struct oce_cq *cq;
1073 cq = rq->cq;
1074 cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_rx_cqe);
1078 RING_GET(cq->ring, 1);
1079 cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring,
1083 oce_arm_cq(sc, cq->cq_id, num_cqe, FALSE);
1111 struct oce_cq *cq = rq->cq;
1120 bus_dmamap_sync(cq->ring->dma.tag,cq->ring->dma.map, BUS_DMASYNC_POSTWRITE);
1121 cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct nic_hwlro_singleton_cqe);
1137 RING_GET(cq->ring, 1);
1145 RING_GET(cq->ring, 1);
1163 RING_GET(cq->ring, 1);
1165 oce_arm_cq(sc, cq->cq_id, 1, FALSE);
1173 oce_arm_cq(sc, cq->cq_id, 0, TRUE);
1179 oce_arm_cq(sc, cq->cq_id, 0, FALSE);
1189 struct oce_cq *cq;
1194 cq = rq->cq;
1197 bus_dmamap_sync(cq->ring->dma.tag,
1198 cq->ring->dma.map, BUS_DMASYNC_POSTWRITE);
1199 cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_rx_cqe);
1208 RING_GET(cq->ring, 1);
1213 oce_arm_cq(sc, cq->cq_id, 1, FALSE);
1221 oce_arm_cq(sc, cq->cq_id, 0, TRUE);
1227 oce_arm_cq(sc, cq->cq_id, 0, FALSE);