rte_bus.h(3)

πŸ’– rte_bus.h πŸ’–

okay bestie, welcome to the rte_bus.h page from the Library Functions Manual, and no cap this one is lowkey the blueprint for how DPDK finds and wakes up your devices. let's get into it 🫢


✨ NAME ✨

rte_bus.h β€” literally the header, that's the name, slay


🌸 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, periodt πŸ’…

This file exposes the API and interfaces for bus abstraction over the devices and drivers in EAL. it's giving "let's make every bus speak the same language".

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. it's the vibe-check function, fr fr.

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. like asking the bus "what's ur name bestie".

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. all of them. every single one. πŸ‘‘

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. this is the matchmaking era we're in πŸ’…

Returns

0 for successful match/probe, !0 otherwise.


🌟 void rte_bus_dump (FILE * f)

Dump information of all the buses registered with EAL. a little info-dump, but make it iconic 🌸

Parameters

  • f β€” A valid and open output stream handle. (valid AND open, don't play w me 🫢)

🌟 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. main character energy, honestly.

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. so you can pick up right where you left off, no restart needed ⭐

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. (if it's NULL we simply move on πŸ™ˆ)


🌟 struct rte_bus * rte_bus_find_by_device (const struct rte_device * dev)

Find the registered bus for a particular device. match made in heaven πŸŽ€


🌟 struct rte_bus * rte_bus_find_by_name (const char * busname)

Find the registered bus for a given name. name-drop and it shall appear ✨


🌟 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. like when someone says "idc, you pick" β€” that's RTE_IOVA_DC right there πŸ’€

Returns

enum rte_iova_mode value.


🧚 Author 🧚

Generated automatically by Doxygen for DPDK from the source code. (not a human, just a lil robot doing its thing πŸ€–πŸ’–)


ok and that's the whole page bestie, every flag, every return, every line 80, all of it. you ate. periodt. πŸ’…

DPDK, Version 25.11.3, rte_bus.h(3) β€” mwah, catch u on the next manpage πŸ¦‹πŸŒΈπŸ’œ

πŸ“¦ where this page comes from