| 113 | } |
| 114 | |
| 115 | static int |
| 116 | test_setup(void) |
| 117 | { |
| 118 | port_id = rte_eth_dev_count_avail(); |
| 119 | |
| 120 | /* Make a dummy null device to snoop on */ |
| 121 | if (rte_vdev_init(null_dev, NULL) != 0) { |
| 122 | fprintf(stderr, "Failed to create vdev '%s'\n", null_dev); |
| 123 | goto fail; |
| 124 | } |
| 125 | |
| 126 | /* Make a pool for cloned packets */ |
| 127 | mp = rte_pktmbuf_pool_create_by_ops("pcapng_test_pool", |
| 128 | MAX_BURST * 32, 0, 0, |
| 129 | rte_pcapng_mbuf_size(pkt_len) + 128, |
| 130 | SOCKET_ID_ANY, "ring_mp_sc"); |
| 131 | if (mp == NULL) { |
| 132 | fprintf(stderr, "Cannot create mempool\n"); |
| 133 | goto fail; |
| 134 | } |
| 135 | |
| 136 | return 0; |
| 137 | |
| 138 | fail: |
| 139 | rte_vdev_uninit(null_dev); |
| 140 | rte_mempool_free(mp); |
| 141 | return -1; |
| 142 | } |
| 143 | |
| 144 | static int |
| 145 | fill_pcapng_file(rte_pcapng_t *pcapng, unsigned int num_packets) |
nothing calls this directly
no test coverage detected