| 280 | } |
| 281 | |
| 282 | static int |
| 283 | graph_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 | |
| 317 | void |
| 318 | graph_pcap_config_get(uint8_t *pcap_ena, uint64_t *num_pkts, char **file) |
no test coverage detected