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

Function mlx4_args

dpdk/drivers/net/mlx4/mlx4.c:577–611  ·  view source on GitHub ↗

* Parse device parameters. * * @param devargs * Device arguments structure. * * @return * 0 on success, negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

575 * 0 on success, negative errno value otherwise and rte_errno is set.
576 */
577static int
578mlx4_args(struct rte_devargs *devargs, struct mlx4_conf *conf)
579{
580 struct rte_kvargs *kvlist;
581 unsigned int arg_count;
582 int ret = 0;
583 int i;
584
585 if (devargs == NULL)
586 return 0;
587 kvlist = rte_kvargs_parse(devargs->args, pmd_mlx4_init_params);
588 if (kvlist == NULL) {
589 rte_errno = EINVAL;
590 ERROR("failed to parse kvargs");
591 return -rte_errno;
592 }
593 /* Process parameters. */
594 for (i = 0; pmd_mlx4_init_params[i]; ++i) {
595 arg_count = rte_kvargs_count(kvlist, pmd_mlx4_init_params[i]);
596 while (arg_count-- > 0) {
597 ret = rte_kvargs_process(kvlist,
598 pmd_mlx4_init_params[i],
599 (int (*)(const char *,
600 const char *,
601 void *))
602 mlx4_arg_parse,
603 conf);
604 if (ret != 0)
605 goto free_kvlist;
606 }
607 }
608free_kvlist:
609 rte_kvargs_free(kvlist);
610 return ret;
611}
612
613/**
614 * Interpret RSS capabilities reported by device.

Callers 1

mlx4_pci_probeFunction · 0.85

Calls 4

rte_kvargs_parseFunction · 0.85
rte_kvargs_countFunction · 0.85
rte_kvargs_processFunction · 0.85
rte_kvargs_freeFunction · 0.85

Tested by

no test coverage detected