---
name: "rte_bus.h"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_bus.h"
---

# rte\_bus.h(3)

## NAME

rte\_bus.h

## SYNOPSIS

`#include <stdio.h>`\
 `#include <rte_eal.h>`\

### 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

### typedef int(\* rte\_bus\_cmp\_t) (const struct rte\_bus \*bus, const void \*data)

Bus comparison function.

**Parameters**

*bus* Bus under test.\
 *data* Data 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

### const char \* rte\_bus\_name (const struct rte\_bus \* bus)

Retrieve a bus name.

**Parameters**

*bus* A pointer to a rte\_bus structure.

**Returns**

A pointer to the bus name string.

### 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

### 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

### void rte\_bus\_dump (FILE \* f)

Dump information of all the buses registered with EAL.

**Parameters**

*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.

**Parameters**

*start* Starting point for the iteration.\
 *cmp* Comparison function.\
 *data* Data to pass to comparison function.

**Returns**

A pointer to a rte\_bus structure or NULL in case no bus matches

### 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. RTE\_IOVA\_DC means that no preference has been expressed.

**Returns**

enum rte\_iova\_mode value.

## Author

Generated automatically by Doxygen for DPDK from the source code.
