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

Function atl_alloc_rx_queue_mbufs

dpdk/drivers/net/atlantic/atl_rxtx.c:392–424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392static int
393atl_alloc_rx_queue_mbufs(struct atl_rx_queue *rxq)
394{
395 struct atl_rx_entry *rx_entry = rxq->sw_ring;
396 struct hw_atl_rxd_s *rxd;
397 uint64_t dma_addr = 0;
398 uint32_t i = 0;
399
400 PMD_INIT_FUNC_TRACE();
401
402 /* fill Rx ring */
403 for (i = 0; i < rxq->nb_rx_desc; i++) {
404 struct rte_mbuf *mbuf = rte_mbuf_raw_alloc(rxq->mb_pool);
405
406 if (mbuf == NULL) {
407 PMD_INIT_LOG(ERR,
408 "Port %d: mbuf alloc failed for rx queue %d",
409 rxq->port_id, rxq->queue_id);
410 return -ENOMEM;
411 }
412
413 mbuf->data_off = RTE_PKTMBUF_HEADROOM;
414 mbuf->port = rxq->port_id;
415
416 dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
417 rxd = (struct hw_atl_rxd_s *)&rxq->hw_ring[i];
418 rxd->buf_addr = dma_addr;
419 rxd->hdr_addr = 0;
420 rx_entry[i].mbuf = mbuf;
421 }
422
423 return 0;
424}
425
426static void
427atl_rx_queue_release_mbufs(struct atl_rx_queue *rxq)

Callers 1

atl_rx_queue_startFunction · 0.85

Calls 2

rte_mbuf_raw_allocFunction · 0.85

Tested by

no test coverage detected