| 322 | } |
| 323 | |
| 324 | static int |
| 325 | parse_port_list(struct ff_config *cfg, const char *v_str) |
| 326 | { |
| 327 | int res; |
| 328 | uint16_t ports[RTE_MAX_ETHPORTS]; |
| 329 | int sz = RTE_MAX_ETHPORTS; |
| 330 | |
| 331 | res = __parse_config_list(ports, &sz, v_str); |
| 332 | if (! res) return res; |
| 333 | |
| 334 | uint16_t *portid_list = malloc(sizeof(uint16_t)*sz); |
| 335 | |
| 336 | if (portid_list == NULL) { |
| 337 | fprintf(stderr, "parse_port_list malloc failed\n"); |
| 338 | return 0; |
| 339 | } |
| 340 | memcpy(portid_list, ports, sz*sizeof(uint16_t)); |
| 341 | |
| 342 | cfg->dpdk.portid_list = portid_list; |
| 343 | cfg->dpdk.nb_ports = sz; |
| 344 | cfg->dpdk.max_portid = portid_list[sz-1]; |
| 345 | return res; |
| 346 | } |
| 347 | |
| 348 | static int |
| 349 | parse_port_slave_list(struct ff_port_cfg *cfg, const char *v_str) |
no test coverage detected