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

Function rte_eth_devargs_parse

dpdk/lib/ethdev/ethdev_driver.c:482–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482int
483rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da)
484{
485 struct rte_kvargs args;
486 struct rte_kvargs_pair *pair;
487 unsigned int i;
488 int result = 0;
489
490 memset(eth_da, 0, sizeof(*eth_da));
491
492 result = eth_dev_devargs_tokenise(&args, dargs);
493 if (result < 0)
494 goto parse_cleanup;
495
496 for (i = 0; i < args.count; i++) {
497 pair = &args.pairs[i];
498 if (strcmp("representor", pair->key) == 0) {
499 if (eth_da->type != RTE_ETH_REPRESENTOR_NONE) {
500 RTE_ETHDEV_LOG(ERR, "duplicated representor key: %s\n",
501 dargs);
502 result = -1;
503 goto parse_cleanup;
504 }
505 result = rte_eth_devargs_parse_representor_ports(
506 pair->value, eth_da);
507 if (result < 0)
508 goto parse_cleanup;
509 }
510 }
511
512parse_cleanup:
513 free(args.str);
514
515 return result;
516}
517
518static inline int
519eth_dev_dma_mzone_name(char *name, size_t len, uint16_t port_id, uint16_t queue_id,

Callers 8

eth_enic_pci_probeFunction · 0.85
nfp_flower_repr_createFunction · 0.85
eth_ixgbe_pci_probeFunction · 0.85
eth_ice_dcf_pci_probeFunction · 0.85
sfc_parse_rte_devargsFunction · 0.85
bnxt_pci_probeFunction · 0.85
eth_i40e_pci_probeFunction · 0.85

Calls 5

memsetFunction · 0.85
eth_dev_devargs_tokeniseFunction · 0.85
strcmpFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected