Lines Matching refs:rbi

54 	struct hv_ring_buffer_info *rbi = &channel->outbound;  in hv_signal_on_write()  local
57 if (READ_ONCE(rbi->ring_buffer->interrupt_mask)) in hv_signal_on_write()
66 if (old_write == READ_ONCE(rbi->ring_buffer->read_index)) { in hv_signal_on_write()
133 hv_get_ringbuffer_availbytes(const struct hv_ring_buffer_info *rbi, in hv_get_ringbuffer_availbytes() argument
139 read_loc = READ_ONCE(rbi->ring_buffer->read_index); in hv_get_ringbuffer_availbytes()
140 write_loc = READ_ONCE(rbi->ring_buffer->write_index); in hv_get_ringbuffer_availbytes()
141 dsize = rbi->ring_datasize; in hv_get_ringbuffer_availbytes()
438 static u32 hv_pkt_iter_avail(const struct hv_ring_buffer_info *rbi) in hv_pkt_iter_avail() argument
440 u32 priv_read_loc = rbi->priv_read_index; in hv_pkt_iter_avail()
450 write_loc = virt_load_acquire(&rbi->ring_buffer->write_index); in hv_pkt_iter_avail()
455 return (rbi->ring_datasize - priv_read_loc) + write_loc; in hv_pkt_iter_avail()
465 struct hv_ring_buffer_info *rbi = &channel->inbound; in hv_pkt_iter_first() local
471 bytes_avail = hv_pkt_iter_avail(rbi); in hv_pkt_iter_first()
474 bytes_avail = min(rbi->pkt_buffer_size, bytes_avail); in hv_pkt_iter_first()
476 desc = (struct vmpacket_descriptor *)(hv_get_ring_buffer(rbi) + rbi->priv_read_index); in hv_pkt_iter_first()
500 desc_copy = (struct vmpacket_descriptor *)rbi->pkt_buffer; in hv_pkt_iter_first()
525 struct hv_ring_buffer_info *rbi = &channel->inbound; in __hv_pkt_iter_next() local
527 u32 dsize = rbi->ring_datasize; in __hv_pkt_iter_next()
531 rbi->priv_read_index += packetlen + VMBUS_PKT_TRAILER; in __hv_pkt_iter_next()
532 if (rbi->priv_read_index >= dsize) in __hv_pkt_iter_next()
533 rbi->priv_read_index -= dsize; in __hv_pkt_iter_next()
541 static u32 hv_pkt_iter_bytes_read(const struct hv_ring_buffer_info *rbi, in hv_pkt_iter_bytes_read() argument
544 if (rbi->priv_read_index >= start_read_index) in hv_pkt_iter_bytes_read()
545 return rbi->priv_read_index - start_read_index; in hv_pkt_iter_bytes_read()
547 return rbi->ring_datasize - start_read_index + in hv_pkt_iter_bytes_read()
548 rbi->priv_read_index; in hv_pkt_iter_bytes_read()
573 struct hv_ring_buffer_info *rbi = &channel->inbound; in hv_pkt_iter_close() local
582 start_read_index = rbi->ring_buffer->read_index; in hv_pkt_iter_close()
583 rbi->ring_buffer->read_index = rbi->priv_read_index; in hv_pkt_iter_close()
590 if (!rbi->ring_buffer->feature_bits.feat_pending_send_sz) in hv_pkt_iter_close()
609 pending_sz = READ_ONCE(rbi->ring_buffer->pending_send_sz); in hv_pkt_iter_close()
618 curr_write_sz = hv_get_bytes_to_write(rbi); in hv_pkt_iter_close()
619 bytes_read = hv_pkt_iter_bytes_read(rbi, start_read_index); in hv_pkt_iter_close()