| 1030 | return 0; |
| 1031 | } |
| 1032 | static void |
| 1033 | dma_unmap_cb(struct rte_mempool *mp __rte_unused, void *opaque __rte_unused, |
| 1034 | struct rte_mempool_memhdr *memhdr, unsigned mem_idx __rte_unused) |
| 1035 | { |
| 1036 | uint16_t pid = 0; |
| 1037 | int ret; |
| 1038 | |
| 1039 | RTE_ETH_FOREACH_DEV(pid) { |
| 1040 | struct rte_eth_dev_info dev_info; |
| 1041 | |
| 1042 | ret = eth_dev_info_get_print_err(pid, &dev_info); |
| 1043 | if (ret != 0) { |
| 1044 | TESTPMD_LOG(DEBUG, |
| 1045 | "unable to get device info for port %d on addr 0x%p," |
| 1046 | "mempool unmapping will not be performed\n", |
| 1047 | pid, memhdr->addr); |
| 1048 | continue; |
| 1049 | } |
| 1050 | |
| 1051 | ret = rte_dev_dma_unmap(dev_info.device, memhdr->addr, 0, memhdr->len); |
| 1052 | if (ret) { |
| 1053 | TESTPMD_LOG(DEBUG, |
| 1054 | "unable to DMA unmap addr 0x%p " |
| 1055 | "for device %s\n", |
| 1056 | memhdr->addr, rte_dev_name(dev_info.device)); |
| 1057 | } |
| 1058 | } |
| 1059 | ret = rte_extmem_unregister(memhdr->addr, memhdr->len); |
| 1060 | if (ret) { |
| 1061 | TESTPMD_LOG(DEBUG, |
| 1062 | "unable to un-register addr 0x%p\n", memhdr->addr); |
| 1063 | } |
| 1064 | } |
| 1065 | |
| 1066 | static void |
| 1067 | dma_map_cb(struct rte_mempool *mp __rte_unused, void *opaque __rte_unused, |
nothing calls this directly
no test coverage detected