Lines Matching refs:ring
161 struct netmap_ring *ring = s->tx;
162 unsigned int tail = ring->tail;
170 last = i = ring->head;
172 if (nm_ring_space(ring) < iovcnt) {
176 * (e.g., we don't advance ring->head). */
177 ring->cur = tail;
192 nm_frag_size = MIN(iov_frag_size, ring->nr_buf_size);
197 ring->cur = tail;
202 idx = ring->slot[i].buf_idx;
203 dst = (uint8_t *)NETMAP_BUF(ring, idx);
205 ring->slot[i].len = nm_frag_size;
206 ring->slot[i].flags = NS_MOREFRAG;
210 i = nm_ring_next(ring, i);
217 ring->slot[last].flags &= ~NS_MOREFRAG;
219 /* Now update ring->head and ring->cur to publish the new slots and
221 ring->head = ring->cur = i;
251 struct netmap_ring *ring = s->rx;
252 unsigned int tail = ring->tail;
255 RX ring and the forwarding path towards the peer is open. */
256 while (ring->head != tail) {
257 uint32_t i = ring->head;
265 idx = ring->slot[i].buf_idx;
266 morefrag = (ring->slot[i].flags & NS_MOREFRAG);
267 s->iov[iovcnt].iov_base = (void *)NETMAP_BUF(ring, idx);
268 s->iov[iovcnt].iov_len = ring->slot[i].len;
270 i = nm_ring_next(ring, i);
273 /* Advance ring->cur to tell the kernel that we have seen the slots. */
274 ring->cur = i;
278 * incomplete slots by updating ring->head. We will hopefully
287 ring->head = i;