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

Function configure_tx_buffer

dpdk/examples/server_node_efd/efd_node/node.c:136–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136static void
137configure_tx_buffer(uint16_t port_id, uint16_t size)
138{
139 int ret;
140
141 /* Initialize TX buffers */
142 tx_buffer[port_id] = rte_zmalloc_socket("tx_buffer",
143 RTE_ETH_TX_BUFFER_SIZE(size), 0,
144 rte_eth_dev_socket_id(port_id));
145 if (tx_buffer[port_id] == NULL)
146 rte_exit(EXIT_FAILURE,
147 "Cannot allocate buffer for tx on port %u\n", port_id);
148
149 rte_eth_tx_buffer_init(tx_buffer[port_id], size);
150
151 ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id],
152 flush_tx_error_callback, (void *)(intptr_t)port_id);
153 if (ret < 0)
154 rte_exit(EXIT_FAILURE,
155 "Cannot set error callback for tx buffer on port %u\n",
156 port_id);
157}
158
159/*
160 * set up output ports so that all traffic on port gets sent out

Callers 1

configure_output_portsFunction · 0.70

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