rte_pci.h(3)

โœจ rte_pci.h โœจ (Library Functions Manual)

okay bestie, gather round ๐Ÿซถ you just pulled up the manual page for rte_pci.h, and it's giving PCI library core, and honestly? iconic. this is the DPDK header that handles all the PCI address stuff โ€” naming devices, comparing them, parsing them. let's get into it ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

rte_pci.h โ€” no cap, that's the whole name, that's the vibe


โœจ SYNOPSIS โœจ

first things first, you gotta pull in these headers or nothing works, fr fr:

#include <stdio.h>
#include <inttypes.h>
#include <sys/types.h>

๐ŸŽ€ Data Structures

  • struct rte_pci_id
  • struct rte_pci_addr

๐Ÿฆ‹ Macros

  • #define PCI_PRI_FMT '%.4' PRIx32 ':%.2' PRIx8 ':%.2' PRIx8 '.%' PRIx8
  • #define PCI_SHORT_PRI_FMT '%.2' PRIx8 ':%.2' PRIx8 '.%' PRIx8
  • #define PCI_FMT_NVAL 4
  • #define PCI_RESOURCE_FMT_NVAL 3
  • #define PCI_MAX_RESOURCE 6
  • #define RTE_PCI_ANY_ID (0xffff)
  • #define PCI_ANY_ID RTE_DEPRECATED(PCI_ANY_ID) RTE_PCI_ANY_ID

๐Ÿ’œ Functions

void rte_pci_device_name (const struct rte_pci_addr *addr, char *output,
    size_t size)
int rte_pci_addr_cmp (const struct rte_pci_addr *addr, const struct
    rte_pci_addr *addr2)
int rte_pci_addr_parse (const char *str, struct rte_pci_addr *addr)

๐ŸŒˆ Detailed Description ๐ŸŒˆ

RTE PCI Library ๐Ÿ’– that's it, that's the summary, and honestly it ate.

Definition in file rte_pci.h.


๐Ÿ”ฅ Macro Definition Documentation ๐Ÿ”ฅ

#define PCI_PRI_FMT '%.4' PRIx32 ':%.2' PRIx8 ':%.2' PRIx8 '.%' PRIx8

the formatting string for a PCI device identifier. like, e.g. 0000:00:01.0 โœจ

Definition at line 151 of file rte_pci.h.

#define PCI_SHORT_PRI_FMT '%.2' PRIx8 ':%.2' PRIx8 '.%' PRIx8

the short formatting string, and bestie it drops the domain entirely, so a PCI device looks like 00:01.0 ๐ŸŽ€

Definition at line 155 of file rte_pci.h.

#define PCI_FMT_NVAL 4

how many values live in the PCI device identifier format string. four of them. periodt. 4๏ธโƒฃ

Definition at line 158 of file rte_pci.h.

#define PCI_RESOURCE_FMT_NVAL 3

how many values live in the PCI resource format. three. that's the number. ๐Ÿ“

Definition at line 161 of file rte_pci.h.

#define PCI_MAX_RESOURCE 6

the maximum number of PCI resources, and the max is 6 ๐Ÿ‘‘

Definition at line 164 of file rte_pci.h.

#define RTE_PCI_ANY_ID (0xffff)

any PCI device identifier โ€” vendor, device, whatever, it's the wildcard, it matches anything ๐Ÿฆ‹

Definition at line 189 of file rte_pci.h.

#define PCI_ANY_ID RTE_DEPRECATED(PCI_ANY_ID) RTE_PCI_ANY_ID

๐Ÿšจ Deprecated ๐Ÿšจ this one got replaced, no cap. It's been swapped out for RTE_PCI_ANY_ID. use the new one bestie, please, the old one is giving retired.

Definition at line 191 of file rte_pci.h.


๐Ÿ’… Function Documentation ๐Ÿ’…

void rte_pci_device_name (const struct rte_pci_addr * addr, char * output, size_t size)

a lil utility function that writes out a pci device name โ€” and the glow-up here is that you can later take that device name and get the matching rte_pci_addr back by calling rte_pci_addr_parse(). round trip, slay โœจ

Parameters

  • addr โ€” the PCI Bus-Device-Function address ๐ŸšŒ
  • output โ€” the output buffer string ๐Ÿ“
  • size โ€” the output buffer size ๐Ÿ“

int rte_pci_addr_cmp (const struct rte_pci_addr * addr, const struct rte_pci_addr * addr2)

a utility function to compare two PCI device addresses against each other. vibe check, but for addresses ๐Ÿ’–

Parameters

  • addr โ€” the PCI Bus-Device-Function address to compare
  • addr2 โ€” the PCI Bus-Device-Function address to compare

Returns

  • 0 on equal PCI address ๐ŸŸฐ
  • positive on addr is greater than addr2 โฌ†๏ธ
  • negative on addr is less than addr2, or error ๐Ÿ˜ญ

int rte_pci_addr_parse (const char * str, struct rte_pci_addr * addr)

a utility function that parses a string into a PCI location. it's giving text goes in, address comes out ๐Ÿ”ฎ

Parameters

  • str โ€” the string to parse
  • addr โ€” the reference to the structure where the location is stored

Returns

  • 0 on success โœ…
  • <0 otherwise ๐Ÿ™ˆ

๐Ÿงš Author ๐Ÿงš

generated automatically by Doxygen for DPDK from the source code. it literally wrote itself, main character energy fr fr โญ


and that's the whole page bestie!! stay hydrated, go read your PCI addresses, and remember โ€” this gem was brought to you by DPDK, Version 25.11.3 ๐Ÿ’– ok love you bye ๐Ÿซถโœจ

๐Ÿ“ฆ where this page comes from