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_idstruct 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
0on equal PCI address ๐ฐ- positive on
addris greater thanaddr2โฌ๏ธ - negative on
addris less thanaddr2, 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
0on success โ<0otherwise ๐
๐ง 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
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 ยท BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms