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

Function pfe_hif_alloc_descr

dpdk/drivers/net/pfe/pfe_hif.c:12–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include <arpa/inet.h>
11
12static int
13pfe_hif_alloc_descr(struct pfe_hif *hif)
14{
15 void *addr;
16 int err = 0;
17
18 PMD_INIT_FUNC_TRACE();
19
20 addr = rte_zmalloc(NULL, HIF_RX_DESC_NT * sizeof(struct hif_desc) +
21 HIF_TX_DESC_NT * sizeof(struct hif_desc), RTE_CACHE_LINE_SIZE);
22 if (!addr) {
23 PFE_PMD_ERR("Could not allocate buffer descriptors!");
24 err = -ENOMEM;
25 goto err0;
26 }
27
28 hif->descr_baseaddr_p = pfe_mem_vtop((uintptr_t)addr);
29 hif->descr_baseaddr_v = addr;
30 hif->rx_ring_size = HIF_RX_DESC_NT;
31 hif->tx_ring_size = HIF_TX_DESC_NT;
32
33 return 0;
34
35err0:
36 return err;
37}
38
39static void
40pfe_hif_free_descr(struct pfe_hif *hif)

Callers 1

pfe_hif_initFunction · 0.85

Calls 2

rte_zmallocFunction · 0.85
pfe_mem_vtopFunction · 0.85

Tested by

no test coverage detected