1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2020 Mellanox Technologies, Ltd
5 #ifndef _MLX5_COMMON_PCI_H_
6 #define _MLX5_COMMON_PCI_H_
11 * RTE Mellanox PCI Driver Interface
12 * Mellanox ConnectX PCI device supports multiple class: net,vdpa,regex and
13 * compress devices. This layer enables creating such multiple class of devices
14 * on a single PCI device by allowing to bind multiple class specific device
15 * driver to attach to mlx5_pci driver.
17 * ----------- ------------ ------------- ----------------
18 * | mlx5 | | mlx5 | | mlx5 | | mlx5 |
19 * | net pmd | | vdpa pmd | | regex pmd | | compress pmd |
20 * ----------- ------------ ------------- ----------------
23 * \ \_--------------_/ /
24 * \_______________| mlx5 |_______________/
33 * - mlx5 pci driver binds to mlx5 PCI devices defined by PCI
34 * ID table of all related mlx5 PCI devices.
35 * - mlx5 class driver such as net, vdpa, regex PMD defines its
36 * specific PCI ID table and mlx5 bus driver probes matching
38 * - mlx5 pci bus driver is cental place that validates supported
44 #endif /* __cplusplus */
47 #include <rte_bus_pci.h>
49 #include <mlx5_common.h>
51 void mlx5_common_pci_init(void);
54 * A structure describing a mlx5 pci driver.
56 struct mlx5_pci_driver {
57 struct rte_pci_driver pci_driver; /**< Inherit core pci driver. */
58 uint32_t driver_class; /**< Class of this driver, enum mlx5_class */
59 TAILQ_ENTRY(mlx5_pci_driver) next;
63 * Register a mlx5_pci device driver.
66 * A pointer to a mlx5_pci_driver structure describing the driver
71 mlx5_pci_driver_register(struct mlx5_pci_driver *driver);
75 #endif /* __cplusplus */
77 #endif /* _MLX5_COMMON_PCI_H_ */