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

Function parse_port_list

lib/ff_config.c:324–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324static int
325parse_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
348static int
349parse_port_slave_list(struct ff_port_cfg *cfg, const char *v_str)

Callers 1

ini_parse_handlerFunction · 0.70

Calls 3

__parse_config_listFunction · 0.85
mallocFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected