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

Function configure_tx_buffers

dpdk/examples/packet_ordering/main.c:244–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244static inline int
245configure_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
276static inline int
277configure_eth_port(uint16_t port_id)

Callers 2

send_threadFunction · 0.85
tx_threadFunction · 0.85

Calls 5

rte_zmalloc_socketFunction · 0.85
rte_eth_dev_socket_idFunction · 0.85
rte_exitFunction · 0.85
rte_eth_tx_buffer_initFunction · 0.85

Tested by

no test coverage detected