Add function for checking whether given rte_device is probed through auxiliary bus.
Signed-off-by: Dariusz Sosnowski <[email protected]> Acked-by: Viacheslav Ovsiienko <[email protected]> --- drivers/common/mlx5/mlx5_common.c | 7 +++++++ drivers/common/mlx5/mlx5_common.h | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index f4b8904366..11a53c8b56 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -138,6 +138,13 @@ driver_get(uint32_t class) return NULL; } +RTE_EXPORT_INTERNAL_SYMBOL(mlx5_dev_is_auxiliary) +bool +mlx5_dev_is_auxiliary(const struct rte_device *dev) +{ + return strcmp(dev->bus->name, "auxiliary") == 0; +} + RTE_EXPORT_INTERNAL_SYMBOL(mlx5_kvargs_process) int mlx5_kvargs_process(struct mlx5_kvargs_ctrl *mkvlist, const char *const keys[], diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h index 8b8f20e2f4..f579ca0904 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -596,6 +596,19 @@ __rte_internal bool mlx5_dev_is_pci(const struct rte_device *dev); +/** + * Test device is an auxiliary bus device. + * + * @param dev + * Pointer to EAL device. + * + * @return + * True if device is an auxiliary bus device. False otherwise. + */ +__rte_internal +bool +mlx5_dev_is_auxiliary(const struct rte_device *dev); + /** * Test PCI device is a VF device. * -- 2.43.0

