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

Function mlx5_dev_to_pci_str

dpdk/drivers/common/mlx5/mlx5_common.c:458–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458int
459mlx5_dev_to_pci_str(const struct rte_device *dev, char *addr, size_t size)
460{
461 struct rte_pci_addr pci_addr = { 0 };
462 int ret;
463
464 if (mlx5_dev_is_pci(dev)) {
465 /* Input might be <BDF>, format PCI address to <DBDF>. */
466 ret = rte_pci_addr_parse(dev->name, &pci_addr);
467 if (ret != 0)
468 return -ENODEV;
469 rte_pci_device_name(&pci_addr, addr, size);
470 return 0;
471 }
472#ifdef RTE_EXEC_ENV_LINUX
473 return mlx5_auxiliary_get_pci_str(RTE_DEV_TO_AUXILIARY_CONST(dev),
474 addr, size);
475#else
476 rte_errno = ENODEV;
477 return -rte_errno;
478#endif
479}
480
481/**
482 * Register the mempool for the protection domain.

Callers 2

mlx5_txpp_map_hca_barFunction · 0.85
mlx5_roce_disableFunction · 0.85

Calls 4

mlx5_dev_is_pciFunction · 0.85
rte_pci_addr_parseFunction · 0.85
rte_pci_device_nameFunction · 0.85

Tested by

no test coverage detected