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

Function start_forwarding

dpdk/app/test-flow-perf/main.c:1807–1838  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1805}
1806
1807static int
1808start_forwarding(void *data __rte_unused)
1809{
1810 int lcore = rte_lcore_id();
1811 int stream_id;
1812 uint16_t cnt;
1813 struct lcore_info *li = &lcore_infos[lcore];
1814
1815 if (!li->mode)
1816 return 0;
1817
1818 if (li->mode == LCORE_MODE_STATS) {
1819 printf(":: started stats on lcore %u\n", lcore);
1820 packet_per_second_stats();
1821 return 0;
1822 }
1823
1824 while (!force_quit)
1825 for (stream_id = 0; stream_id < MAX_STREAMS; stream_id++) {
1826 if (li->streams[stream_id].rx_port == -1)
1827 continue;
1828
1829 cnt = do_rx(li,
1830 li->streams[stream_id].rx_port,
1831 li->streams[stream_id].rx_queue);
1832 if (cnt)
1833 do_tx(li, cnt,
1834 li->streams[stream_id].tx_port,
1835 li->streams[stream_id].tx_queue);
1836 }
1837 return 0;
1838}
1839
1840static void
1841init_lcore_info(void)

Callers

nothing calls this directly

Calls 5

rte_lcore_idFunction · 0.85
packet_per_second_statsFunction · 0.85
do_rxFunction · 0.85
do_txFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected