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

Function graph_config_add

dpdk/app/graph/graph.c:282–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282static int
283graph_config_add(char *usecases, struct graph_config *config)
284{
285 uint64_t lcore_id, core_num;
286 uint64_t eal_coremask = 0;
287
288 if (!parser_usecases_read(usecases))
289 return -EINVAL;
290
291 for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
292 if (rte_lcore_is_enabled(lcore_id))
293 eal_coremask |= RTE_BIT64(lcore_id);
294 }
295
296 for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
297 core_num = 1 << lcore_id;
298 if (config->params.coremask & core_num) {
299 if (eal_coremask & core_num)
300 continue;
301 else
302 return -EINVAL;
303 }
304 }
305
306 graph_config.params.bsz = config->params.bsz;
307 graph_config.params.tmo = config->params.tmo;
308 graph_config.params.coremask = config->params.coremask;
309 graph_config.model = config->model;
310 graph_config.pcap_ena = config->pcap_ena;
311 graph_config.num_pcap_pkts = config->num_pcap_pkts;
312 graph_config.pcap_file = strdup(config->pcap_file);
313
314 return 0;
315}
316
317void
318graph_pcap_config_get(uint8_t *pcap_ena, uint64_t *num_pkts, char **file)

Callers 1

cli_graphFunction · 0.85

Calls 3

parser_usecases_readFunction · 0.85
rte_lcore_is_enabledFunction · 0.85
strdupFunction · 0.85

Tested by

no test coverage detected