Lines Matching refs:fifo
41 struct gve_tx_fifo *fifo = &tx->fifo; in gve_tx_fifo_init() local
43 fifo->size = qpl->num_pages * PAGE_SIZE; in gve_tx_fifo_init()
44 fifo->base = qpl->kva; in gve_tx_fifo_init()
45 atomic_store_int(&fifo->available, fifo->size); in gve_tx_fifo_init()
46 fifo->head = 0; in gve_tx_fifo_init()
231 struct gve_tx_fifo *fifo = &tx->fifo; in gve_clear_tx_ring() local
237 atomic_store_int(&fifo->available, fifo->size); in gve_clear_tx_ring()
238 fifo->head = 0; in gve_clear_tx_ring()
372 gve_tx_free_fifo(struct gve_tx_fifo *fifo, size_t bytes) in gve_tx_free_fifo() argument
374 atomic_add_int(&fifo->available, bytes); in gve_tx_free_fifo()
413 gve_tx_free_fifo(&tx->fifo, space_freed); in gve_tx_cleanup_tq()
511 gve_tx_fifo_can_alloc(struct gve_tx_fifo *fifo, size_t bytes) in gve_tx_fifo_can_alloc() argument
513 return (atomic_load_int(&fifo->available) >= bytes); in gve_tx_fifo_can_alloc()
520 gve_tx_fifo_can_alloc(&tx->fifo, bytes_required)); in gve_can_tx()
524 gve_tx_fifo_pad_alloc_one_frag(struct gve_tx_fifo *fifo, size_t bytes) in gve_tx_fifo_pad_alloc_one_frag() argument
526 return (fifo->head + bytes < fifo->size) ? 0 : fifo->size - fifo->head; in gve_tx_fifo_pad_alloc_one_frag()
536 pad_bytes = gve_tx_fifo_pad_alloc_one_frag(&tx->fifo, first_seg_len); in gve_fifo_bytes_required()
545 gve_tx_alloc_fifo(struct gve_tx_fifo *fifo, size_t bytes, in gve_tx_alloc_fifo() argument
562 KASSERT(gve_tx_fifo_can_alloc(fifo, bytes), in gve_tx_alloc_fifo()
567 iov[0].iov_offset = fifo->head; in gve_tx_alloc_fifo()
569 fifo->head += bytes; in gve_tx_alloc_fifo()
571 if (fifo->head > fifo->size) { in gve_tx_alloc_fifo()
577 overflow = fifo->head - fifo->size; in gve_tx_alloc_fifo()
582 fifo->head = overflow; in gve_tx_alloc_fifo()
586 aligned_head = roundup2(fifo->head, CACHE_LINE_SIZE); in gve_tx_alloc_fifo()
587 padding = aligned_head - fifo->head; in gve_tx_alloc_fifo()
589 atomic_add_int(&fifo->available, -(bytes + padding)); in gve_tx_alloc_fifo()
590 fifo->head = aligned_head; in gve_tx_alloc_fifo()
592 if (fifo->head == fifo->size) in gve_tx_alloc_fifo()
593 fifo->head = 0; in gve_tx_alloc_fifo()
692 pad_bytes = gve_tx_fifo_pad_alloc_one_frag(&tx->fifo, first_seg_len); in gve_xmit()
693 hdr_nfrags = gve_tx_alloc_fifo(&tx->fifo, first_seg_len + pad_bytes, in gve_xmit()
696 payload_nfrags = gve_tx_alloc_fifo(&tx->fifo, pkt_len - first_seg_len, in gve_xmit()
706 (char *)tx->fifo.base + info->iov[hdr_nfrags - 1].iov_offset); in gve_xmit()
726 (char *)tx->fifo.base + info->iov[i].iov_offset); in gve_xmit()