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

Function ionic_rx_fill_one

dpdk/drivers/net/ionic/ionic_rxtx_simple.c:314–350  ·  view source on GitHub ↗

* Fills one descriptor with mbufs. Does not advance the head index. */

Source from the content-addressed store, hash-verified

312 * Fills one descriptor with mbufs. Does not advance the head index.
313 */
314static __rte_always_inline int
315ionic_rx_fill_one(struct ionic_rx_qcq *rxq)
316{
317 struct ionic_queue *q = &rxq->qcq.q;
318 struct rte_mbuf *rxm;
319 struct ionic_rxq_desc *desc, *desc_base = q->base;
320 rte_iova_t data_iova;
321 void **info;
322 int ret;
323
324 info = &q->info[q->head_idx];
325 desc = &desc_base[q->head_idx];
326
327 /* mbuf is unused */
328 if (info[0])
329 return 0;
330
331 if (rxq->mb_idx == 0) {
332 ret = rte_mempool_get_bulk(rxq->mb_pool,
333 (void **)rxq->mbs,
334 IONIC_MBUF_BULK_ALLOC);
335 if (ret) {
336 assert(0);
337 return -ENOMEM;
338 }
339
340 rxq->mb_idx = IONIC_MBUF_BULK_ALLOC;
341 }
342
343 rxm = rxq->mbs[--rxq->mb_idx];
344 info[0] = rxm;
345
346 data_iova = rte_mbuf_data_iova_default(rxm);
347 desc->addr = rte_cpu_to_le_64(data_iova);
348
349 return 0;
350}
351
352/*
353 * Walk the CQ to find completed receive descriptors.

Callers 2

ionic_rxq_serviceFunction · 0.85
ionic_rx_fillFunction · 0.85

Calls 2

rte_mempool_get_bulkFunction · 0.85

Tested by

no test coverage detected