MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ionic_q_init

Function ionic_q_init

dpdk/drivers/net/ionic/ionic_dev.c:357–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357int
358ionic_q_init(struct ionic_queue *q, uint32_t index, uint16_t num_descs)
359{
360 uint32_t ring_size;
361
362 if (!rte_is_power_of_2(num_descs))
363 return -EINVAL;
364
365 ring_size = rte_log2_u32(num_descs);
366 if (ring_size < 2 || ring_size > 16)
367 return -EINVAL;
368
369 q->index = index;
370 q->num_descs = num_descs;
371 q->size_mask = num_descs - 1;
372 q->head_idx = 0;
373 q->tail_idx = 0;
374
375 return 0;
376}
377
378void
379ionic_q_map(struct ionic_queue *q, void *base, rte_iova_t base_pa)

Callers 1

ionic_qcq_allocFunction · 0.85

Calls 2

rte_is_power_of_2Function · 0.50
rte_log2_u32Function · 0.50

Tested by

no test coverage detected