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

Function dump_packets

dpdk/app/pdump/main.c:913–960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

911}
912
913static inline void
914dump_packets(void)
915{
916 int i;
917 unsigned int lcore_id = 0;
918
919 if (num_tuples == 0)
920 rte_exit(EXIT_FAILURE, "No device specified for capture\n");
921
922 if (!multiple_core_capture) {
923 printf(" core (%u), capture for (%d) tuples\n",
924 rte_lcore_id(), num_tuples);
925
926 for (i = 0; i < num_tuples; i++)
927 printf(" - port %u device (%s) queue %u\n",
928 pdump_t[i].port,
929 pdump_t[i].device_id,
930 pdump_t[i].queue);
931
932 while (!quit_signal) {
933 for (i = 0; i < num_tuples; i++)
934 pdump_packets(&pdump_t[i]);
935 }
936
937 return;
938 }
939
940 /* check if there enough core */
941 if ((uint32_t)num_tuples >= rte_lcore_count()) {
942 printf("Insufficient cores to run parallel!\n");
943 return;
944 }
945
946 lcore_id = get_next_core(lcore_id);
947
948 for (i = 0; i < num_tuples; i++) {
949 rte_eal_remote_launch(dump_packets_core,
950 &pdump_t[i], lcore_id);
951 lcore_id = get_next_core(lcore_id);
952
953 if (rte_eal_wait_lcore(lcore_id) < 0)
954 rte_exit(EXIT_FAILURE, "failed to wait\n");
955 }
956
957 /* main core */
958 while (!quit_signal)
959 ;
960}
961
962static void
963enable_primary_monitor(void)

Callers 1

mainFunction · 0.85

Calls 8

rte_exitFunction · 0.85
rte_lcore_idFunction · 0.85
pdump_packetsFunction · 0.85
rte_lcore_countFunction · 0.85
get_next_coreFunction · 0.85
rte_eal_remote_launchFunction · 0.85
rte_eal_wait_lcoreFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected