| 242 | } |
| 243 | |
| 244 | static inline int |
| 245 | configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) |
| 246 | { |
| 247 | uint16_t port_id; |
| 248 | int ret; |
| 249 | |
| 250 | /* initialize buffers for all ports */ |
| 251 | RTE_ETH_FOREACH_DEV(port_id) { |
| 252 | /* skip ports that are not enabled */ |
| 253 | if ((portmask & (1 << port_id)) == 0) |
| 254 | continue; |
| 255 | |
| 256 | /* Initialize TX buffers */ |
| 257 | tx_buffer[port_id] = rte_zmalloc_socket("tx_buffer", |
| 258 | RTE_ETH_TX_BUFFER_SIZE(MAX_PKTS_BURST), 0, |
| 259 | rte_eth_dev_socket_id(port_id)); |
| 260 | if (tx_buffer[port_id] == NULL) |
| 261 | rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", |
| 262 | port_id); |
| 263 | |
| 264 | rte_eth_tx_buffer_init(tx_buffer[port_id], MAX_PKTS_BURST); |
| 265 | |
| 266 | ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id], |
| 267 | flush_tx_error_callback, NULL); |
| 268 | if (ret < 0) |
| 269 | rte_exit(EXIT_FAILURE, |
| 270 | "Cannot set error callback for tx buffer on port %u\n", |
| 271 | port_id); |
| 272 | } |
| 273 | return 0; |
| 274 | } |
| 275 | |
| 276 | static inline int |
| 277 | configure_eth_port(uint16_t port_id) |
no test coverage detected