| 10 | #include <arpa/inet.h> |
| 11 | |
| 12 | static int |
| 13 | pfe_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 | |
| 35 | err0: |
| 36 | return err; |
| 37 | } |
| 38 | |
| 39 | static void |
| 40 | pfe_hif_free_descr(struct pfe_hif *hif) |
no test coverage detected