Home
last modified time | relevance | path

Searched refs:ring_size (Results 1 – 25 of 221) sorted by relevance

123456789

/openbmc/linux/tools/virtio/ringtest/
H A Dvirtio_ring_0_9.c75 memset(p, 0, vring_size(ring_size, 0x1000)); in alloc_ring()
76 vring_init(&ring, ring_size, p, 0x1000); in alloc_ring()
85 for (i = 0; i < ring_size - 1; i++) in alloc_ring()
89 guest.num_free = ring_size; in alloc_ring()
90 data = malloc(ring_size * sizeof *data); in alloc_ring()
95 memset(data, 0, ring_size * sizeof *data); in alloc_ring()
136 ring.avail->ring[avail & (ring_size - 1)] = in add_inbuf()
165 index &= ring_size - 1; in get_buf()
283 used_idx &= ring_size - 1; in use_buf()
284 desc = &ring.desc[head & (ring_size - 1)]; in use_buf()
[all …]
H A Dring.c82 ret = posix_memalign((void **)&ring, 0x1000, ring_size * sizeof *ring); in alloc_ring()
97 for (i = 0; i < ring_size; ++i) { in alloc_ring()
103 guest.num_free = ring_size; in alloc_ring()
104 data = calloc(ring_size, sizeof(*data)); in alloc_ring()
120 head = (ring_size - 1) & (guest.avail_idx++); in add_inbuf()
145 unsigned head = (ring_size - 1) & guest.last_used_idx; in get_buf()
154 index = ring[head].index & (ring_size - 1); in get_buf()
166 unsigned head = (ring_size - 1) & guest.last_used_idx; in used_empty()
221 unsigned head = (ring_size - 1) & host.used_idx; in avail_empty()
228 unsigned head = (ring_size - 1) & host.used_idx; in use_buf()
H A Dmain.c29 unsigned ring_size = 256; variable
288 ring_size, in help()
322 ring_size = strtol(optarg, &endptr, 0); in main()
323 assert(ring_size && !(ring_size & (ring_size - 1))); in main()
/openbmc/linux/include/xen/interface/io/
H A Dring.h357 static inline RING_IDX name##_mask(RING_IDX idx, RING_IDX ring_size) \
359 return idx & (ring_size - 1); \
364 RING_IDX ring_size) \
366 return buf + name##_mask(idx, ring_size); \
374 RING_IDX ring_size) \
377 size <= ring_size - *masked_cons) { \
380 memcpy(opaque, buf + *masked_cons, ring_size - *masked_cons); \
381 memcpy((unsigned char *)opaque + ring_size - *masked_cons, buf, \
382 size - (ring_size - *masked_cons)); \
384 *masked_cons = name##_mask(*masked_cons + size, ring_size); \
[all …]
/openbmc/qemu/include/hw/xen/interface/io/
H A Dring.h396 static inline RING_IDX name##_mask(RING_IDX idx, RING_IDX ring_size) \
398 return idx & (ring_size - 1); \
403 RING_IDX ring_size) \
405 return buf + name##_mask(idx, ring_size); \
413 RING_IDX ring_size) \
416 size <= ring_size - *masked_cons) { \
419 memcpy(opaque, buf + *masked_cons, ring_size - *masked_cons); \
420 memcpy((unsigned char *)opaque + ring_size - *masked_cons, buf, \
421 size - (ring_size - *masked_cons)); \
423 *masked_cons = name##_mask(*masked_cons + size, ring_size); \
[all …]
/openbmc/linux/drivers/gpu/drm/amd/amdgpu/
H A Damdgpu_ih.c42 unsigned ring_size, bool use_bus_addr) in amdgpu_ih_ring_init() argument
48 rb_bufsz = order_base_2(ring_size / 4); in amdgpu_ih_ring_init()
49 ring_size = (1 << rb_bufsz) * 4; in amdgpu_ih_ring_init()
50 ih->ring_size = ring_size; in amdgpu_ih_ring_init()
51 ih->ptr_mask = ih->ring_size - 1; in amdgpu_ih_ring_init()
64 ih->ring = dma_alloc_coherent(adev->dev, ih->ring_size + 8, in amdgpu_ih_ring_init()
70 ih->wptr_addr = dma_addr + ih->ring_size; in amdgpu_ih_ring_init()
71 ih->wptr_cpu = &ih->ring[ih->ring_size / 4]; in amdgpu_ih_ring_init()
72 ih->rptr_addr = dma_addr + ih->ring_size + 4; in amdgpu_ih_ring_init()
73 ih->rptr_cpu = &ih->ring[(ih->ring_size / 4) + 1]; in amdgpu_ih_ring_init()
[all …]
H A Dnavi10_ih.c53 if (adev->irq.ih.ring_size) { in navi10_ih_init_register_offset()
66 if (adev->irq.ih1.ring_size) { in navi10_ih_init_register_offset()
77 if (adev->irq.ih2.ring_size) { in navi10_ih_init_register_offset()
203 if (ih[i]->ring_size) { in navi10_ih_toggle_interrupts()
215 int rb_bufsz = order_base_2(ih->ring_size / 4); in navi10_ih_rb_cntl()
353 if (ih[i]->ring_size) { in navi10_ih_irq_init()
373 if (adev->irq.ih_soft.ring_size) in navi10_ih_irq_init()
474 if ((v < ih->ring_size) && (v != ih->rptr)) in navi10_ih_irq_rearm()
581 adev->irq.ih1.ring_size = 0; in navi10_ih_sw_init()
582 adev->irq.ih2.ring_size = 0; in navi10_ih_sw_init()
H A Dih_v6_1.c52 if (adev->irq.ih.ring_size) { in ih_v6_1_init_register_offset()
65 if (adev->irq.ih1.ring_size) { in ih_v6_1_init_register_offset()
177 if (ih[i]->ring_size) { in ih_v6_1_toggle_interrupts()
189 int rb_bufsz = order_base_2(ih->ring_size / 4); in ih_v6_1_rb_cntl()
319 if (ih[i]->ring_size) { in ih_v6_1_irq_init()
358 if (adev->irq.ih_soft.ring_size) in ih_v6_1_irq_init()
451 if ((v < ih->ring_size) && (v != ih->rptr)) in ih_v6_1_irq_rearm()
553 adev->irq.ih1.ring_size = 0; in ih_v6_1_sw_init()
554 adev->irq.ih2.ring_size = 0; in ih_v6_1_sw_init()
H A Dih_v6_0.c52 if (adev->irq.ih.ring_size) { in ih_v6_0_init_register_offset()
65 if (adev->irq.ih1.ring_size) { in ih_v6_0_init_register_offset()
205 if (ih[i]->ring_size) { in ih_v6_0_toggle_interrupts()
217 int rb_bufsz = order_base_2(ih->ring_size / 4); in ih_v6_0_rb_cntl()
347 if (ih[i]->ring_size) { in ih_v6_0_irq_init()
386 if (adev->irq.ih_soft.ring_size) in ih_v6_0_irq_init()
478 if ((v < ih->ring_size) && (v != ih->rptr)) in ih_v6_0_irq_rearm()
580 adev->irq.ih1.ring_size = 0; in ih_v6_0_sw_init()
581 adev->irq.ih2.ring_size = 0; in ih_v6_0_sw_init()
H A Dvega10_ih.c51 if (adev->irq.ih.ring_size) { in vega10_ih_init_register_offset()
64 if (adev->irq.ih1.ring_size) { in vega10_ih_init_register_offset()
75 if (adev->irq.ih2.ring_size) { in vega10_ih_init_register_offset()
148 if (ih[i]->ring_size) { in vega10_ih_toggle_interrupts()
160 int rb_bufsz = order_base_2(ih->ring_size / 4); in vega10_ih_rb_cntl()
285 if (ih[i]->ring_size) { in vega10_ih_irq_init()
303 if (adev->irq.ih_soft.ring_size) in vega10_ih_irq_init()
404 if ((v < ih->ring_size) && (v != ih->rptr)) in vega10_ih_irq_rearm()
H A Dvega20_ih.c59 if (adev->irq.ih.ring_size) { in vega20_ih_init_register_offset()
72 if (adev->irq.ih1.ring_size) { in vega20_ih_init_register_offset()
83 if (adev->irq.ih2.ring_size) { in vega20_ih_init_register_offset()
157 if (ih[i]->ring_size) { in vega20_ih_toggle_interrupts()
169 int rb_bufsz = order_base_2(ih->ring_size / 4); in vega20_ih_rb_cntl()
318 if (ih[i]->ring_size) { in vega20_ih_irq_init()
351 if (adev->irq.ih_soft.ring_size) in vega20_ih_irq_init()
453 if ((v < ih->ring_size) && (v != ih->rptr)) in vega20_ih_irq_rearm()
/openbmc/linux/drivers/crypto/ccp/
H A Dtee-dev.c25 static int tee_alloc_ring(struct psp_tee_device *tee, int ring_size) in tee_alloc_ring() argument
30 if (!ring_size) in tee_alloc_ring()
36 start_addr = (void *)__get_free_pages(GFP_KERNEL, get_order(ring_size)); in tee_alloc_ring()
40 memset(start_addr, 0x0, ring_size); in tee_alloc_ring()
42 rb_mgr->ring_size = ring_size; in tee_alloc_ring()
57 get_order(rb_mgr->ring_size)); in tee_free_ring()
60 rb_mgr->ring_size = 0; in tee_free_ring()
96 cmd->size = tee->rb_mgr.ring_size; in tee_alloc_cmd_buffer()
111 int ring_size = MAX_RING_BUFFER_ENTRIES * sizeof(struct tee_ring_cmd); in tee_init_ring() local
119 ret = tee_alloc_ring(tee, ring_size); in tee_init_ring()
[all …]
/openbmc/linux/drivers/gpu/drm/radeon/
H A Dradeon_ring.c86 ring->ring_free_dw = rptr + (ring->ring_size / 4); in radeon_ring_free_size()
91 ring->ring_free_dw = ring->ring_size / 4; in radeon_ring_free_size()
112 if (ndw > (ring->ring_size / 4)) in radeon_ring_alloc()
314 size = ring->wptr + (ring->ring_size / 4); in radeon_ring_backup()
381 int radeon_ring_init(struct radeon_device *rdev, struct radeon_ring *ring, unsigned ring_size, in radeon_ring_init() argument
386 ring->ring_size = ring_size; in radeon_ring_init()
392 r = radeon_bo_create(rdev, ring->ring_size, PAGE_SIZE, true, in radeon_ring_init()
417 ring->ptr_mask = (ring->ring_size / 4) - 1; in radeon_ring_init()
418 ring->ring_free_dw = ring->ring_size / 4; in radeon_ring_init()
474 count = (ring->ring_size / 4) - ring->ring_free_dw; in radeon_debugfs_ring_info_show()
/openbmc/linux/drivers/xen/
H A Devtchn.c67 unsigned int ring_size; member
99 return idx & (u->ring_size - 1); in evtchn_ring_offset()
183 if ((prod - cons) < u->ring_size) { in evtchn_interrupt()
240 if (((c ^ p) & u->ring_size) != 0) { in evtchn_read()
241 bytes1 = (u->ring_size - evtchn_ring_offset(u, c)) * in evtchn_read()
327 if (u->nr_evtchns <= u->ring_size) in evtchn_resize_ring()
330 if (u->ring_size == 0) in evtchn_resize_ring()
333 new_size = 2 * u->ring_size; in evtchn_resize_ring()
360 memcpy(new_ring + u->ring_size, old_ring, in evtchn_resize_ring()
361 u->ring_size * sizeof(*u->ring)); in evtchn_resize_ring()
[all …]
/openbmc/linux/drivers/net/ethernet/amazon/ena/
H A Dena_netdev.h88 #define ENA_TX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1)) argument
90 #define ENA_RX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1)) argument
91 #define ENA_RX_RING_IDX_ADD(idx, n, ring_size) \ argument
92 (((idx) + (n)) & ((ring_size) - 1))
261 int ring_size; member
/openbmc/linux/drivers/bus/mhi/ep/
H A Dring.c26 ring->rd_offset = (ring->rd_offset + 1) % ring->ring_size; in mhi_ep_ring_inc_index()
55 buf_info.size = (ring->ring_size - start) * sizeof(struct mhi_ring_element); in __mhi_ep_cache_ring()
125 num_free_elem = ((ring->ring_size - ring->rd_offset) + ring->wr_offset) - 1; in mhi_ep_ring_add_element()
174 ring->ring_size = mhi_ep_ring_num_elems(ring); in mhi_ep_ring_start()
190 ring->ring_cache = kcalloc(ring->ring_size, sizeof(struct mhi_ring_element), GFP_KERNEL); in mhi_ep_ring_start()
/openbmc/linux/drivers/net/ethernet/renesas/
H A Drswitch.c206 if (index + num >= gq->ring_size) in rswitch_next_queue_index()
207 index = (index + num) % gq->ring_size; in rswitch_next_queue_index()
270 for (i = 0; i < gq->ring_size; i++) in rswitch_gwca_queue_free()
296 bool dir_tx, int ring_size) in rswitch_gwca_queue_alloc() argument
301 gq->ring_size = ring_size; in rswitch_gwca_queue_alloc()
353 int ring_size = sizeof(struct rswitch_ext_desc) * gq->ring_size; in rswitch_gwca_queue_format() local
359 memset(gq->tx_ring, 0, ring_size); in rswitch_gwca_queue_format()
462 int ring_size = sizeof(struct rswitch_ext_ts_desc) * gq->ring_size; in rswitch_gwca_queue_ext_ts_format() local
467 memset(gq->rx_ring, 0, ring_size); in rswitch_gwca_queue_ext_ts_format()
519 gq->ring_size = TS_RING_SIZE; in rswitch_gwca_ts_queue_alloc()
[all …]
/openbmc/linux/drivers/crypto/intel/qat/qat_common/
H A Dadf_transport.c93 ADF_MAX_INFLIGHTS(ring->ring_size, ring->msg_size)) { in adf_send_message()
103 ADF_RING_SIZE_MODULO(ring->ring_size)); in adf_send_message()
124 ADF_RING_SIZE_MODULO(ring->ring_size)); in adf_handle_response()
139 u32 ring_config = BUILD_RING_CONFIG(ring->ring_size); in adf_configure_tx_ring()
151 BUILD_RESP_RING_CONFIG(ring->ring_size, in adf_configure_rx_ring()
168 ADF_SIZE_TO_RING_SIZE_IN_BYTES(ring->ring_size); in adf_init_ring()
194 ring->ring_size); in adf_init_ring()
206 ADF_SIZE_TO_RING_SIZE_IN_BYTES(ring->ring_size); in adf_cleanup_ring()
272 ring->ring_size = adf_verify_ring_size(msg_size, num_msgs); in adf_create_ring()
275 max_inflights = ADF_MAX_INFLIGHTS(ring->ring_size, ring->msg_size); in adf_create_ring()
/openbmc/linux/tools/testing/selftests/bpf/progs/
H A Dtest_ringbuf.c32 long ring_size = 0; variable
72 ring_size = bpf_ringbuf_query(&ringbuf, BPF_RB_RING_SIZE); in test_ringbuf()
/openbmc/linux/include/linux/
H A Dpipe_fs_i.h64 unsigned int ring_size; member
183 return &pipe->bufs[slot & (pipe->ring_size - 1)]; in pipe_buf()
251 unsigned int mask = pipe->ring_size - 1; in pipe_discard_from()
/openbmc/linux/arch/powerpc/platforms/pasemi/
H A Ddma_lib.c242 int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size) in pasemi_dma_alloc_ring() argument
246 chan->ring_size = ring_size; in pasemi_dma_alloc_ring()
249 ring_size * sizeof(u64), in pasemi_dma_alloc_ring()
268 dma_free_coherent(&dma_pdev->dev, chan->ring_size * sizeof(u64), in pasemi_dma_free_ring()
271 chan->ring_size = 0; in pasemi_dma_free_ring()
/openbmc/linux/drivers/net/ethernet/atheros/
H A Dag71xx.c795 int ring_mask, ring_size; in ag71xx_tx_packets() local
799 ring_size = BIT(ring->order); in ag71xx_tx_packets()
1174 int ring_size = BIT(ring->order); in ag71xx_ring_tx_init() local
1175 int ring_mask = ring_size - 1; in ag71xx_ring_tx_init()
1178 for (i = 0; i < ring_size; i++) { in ag71xx_ring_tx_init()
1199 int ring_size = BIT(ring->order); in ag71xx_ring_rx_clean() local
1205 for (i = 0; i < ring_size; i++) in ag71xx_ring_rx_clean()
1319 int ring_size, tx_size; in ag71xx_rings_init() local
1349 int ring_size; in ag71xx_rings_free() local
1526 ring_size = BIT(ring->order); in ag71xx_hard_start_xmit()
[all …]
/openbmc/linux/io_uring/
H A Dkbuf.c552 size_t ring_size) in io_lookup_buf_free_entry() argument
560 if (ibf->inuse || ibf->size < ring_size) in io_lookup_buf_free_entry()
562 dist = ibf->size - ring_size; in io_lookup_buf_free_entry()
579 size_t ring_size; in io_alloc_pbuf_ring() local
582 ring_size = reg->ring_entries * sizeof(struct io_uring_buf_ring); in io_alloc_pbuf_ring()
585 ibf = io_lookup_buf_free_entry(ctx, ring_size); in io_alloc_pbuf_ring()
587 ptr = io_mem_alloc(ring_size); in io_alloc_pbuf_ring()
598 ibf->size = ring_size; in io_alloc_pbuf_ring()
/openbmc/u-boot/drivers/net/
H A Dcalxedaxgmac.c230 static inline void desc_init_rx_desc(struct xgmac_dma_desc *p, int ring_size, in desc_init_rx_desc() argument
233 struct xgmac_dma_desc *end = p + ring_size - 1; in desc_init_rx_desc()
235 memset(p, 0, sizeof(*p) * ring_size); in desc_init_rx_desc()
243 static inline void desc_init_tx_desc(struct xgmac_dma_desc *p, u32 ring_size) in desc_init_tx_desc() argument
245 memset(p, 0, sizeof(*p) * ring_size); in desc_init_tx_desc()
246 p[ring_size - 1].flags = cpu_to_le32(TXDESC_END_RING); in desc_init_tx_desc()
/openbmc/qemu/hw/block/dataplane/
H A Dxen-block.c746 unsigned int ring_size; in xen_block_dataplane_start() local
758 ring_size = XEN_PAGE_SIZE * dataplane->nr_ring_ref; in xen_block_dataplane_start()
762 dataplane->max_requests = __CONST_RING_SIZE(blkif, ring_size); in xen_block_dataplane_start()
767 dataplane->max_requests = __CONST_RING_SIZE(blkif_x86_32, ring_size); in xen_block_dataplane_start()
772 dataplane->max_requests = __CONST_RING_SIZE(blkif_x86_64, ring_size); in xen_block_dataplane_start()
800 BACK_RING_INIT(&dataplane->rings.native, sring_native, ring_size); in xen_block_dataplane_start()
808 ring_size); in xen_block_dataplane_start()
816 ring_size); in xen_block_dataplane_start()

123456789