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

Function do_packet_forwarding

dpdk/examples/server_node_efd/efd_server/main.c:303–326  ·  view source on GitHub ↗

* Function called by the main lcore of the DPDK process. */

Source from the content-addressed store, hash-verified

301 * Function called by the main lcore of the DPDK process.
302 */
303static void
304do_packet_forwarding(void)
305{
306 unsigned int port_num = 0; /* indexes the port[] array */
307 unsigned int socket_id = rte_socket_id();
308
309 for (;;) {
310 struct rte_mbuf *buf[PACKET_READ_SIZE];
311 uint16_t rx_count;
312
313 /* read a port */
314 rx_count = rte_eth_rx_burst(info->id[port_num], 0,
315 buf, PACKET_READ_SIZE);
316 info->rx_stats.rx[port_num] += rx_count;
317
318 /* Now process the NIC packets read */
319 if (likely(rx_count > 0))
320 process_packets(port_num, buf, rx_count, socket_id);
321
322 /* move to next port */
323 if (++port_num == info->num_ports)
324 port_num = 0;
325 }
326}
327
328int
329main(int argc, char *argv[])

Callers 1

mainFunction · 0.70

Calls 3

rte_socket_idFunction · 0.85
rte_eth_rx_burstFunction · 0.85
process_packetsFunction · 0.70

Tested by

no test coverage detected