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()
439 static u32 hv_pkt_iter_avail(const struct hv_ring_buffer_info *rbi) in hv_pkt_iter_avail() argument
441 u32 priv_read_loc = rbi->priv_read_index; in hv_pkt_iter_avail()
442 u32 write_loc = READ_ONCE(rbi->ring_buffer->write_index); in hv_pkt_iter_avail()
447 return (rbi->ring_datasize - priv_read_loc) + write_loc; in hv_pkt_iter_avail()
455 struct hv_ring_buffer_info *rbi = &channel->inbound; in hv_pkt_iter_first_raw() local
459 if (hv_pkt_iter_avail(rbi) < sizeof(struct vmpacket_descriptor)) in hv_pkt_iter_first_raw()
462 return (struct vmpacket_descriptor *)(hv_get_ring_buffer(rbi) + rbi->priv_read_index); in hv_pkt_iter_first_raw()
473 struct hv_ring_buffer_info *rbi = &channel->inbound; in hv_pkt_iter_first() local
481 bytes_avail = min(rbi->pkt_buffer_size, hv_pkt_iter_avail(rbi)); in hv_pkt_iter_first()
505 desc_copy = (struct vmpacket_descriptor *)rbi->pkt_buffer; in hv_pkt_iter_first()
531 struct hv_ring_buffer_info *rbi = &channel->inbound; in __hv_pkt_iter_next() local
533 u32 dsize = rbi->ring_datasize; in __hv_pkt_iter_next()
537 rbi->priv_read_index += packetlen + VMBUS_PKT_TRAILER; in __hv_pkt_iter_next()
538 if (rbi->priv_read_index >= dsize) in __hv_pkt_iter_next()
539 rbi->priv_read_index -= dsize; in __hv_pkt_iter_next()
547 static u32 hv_pkt_iter_bytes_read(const struct hv_ring_buffer_info *rbi, in hv_pkt_iter_bytes_read() argument
550 if (rbi->priv_read_index >= start_read_index) in hv_pkt_iter_bytes_read()
551 return rbi->priv_read_index - start_read_index; in hv_pkt_iter_bytes_read()
553 return rbi->ring_datasize - start_read_index + in hv_pkt_iter_bytes_read()
554 rbi->priv_read_index; in hv_pkt_iter_bytes_read()
579 struct hv_ring_buffer_info *rbi = &channel->inbound; in hv_pkt_iter_close() local
588 start_read_index = rbi->ring_buffer->read_index; in hv_pkt_iter_close()
589 rbi->ring_buffer->read_index = rbi->priv_read_index; in hv_pkt_iter_close()
596 if (!rbi->ring_buffer->feature_bits.feat_pending_send_sz) in hv_pkt_iter_close()
615 pending_sz = READ_ONCE(rbi->ring_buffer->pending_send_sz); in hv_pkt_iter_close()
624 curr_write_sz = hv_get_bytes_to_write(rbi); in hv_pkt_iter_close()
625 bytes_read = hv_pkt_iter_bytes_read(rbi, start_read_index); in hv_pkt_iter_close()