DPDK 22.11.5
Typedefs | Functions
rte_bus.h File Reference
#include <stdio.h>
#include <rte_eal.h>

Go to the source code of this file.

Typedefs

typedef int(* rte_bus_cmp_t) (const struct rte_bus *bus, const void *data)
 

Functions

const char * rte_bus_name (const 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)
 

Detailed Description

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.

Typedef Documentation

◆ rte_bus_cmp_t

typedef int(* rte_bus_cmp_t) (const struct rte_bus *bus, const void *data)

Bus comparison function.

Parameters
busBus under test.
dataData to compare against.
Returns
0 if the bus matches the data. !0 if the bus does not match. <0 if ordering is possible and the bus is lower than the data. >0 if ordering is possible and the bus is greater than the data.

Definition at line 80 of file rte_bus.h.

Function Documentation

◆ rte_bus_name()

const char * rte_bus_name ( const struct rte_bus *  bus)

Retrieve a bus name.

Parameters
busA pointer to a rte_bus structure.
Returns
A pointer to the bus name string.
Examples
examples/multi_process/hotplug_mp/commands.c.

◆ rte_bus_scan()

int rte_bus_scan ( void  )

Scan all the buses.

Returns
0 in case of success in scanning all buses !0 in case of failure to scan

◆ rte_bus_probe()

int rte_bus_probe ( void  )

For each device on the buses, perform a driver 'match' and call the driver-specific probe for device initialization.

Returns
0 for successful match/probe !0 otherwise

◆ rte_bus_dump()

void rte_bus_dump ( FILE *  f)

Dump information of all the buses registered with EAL.

Parameters
fA valid and open output stream handle

◆ rte_bus_find()

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.

Parameters
startStarting point for the iteration.
cmpComparison function.
dataData to pass to comparison function.
Returns
A pointer to a rte_bus structure or NULL in case no bus matches

◆ rte_bus_find_by_device()

struct rte_bus * rte_bus_find_by_device ( const struct rte_device *  dev)

Find the registered bus for a particular device.

◆ rte_bus_find_by_name()

struct rte_bus * rte_bus_find_by_name ( const char *  busname)

Find the registered bus for a given name.

◆ rte_bus_get_iommu_class()

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. RTE_IOVA_DC means that no preference has been expressed.

Returns
enum rte_iova_mode value.