Lines Matching refs:kring

41 	struct netmap_kring *kring;  member
108 struct netmap_kring *kring; in ena_netmap_alloc_rx_slot() local
120 kring = na->rx_rings[qid]; in ena_netmap_alloc_rx_slot()
121 nm_i = kring->nr_hwcur; in ena_netmap_alloc_rx_slot()
122 head = kring->rhead; in ena_netmap_alloc_rx_slot()
126 kring->nr_hwcur, kring->nr_hwtail, kring->rhead, kring->rcur, in ena_netmap_alloc_rx_slot()
127 kring->rtail); in ena_netmap_alloc_rx_slot()
135 ring = kring->ring; in ena_netmap_alloc_rx_slot()
162 lim = kring->nkr_num_slots - 1; in ena_netmap_alloc_rx_slot()
163 kring->nr_hwcur = nm_next(nm_i, lim); in ena_netmap_alloc_rx_slot()
173 struct netmap_kring *kring; in ena_netmap_free_rx_slot() local
189 kring = na->rx_rings[qid]; in ena_netmap_free_rx_slot()
190 if (kring == NULL) { in ena_netmap_free_rx_slot()
196 lim = kring->nkr_num_slots - 1; in ena_netmap_free_rx_slot()
197 nm_i = nm_prev(kring->nr_hwcur, lim); in ena_netmap_free_rx_slot()
199 if (kring->nr_mode != NKR_NETMAP_ON) in ena_netmap_free_rx_slot()
206 KASSERT(kring->ring != NULL, ("Netmap Rx ring is NULL\n")); in ena_netmap_free_rx_slot()
208 slot = &kring->ring->slot[nm_i]; in ena_netmap_free_rx_slot()
215 kring->nr_hwcur = nm_i; in ena_netmap_free_rx_slot()
222 struct netmap_kring *kring; in ena_ring_in_netmap() local
226 kring = (x == NR_RX) ? na->rx_rings[qid] : na->tx_rings[qid]; in ena_ring_in_netmap()
227 if (kring->nr_mode == NKR_NETMAP_ON) in ena_ring_in_netmap()
274 struct netmap_kring *kring; in ena_netmap_reg() local
286 kring = NMR(na, t)[i]; in ena_netmap_reg()
287 if (nm_kring_pending_on(kring)) { in ena_netmap_reg()
288 kring->nr_mode = NKR_NETMAP_ON; in ena_netmap_reg()
298 kring = NMR(na, t)[i]; in ena_netmap_reg()
299 if (nm_kring_pending_off(kring)) { in ena_netmap_reg()
300 kring->nr_mode = NKR_NETMAP_OFF; in ena_netmap_reg()
321 ena_netmap_txsync(struct netmap_kring *kring, int flags) in ena_netmap_txsync() argument
326 ena_netmap_fill_ctx(kring, &ctx, ENA_IO_TXQ_IDX(kring->ring_id)); in ena_netmap_txsync()
327 ctx.ring = &ctx.adapter->tx_ring[kring->ring_id]; in ena_netmap_txsync()
350 ctx->nm_i = ctx->kring->nr_hwcur; in ena_netmap_tx_frames()
355 while (ctx->nm_i != ctx->kring->rhead) { in ena_netmap_tx_frames()
373 if (likely(ctx->nm_i != ctx->kring->nr_hwcur)) { in ena_netmap_tx_frames()
378 ctx->kring->nr_hwcur = ctx->nm_i; in ena_netmap_tx_frames()
802 ctx->nm_i = ctx->kring->nr_hwtail; in ena_netmap_tx_cleanup()
818 ctx->kring->nr_hwtail = ctx->nm_i; in ena_netmap_tx_cleanup()
867 ena_netmap_rxsync(struct netmap_kring *kring, int flags) in ena_netmap_rxsync() argument
872 ena_netmap_fill_ctx(kring, &ctx, ENA_IO_RXQ_IDX(kring->ring_id)); in ena_netmap_rxsync()
873 ctx.ring = &ctx.adapter->rx_ring[kring->ring_id]; in ena_netmap_rxsync()
875 if (ctx.kring->rhead > ctx.lim) { in ena_netmap_rxsync()
877 return (netmap_ring_reinit(ctx.kring)); in ena_netmap_rxsync()
901 ctx->nm_i = ctx->kring->nr_hwtail; in ena_netmap_rx_frames()
914 ctx->kring->nr_hwtail = ctx->nm_i; in ena_netmap_rx_frames()
915 ctx->kring->nr_kflags &= ~NKR_PENDINTR; in ena_netmap_rx_frames()
1039 refill_required = ctx->kring->rhead - ctx->kring->nr_hwcur; in ena_netmap_rx_cleanup()
1040 if (ctx->kring->nr_hwcur != ctx->kring->nr_hwtail) in ena_netmap_rx_cleanup()
1046 refill_required += ctx->kring->nkr_num_slots; in ena_netmap_rx_cleanup()
1052 ena_netmap_fill_ctx(struct netmap_kring *kring, struct ena_netmap_ctx *ctx, in ena_netmap_fill_ctx() argument
1055 ctx->kring = kring; in ena_netmap_fill_ctx()
1056 ctx->na = kring->na; in ena_netmap_fill_ctx()
1058 ctx->lim = kring->nkr_num_slots - 1; in ena_netmap_fill_ctx()
1061 ctx->slots = kring->ring->slot; in ena_netmap_fill_ctx()