DPDK
18.11.11
|
Go to the source code of this file.
Data Structures | |
struct | rte_bus_conf |
struct | rte_bus |
Macros | |
#define | RTE_REGISTER_BUS(nm, bus) |
Typedefs | |
typedef int(* | rte_bus_scan_t) (void) |
typedef int(* | rte_bus_probe_t) (void) |
typedef struct rte_device *(* | rte_bus_find_device_t) (const struct rte_device *start, rte_dev_cmp_t cmp, const void *data) |
typedef int(* | rte_bus_plug_t) (struct rte_device *dev) |
typedef int(* | rte_bus_unplug_t) (struct rte_device *dev) |
typedef int(* | rte_bus_parse_t) (const char *name, void *addr) |
typedef int(* | rte_bus_hot_unplug_handler_t) (struct rte_device *dev) |
typedef int(* | rte_bus_sigbus_handler_t) (const void *failure_addr) |
typedef enum rte_iova_mode(* | rte_bus_get_iommu_class_t) (void) |
typedef int(* | rte_bus_cmp_t) (const struct rte_bus *bus, const void *data) |
Enumerations | |
enum | rte_iova_mode |
enum | rte_bus_scan_mode |
Functions | |
TAILQ_HEAD (rte_bus_list, rte_bus) | |
void | rte_bus_register (struct rte_bus *bus) |
void | rte_bus_unregister (struct rte_bus *bus) |
int | rte_bus_scan (void) |
int | rte_bus_probe (void) |
void | rte_bus_dump (FILE *f) |
struct rte_bus * | rte_bus_find (const struct rte_bus *start, rte_bus_cmp_t cmp, const void *data) |
struct rte_bus * | rte_bus_find_by_device (const struct rte_device *dev) |
struct rte_bus * | rte_bus_find_by_name (const char *busname) |
enum rte_iova_mode | rte_bus_get_iommu_class (void) |
DPDK device bus interface
This file exposes API and interfaces for bus abstraction over the devices and drivers in EAL.
Definition in file rte_bus.h.
#define RTE_REGISTER_BUS | ( | nm, | |
bus | |||
) |
Helper for Bus registration. The constructor has higher priority than PMD constructors.
typedef int(* rte_bus_scan_t) (void) |
Bus specific scan for devices attached on the bus. For each bus object, the scan would be responsible for finding devices and adding them to its private device list.
A bus should mandatorily implement this method.
typedef int(* rte_bus_probe_t) (void) |
typedef struct rte_device*(* rte_bus_find_device_t) (const struct rte_device *start, rte_dev_cmp_t cmp, const void *data) |
Device iterator to find a device on a bus.
This function returns an rte_device if one of those held by the bus matches the data passed as parameter.
If the comparison function returns zero this function should stop iterating over any more devices. To continue a search the device of a previous search can be passed via the start parameter.
cmp | Comparison function. |
data | Data to compare each device against. |
start | starting point for the iteration |
typedef int(* rte_bus_plug_t) (struct rte_device *dev) |
typedef int(* rte_bus_unplug_t) (struct rte_device *dev) |
typedef int(* rte_bus_parse_t) (const char *name, void *addr) |
Bus specific parsing function. Validates the syntax used in the textual representation of a device, If the syntax is valid and addr
is not NULL, writes the bus-specific device representation to addr
.
[in] | name | device textual description |
[out] | addr | device information location address, into which parsed info should be written. If NULL, nothing should be written, which is not an error. |
typedef int(* rte_bus_hot_unplug_handler_t) (struct rte_device *dev) |
Implement a specific hot-unplug handler, which is responsible for handle the failure when device be hot-unplugged. When the event of hot-unplug be detected, it could call this function to handle the hot-unplug failure and avoid app crash.
dev | Pointer of the device structure. |
typedef int(* rte_bus_sigbus_handler_t) (const void *failure_addr) |
Implement a specific sigbus handler, which is responsible for handling the sigbus error which is either original memory error, or specific memory error that caused of device be hot-unplugged. When sigbus error be captured, it could call this function to handle sigbus error.
failure_addr | Pointer of the fault address of the sigbus error. |
typedef enum rte_iova_mode(* rte_bus_get_iommu_class_t) (void) |
Get common iommu class of the all the devices on the bus. The bus may check that those devices are attached to iommu driver. If no devices are attached to the bus. The bus may return with don't care (_DC) value. Otherwise, The bus will return appropriate _pa or _va iova mode.
typedef int(* rte_bus_cmp_t) (const struct rte_bus *bus, const void *data) |
Bus comparison function.
bus | Bus under test. |
data | Data to compare against. |
enum rte_iova_mode |
enum rte_bus_scan_mode |
TAILQ_HEAD | ( | rte_bus_list | , |
rte_bus | |||
) |
Double linked list of buses
void rte_bus_register | ( | struct rte_bus * | bus | ) |
Register a Bus handler.
bus | A pointer to a rte_bus structure describing the bus to be registered. |
void rte_bus_unregister | ( | struct rte_bus * | bus | ) |
Unregister a Bus handler.
bus | A pointer to a rte_bus structure describing the bus to be unregistered. |
int rte_bus_scan | ( | void | ) |
Scan all the buses.
int rte_bus_probe | ( | void | ) |
For each device on the buses, perform a driver 'match' and call the driver-specific probe for device initialization.
void rte_bus_dump | ( | FILE * | f | ) |
Dump information of all the buses registered with EAL.
f | A valid and open output stream handle |
struct rte_bus* rte_bus_find | ( | const struct rte_bus * | start, |
rte_bus_cmp_t | cmp, | ||
const void * | data | ||
) |
Bus iterator to find a particular bus.
This function compares each registered bus to find one that matches the data passed as parameter.
If the comparison function returns zero this function will stop iterating over any more buses. To continue a search the bus of a previous search can be passed via the start parameter.
start | Starting point for the iteration. |
cmp | Comparison function. |
data | Data to pass to comparison function. |
struct rte_bus* rte_bus_find_by_device | ( | const struct rte_device * | dev | ) |
Find the registered bus for a particular device.
struct rte_bus* rte_bus_find_by_name | ( | const char * | busname | ) |
Find the registered bus for a given name.
enum rte_iova_mode rte_bus_get_iommu_class | ( | void | ) |
Get the common iommu class of devices bound on to buses available in the system. The default mode is PA.