Lines Matching refs:cons_pos
301 unsigned long cons_pos, prod_pos; in ringbuf_avail_data_sz() local
303 cons_pos = smp_load_acquire(&rb->consumer_pos); in ringbuf_avail_data_sz()
305 return prod_pos - cons_pos; in ringbuf_avail_data_sz()
393 unsigned long cons_pos, prod_pos, new_prod_pos, flags; in __bpf_ringbuf_reserve() local
404 cons_pos = smp_load_acquire(&rb->consumer_pos); in __bpf_ringbuf_reserve()
419 if (new_prod_pos - cons_pos > rb->mask) { in __bpf_ringbuf_reserve()
458 unsigned long rec_pos, cons_pos; in bpf_ringbuf_commit() local
476 cons_pos = smp_load_acquire(&rb->consumer_pos) & rb->mask; in bpf_ringbuf_commit()
480 else if (cons_pos == rec_pos && !(flags & BPF_RB_NO_WAKEUP)) in bpf_ringbuf_commit()
647 u64 cons_pos, prod_pos; in __bpf_user_ringbuf_peek() local
655 cons_pos = smp_load_acquire(&rb->consumer_pos); in __bpf_user_ringbuf_peek()
656 if (cons_pos >= prod_pos) in __bpf_user_ringbuf_peek()
659 hdr = (u32 *)((uintptr_t)rb->data + (uintptr_t)(cons_pos & rb->mask)); in __bpf_user_ringbuf_peek()
667 if (total_len > prod_pos - cons_pos) in __bpf_user_ringbuf_peek()
685 smp_store_release(&rb->consumer_pos, cons_pos + total_len); in __bpf_user_ringbuf_peek()
693 (uintptr_t)((cons_pos + BPF_RINGBUF_HDR_SZ) & rb->mask)); in __bpf_user_ringbuf_peek()