Lines Matching +full:ulp +full:- +full:0

1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
18 * - The driver indices are always masked off to q->index_mask
20 * - The user whether user space or kernel is generally
23 * - The driver indices for queues must not be written
26 * - By passing the type in the parameter list separate from q
30 * - These queues are lock free. The user and driver must protect
36 * enum queue_type - type of queue
39 * application or a kernel ulp.
44 * @QUEUE_TYPE_FROM_ULP: Queue is written by kernel ulp and
49 * read by kernel ulp.
97 return (index + 1) & q->index_mask; in queue_next_index()
108 prod = smp_load_acquire(&q->buf->producer_index); in queue_get_producer()
112 prod = q->index; in queue_get_producer()
115 /* used by ulp which owns the index */ in queue_get_producer()
116 prod = q->buf->producer_index; in queue_get_producer()
119 /* used by ulp, rxe owns the index */ in queue_get_producer()
120 prod = smp_load_acquire(&q->buf->producer_index); in queue_get_producer()
135 cons = q->index; in queue_get_consumer()
139 cons = smp_load_acquire(&q->buf->consumer_index); in queue_get_consumer()
142 /* used by ulp, rxe owns the index */ in queue_get_consumer()
143 cons = smp_load_acquire(&q->buf->consumer_index); in queue_get_consumer()
146 /* used by ulp which owns the index */ in queue_get_consumer()
147 cons = q->buf->consumer_index; in queue_get_consumer()
159 return ((prod - cons) & q->index_mask) == 0; in queue_empty()
167 return ((prod + 1 - cons) & q->index_mask) == 0; in queue_full()
176 return (prod - cons) & q->index_mask; in queue_count()
193 prod = q->index; in queue_advance_producer()
194 prod = (prod + 1) & q->index_mask; in queue_advance_producer()
195 q->index = prod; in queue_advance_producer()
197 smp_store_release(&q->buf->producer_index, prod); in queue_advance_producer()
200 /* used by ulp which owns the index */ in queue_advance_producer()
201 prod = q->buf->producer_index; in queue_advance_producer()
202 prod = (prod + 1) & q->index_mask; in queue_advance_producer()
204 smp_store_release(&q->buf->producer_index, prod); in queue_advance_producer()
207 /* used by ulp, rxe owns the index */ in queue_advance_producer()
223 cons = (q->index + 1) & q->index_mask; in queue_advance_consumer()
224 q->index = cons; in queue_advance_consumer()
226 smp_store_release(&q->buf->consumer_index, cons); in queue_advance_consumer()
235 /* used by ulp, rxe owns the index */ in queue_advance_consumer()
241 /* used by ulp which owns the index */ in queue_advance_consumer()
242 cons = q->buf->consumer_index; in queue_advance_consumer()
243 cons = (cons + 1) & q->index_mask; in queue_advance_consumer()
245 smp_store_release(&q->buf->consumer_index, cons); in queue_advance_consumer()
255 return q->buf->data + (prod << q->log2_elem_size); in queue_producer_addr()
263 return q->buf->data + (cons << q->log2_elem_size); in queue_consumer_addr()
268 return q->buf->data + ((index & q->index_mask) in queue_addr_from_index()
269 << q->log2_elem_size); in queue_addr_from_index()
275 return (((u8 *)addr - q->buf->data) >> q->log2_elem_size) in queue_index_from_addr()
276 & q->index_mask; in queue_index_from_addr()