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

Function graph_pcap_init

dpdk/lib/graph/graph_pcap.c:161–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161int
162graph_pcap_init(struct graph *graph)
163{
164 struct rte_graph *graph_data = graph->graph;
165
166 if (graph_pcap_file_open(graph->pcap_filename) < 0)
167 goto error;
168
169 if (graph_pcap_mp_init() < 0)
170 goto error;
171
172 /* User configured number of packets to capture. */
173 if (graph->num_pkt_to_capture)
174 graph_data->nb_pkt_to_capture = graph->num_pkt_to_capture;
175 else
176 graph_data->nb_pkt_to_capture = GRAPH_PCAP_NUM_PACKETS;
177
178 /* All good. Now populate data for secondary process. */
179 rte_strscpy(graph_data->pcap_filename, graph->pcap_filename, RTE_GRAPH_PCAP_FILE_SZ);
180 graph_data->pcap_enable = 1;
181
182 return 0;
183
184error:
185 graph_pcap_exit(graph_data);
186 graph_pcap_enable(0);
187 graph_err("Graph pcap initialization failed. Disabling pcap trace.");
188 return -1;
189}
190
191uint16_t
192graph_pcap_dispatch(struct rte_graph *graph,

Callers 1

graph_fp_mem_populateFunction · 0.85

Calls 5

graph_pcap_file_openFunction · 0.85
graph_pcap_mp_initFunction · 0.85
rte_strscpyFunction · 0.85
graph_pcap_exitFunction · 0.85
graph_pcap_enableFunction · 0.85

Tested by

no test coverage detected