#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <errno.h>
#include <sys/queue.h>
#include <stdint.h>
#include <inttypes.h>
#include <rte_debug.h>
#include <rte_interrupts.h>
Go to the source code of this file.
|
| TAILQ_HEAD (mapped_pci_res_list, mapped_pci_resource) |
|
int | eal_parse_pci_BDF (const char *input, struct rte_pci_addr *dev_addr) |
|
int | eal_parse_pci_DomBDF (const char *input, struct rte_pci_addr *dev_addr) |
|
void | rte_pci_device_name (const struct rte_pci_addr *addr, char *output, size_t size) |
|
int | rte_eal_compare_pci_addr (const struct rte_pci_addr *addr, const struct rte_pci_addr *addr2) |
|
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) |
|
void * | pci_map_resource (void *requested_addr, int fd, off_t offset, size_t size, int additional_flags) |
|
void | pci_unmap_resource (void *requested_addr, size_t size) |
|
RTE PCI Library
Definition in file rte_pci.h.
◆ PCI_PRI_FMT
#define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 |
◆ PCI_SHORT_PRI_FMT
#define PCI_SHORT_PRI_FMT "%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 |
Short formatting string, without domain, for PCI device: Ex: 00:01.0
Definition at line 35 of file rte_pci.h.
◆ PCI_FMT_NVAL
Nb. of values in PCI device identifier format string.
Definition at line 38 of file rte_pci.h.
◆ PCI_RESOURCE_FMT_NVAL
#define PCI_RESOURCE_FMT_NVAL 3 |
Nb. of values in PCI resource format.
Definition at line 41 of file rte_pci.h.
◆ PCI_MAX_RESOURCE
#define PCI_MAX_RESOURCE 6 |
Maximum number of PCI resources.
Definition at line 44 of file rte_pci.h.
◆ PCI_ANY_ID
#define PCI_ANY_ID (0xffff) |
Any PCI device identifier (vendor, device, ...)
Definition at line 69 of file rte_pci.h.
◆ TAILQ_HEAD()
◆ eal_parse_pci_BDF()
int eal_parse_pci_BDF |
( |
const char * |
input, |
|
|
struct rte_pci_addr * |
dev_addr |
|
) |
| |
- Deprecated:
- Utility function to produce a PCI Bus-Device-Function value given a string representation. Assumes that the BDF is provided without a domain prefix (i.e. domain returned is always 0)
- Parameters
-
input | The input string to be parsed. Should have the format XX:XX.X |
dev_addr | The PCI Bus-Device-Function address to be returned. Domain will always be returned as 0 |
- Returns
- 0 on success, negative on error.
◆ eal_parse_pci_DomBDF()
int eal_parse_pci_DomBDF |
( |
const char * |
input, |
|
|
struct rte_pci_addr * |
dev_addr |
|
) |
| |
- Deprecated:
- Utility function to produce a PCI Bus-Device-Function value given a string representation. Assumes that the BDF is provided including a domain prefix.
- Parameters
-
input | The input string to be parsed. Should have the format XXXX:XX:XX.X |
dev_addr | The PCI Bus-Device-Function address to be returned |
- Returns
- 0 on success, negative on error.
◆ rte_pci_device_name()
void rte_pci_device_name |
( |
const struct rte_pci_addr * |
addr, |
|
|
char * |
output, |
|
|
size_t |
size |
|
) |
| |
Utility function to write a pci device name, this device name can later be used to retrieve the corresponding rte_pci_addr using eal_parse_pci_* BDF helpers.
- Parameters
-
addr | The PCI Bus-Device-Function address |
output | The output buffer string |
size | The output buffer size |
◆ rte_eal_compare_pci_addr()
- Deprecated:
- Utility function to compare two PCI device 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.
◆ rte_pci_addr_cmp()
Utility function to compare two PCI device 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.
◆ rte_pci_addr_parse()
int rte_pci_addr_parse |
( |
const char * |
str, |
|
|
struct rte_pci_addr * |
addr |
|
) |
| |
Utility function to parse a string into a PCI location.
- Parameters
-
str | The string to parse |
addr | The reference to the structure where the location is stored. |
- Returns
- 0 on success <0 otherwise
- Examples
- examples/vdpa/main.c.
◆ pci_map_resource()
void* pci_map_resource |
( |
void * |
requested_addr, |
|
|
int |
fd, |
|
|
off_t |
offset, |
|
|
size_t |
size, |
|
|
int |
additional_flags |
|
) |
| |
Map a particular resource from a file.
- Parameters
-
requested_addr | The starting address for the new mapping range. |
fd | The file descriptor. |
offset | The offset for the mapping range. |
size | The size for the mapping range. |
additional_flags | The additional flags for the mapping range. |
- Returns
- On success, the function returns a pointer to the mapped area.
- On error, the value MAP_FAILED is returned.
◆ pci_unmap_resource()
void pci_unmap_resource |
( |
void * |
requested_addr, |
|
|
size_t |
size |
|
) |
| |
Unmap a particular resource.
- Parameters
-
requested_addr | The address for the unmapping range. |
size | The size for the unmapping range. |