Lines Matching full:fifo
41 struct gve_tx_fifo *fifo = &tx->fifo;
43 fifo->size = qpl->num_pages * PAGE_SIZE;
44 fifo->base = qpl->kva;
45 atomic_store_int(&fifo->available, fifo->size);
46 fifo->head = 0;
230 struct gve_tx_fifo *fifo = &tx->fifo;
236 atomic_store_int(&fifo->available, fifo->size);
237 fifo->head = 0;
373 gve_tx_free_fifo(struct gve_tx_fifo *fifo, size_t bytes)
375 atomic_add_int(&fifo->available, bytes);
414 gve_tx_free_fifo(&tx->fifo, space_freed);
512 gve_tx_fifo_can_alloc(struct gve_tx_fifo *fifo, size_t bytes)
514 return (atomic_load_int(&fifo->available) >= bytes);
521 gve_tx_fifo_can_alloc(&tx->fifo, bytes_required));
525 gve_tx_fifo_pad_alloc_one_frag(struct gve_tx_fifo *fifo, size_t bytes)
527 return (fifo->head + bytes < fifo->size) ? 0 : fifo->size - fifo->head;
537 pad_bytes = gve_tx_fifo_pad_alloc_one_frag(&tx->fifo, first_seg_len);
546 gve_tx_alloc_fifo(struct gve_tx_fifo *fifo, size_t bytes,
559 * because the FIFO head always start aligned, and the FIFO's boundaries
563 KASSERT(gve_tx_fifo_can_alloc(fifo, bytes),
564 ("Allocating gve tx fifo when there is no room"));
568 iov[0].iov_offset = fifo->head;
570 fifo->head += bytes;
572 if (fifo->head > fifo->size) {
575 * FIFO, also use the head fragment.
578 overflow = fifo->head - fifo->size;
580 iov[1].iov_offset = 0; /* Start of fifo*/
583 fifo->head = overflow;
587 aligned_head = roundup2(fifo->head, CACHE_LINE_SIZE);
588 padding = aligned_head - fifo->head;
590 atomic_add_int(&fifo->available, -(bytes + padding));
591 fifo->head = aligned_head;
593 if (fifo->head == fifo->size)
594 fifo->head = 0;
599 /* Only error this returns is ENOBUFS when the tx fifo is short of space */
691 * of the fifo and then put the header at the beginning of the fifo.
693 pad_bytes = gve_tx_fifo_pad_alloc_one_frag(&tx->fifo, first_seg_len);
694 hdr_nfrags = gve_tx_alloc_fifo(&tx->fifo, first_seg_len + pad_bytes,
697 payload_nfrags = gve_tx_alloc_fifo(&tx->fifo, pkt_len - first_seg_len,
707 (char *)tx->fifo.base + info->iov[hdr_nfrags - 1].iov_offset);
727 (char *)tx->fifo.base + info->iov[i].iov_offset);