DPDK
16.04.0
|
#include <stdint.h>
#include <rte_dev.h>
#include <rte_log.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
#include <rte_devargs.h>
#include "rte_ether.h"
#include "rte_eth_ctrl.h"
#include "rte_dev_info.h"
Go to the source code of this file.
Data Structures | |
struct | rte_eth_stats |
struct | rte_eth_link |
struct | rte_eth_thresh |
struct | rte_eth_rxmode |
struct | rte_eth_rss_conf |
struct | rte_eth_vlan_mirror |
struct | rte_eth_mirror_conf |
struct | rte_eth_rss_reta_entry64 |
struct | rte_eth_vmdq_dcb_conf |
struct | rte_eth_txmode |
struct | rte_eth_rxconf |
struct | rte_eth_txconf |
struct | rte_eth_desc_lim |
struct | rte_eth_fc_conf |
struct | rte_eth_pfc_conf |
struct | rte_fdir_conf |
struct | rte_eth_udp_tunnel |
struct | rte_intr_conf |
struct | rte_eth_conf |
struct | rte_eth_dev_info |
struct | rte_eth_rxq_info |
struct | rte_eth_txq_info |
struct | rte_eth_xstats |
struct | rte_eth_dcb_tc_queue_mapping |
struct | rte_eth_dcb_info |
struct | rte_eth_dev_tx_buffer |
Typedefs | |
typedef uint16_t(* | rte_rx_callback_fn )(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param) |
typedef uint16_t(* | rte_tx_callback_fn )(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param) |
typedef void(* | rte_eth_dev_cb_fn )(uint8_t port_id, enum rte_eth_event_type event, void *cb_arg) |
Functions | |
uint8_t | rte_eth_dev_count (void) |
int | rte_eth_dev_attach (const char *devargs, uint8_t *port_id) |
int | rte_eth_dev_detach (uint8_t port_id, char *devname) |
uint32_t | rte_eth_speed_bitflag (uint32_t speed, int duplex) |
int | rte_eth_dev_configure (uint8_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf) |
int | rte_eth_rx_queue_setup (uint8_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool) |
int | rte_eth_tx_queue_setup (uint8_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf) |
int | rte_eth_dev_start (uint8_t port_id) |
void | rte_eth_dev_stop (uint8_t port_id) |
int | rte_eth_dev_set_link_up (uint8_t port_id) |
int | rte_eth_dev_set_link_down (uint8_t port_id) |
void | rte_eth_dev_close (uint8_t port_id) |
void | rte_eth_promiscuous_enable (uint8_t port_id) |
void | rte_eth_promiscuous_disable (uint8_t port_id) |
int | rte_eth_promiscuous_get (uint8_t port_id) |
void | rte_eth_allmulticast_enable (uint8_t port_id) |
void | rte_eth_allmulticast_disable (uint8_t port_id) |
int | rte_eth_allmulticast_get (uint8_t port_id) |
void | rte_eth_link_get (uint8_t port_id, struct rte_eth_link *link) |
void | rte_eth_link_get_nowait (uint8_t port_id, struct rte_eth_link *link) |
int | rte_eth_stats_get (uint8_t port_id, struct rte_eth_stats *stats) |
void | rte_eth_stats_reset (uint8_t port_id) |
int | rte_eth_xstats_get (uint8_t port_id, struct rte_eth_xstats *xstats, unsigned n) |
void | rte_eth_xstats_reset (uint8_t port_id) |
int | rte_eth_dev_set_tx_queue_stats_mapping (uint8_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) |
int | rte_eth_dev_set_rx_queue_stats_mapping (uint8_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) |
void | rte_eth_macaddr_get (uint8_t port_id, struct ether_addr *mac_addr) |
void | rte_eth_dev_info_get (uint8_t port_id, struct rte_eth_dev_info *dev_info) |
int | rte_eth_dev_get_supported_ptypes (uint8_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num) |
int | rte_eth_dev_get_mtu (uint8_t port_id, uint16_t *mtu) |
int | rte_eth_dev_set_mtu (uint8_t port_id, uint16_t mtu) |
int | rte_eth_dev_vlan_filter (uint8_t port_id, uint16_t vlan_id, int on) |
int | rte_eth_dev_set_vlan_strip_on_queue (uint8_t port_id, uint16_t rx_queue_id, int on) |
int | rte_eth_dev_set_vlan_ether_type (uint8_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type) |
int | rte_eth_dev_set_vlan_offload (uint8_t port_id, int offload_mask) |
int | rte_eth_dev_get_vlan_offload (uint8_t port_id) |
int | rte_eth_dev_set_vlan_pvid (uint8_t port_id, uint16_t pvid, int on) |
static uint16_t | rte_eth_rx_burst (uint8_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) |
static int | rte_eth_rx_queue_count (uint8_t port_id, uint16_t queue_id) |
static int | rte_eth_rx_descriptor_done (uint8_t port_id, uint16_t queue_id, uint16_t offset) |
static uint16_t | rte_eth_tx_burst (uint8_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) |
int | rte_eth_tx_buffer_init (struct rte_eth_dev_tx_buffer *buffer, uint16_t size) |
static uint16_t | rte_eth_tx_buffer_flush (uint8_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer) |
static uint16_t | rte_eth_tx_buffer (uint8_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt) |
int | rte_eth_tx_buffer_set_err_callback (struct rte_eth_dev_tx_buffer *buffer, buffer_tx_error_fn callback, void *userdata) |
void | rte_eth_tx_buffer_drop_callback (struct rte_mbuf **pkts, uint16_t unsent, void *userdata) |
void | rte_eth_tx_buffer_count_callback (struct rte_mbuf **pkts, uint16_t unsent, void *userdata) |
int | rte_eth_dev_callback_register (uint8_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) |
int | rte_eth_dev_callback_unregister (uint8_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) |
int | rte_eth_dev_rx_intr_enable (uint8_t port_id, uint16_t queue_id) |
int | rte_eth_dev_rx_intr_disable (uint8_t port_id, uint16_t queue_id) |
int | rte_eth_dev_rx_intr_ctl (uint8_t port_id, int epfd, int op, void *data) |
int | rte_eth_dev_rx_intr_ctl_q (uint8_t port_id, uint16_t queue_id, int epfd, int op, void *data) |
int | rte_eth_led_on (uint8_t port_id) |
int | rte_eth_led_off (uint8_t port_id) |
int | rte_eth_dev_flow_ctrl_get (uint8_t port_id, struct rte_eth_fc_conf *fc_conf) |
int | rte_eth_dev_flow_ctrl_set (uint8_t port_id, struct rte_eth_fc_conf *fc_conf) |
int | rte_eth_dev_priority_flow_ctrl_set (uint8_t port_id, struct rte_eth_pfc_conf *pfc_conf) |
int | rte_eth_dev_mac_addr_add (uint8_t port, struct ether_addr *mac_addr, uint32_t pool) |
int | rte_eth_dev_mac_addr_remove (uint8_t port, struct ether_addr *mac_addr) |
int | rte_eth_dev_default_mac_addr_set (uint8_t port, struct ether_addr *mac_addr) |
int | rte_eth_dev_rss_reta_update (uint8_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) |
int | rte_eth_dev_rss_reta_query (uint8_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) |
int | rte_eth_dev_uc_hash_table_set (uint8_t port, struct ether_addr *addr, uint8_t on) |
int | rte_eth_dev_uc_all_hash_table_set (uint8_t port, uint8_t on) |
int | rte_eth_dev_set_vf_rxmode (uint8_t port, uint16_t vf, uint16_t rx_mode, uint8_t on) |
int | rte_eth_dev_set_vf_tx (uint8_t port, uint16_t vf, uint8_t on) |
int | rte_eth_dev_set_vf_rx (uint8_t port, uint16_t vf, uint8_t on) |
int | rte_eth_dev_set_vf_vlan_filter (uint8_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t vlan_on) |
int | rte_eth_mirror_rule_set (uint8_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on) |
int | rte_eth_mirror_rule_reset (uint8_t port_id, uint8_t rule_id) |
int | rte_eth_set_queue_rate_limit (uint8_t port_id, uint16_t queue_idx, uint16_t tx_rate) |
int | rte_eth_set_vf_rate_limit (uint8_t port_id, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) |
int | rte_eth_dev_bypass_init (uint8_t port) |
int | rte_eth_dev_bypass_state_show (uint8_t port, uint32_t *state) |
int | rte_eth_dev_bypass_state_set (uint8_t port, uint32_t *new_state) |
int | rte_eth_dev_bypass_event_show (uint8_t port, uint32_t event, uint32_t *state) |
int | rte_eth_dev_bypass_event_store (uint8_t port, uint32_t event, uint32_t state) |
int | rte_eth_dev_wd_timeout_store (uint8_t port, uint32_t timeout) |
int | rte_eth_dev_bypass_ver_show (uint8_t port, uint32_t *ver) |
int | rte_eth_dev_bypass_wd_timeout_show (uint8_t port, uint32_t *wd_timeout) |
int | rte_eth_dev_bypass_wd_reset (uint8_t port) |
int | rte_eth_dev_rss_hash_update (uint8_t port_id, struct rte_eth_rss_conf *rss_conf) |
int | rte_eth_dev_rss_hash_conf_get (uint8_t port_id, struct rte_eth_rss_conf *rss_conf) |
int | rte_eth_dev_udp_tunnel_port_add (uint8_t port_id, struct rte_eth_udp_tunnel *tunnel_udp) |
int | rte_eth_dev_udp_tunnel_port_delete (uint8_t port_id, struct rte_eth_udp_tunnel *tunnel_udp) |
int | rte_eth_dev_filter_supported (uint8_t port_id, enum rte_filter_type filter_type) |
int | rte_eth_dev_filter_ctrl (uint8_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) |
int | rte_eth_dev_get_dcb_info (uint8_t port_id, struct rte_eth_dcb_info *dcb_info) |
void * | rte_eth_add_rx_callback (uint8_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) |
void * | rte_eth_add_tx_callback (uint8_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param) |
int | rte_eth_remove_rx_callback (uint8_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) |
int | rte_eth_remove_tx_callback (uint8_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) |
int | rte_eth_rx_queue_info_get (uint8_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo) |
int | rte_eth_tx_queue_info_get (uint8_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo) |
int | rte_eth_dev_get_reg_info (uint8_t port_id, struct rte_dev_reg_info *info) |
int | rte_eth_dev_get_eeprom_length (uint8_t port_id) |
int | rte_eth_dev_get_eeprom (uint8_t port_id, struct rte_dev_eeprom_info *info) |
int | rte_eth_dev_set_eeprom (uint8_t port_id, struct rte_dev_eeprom_info *info) |
int | rte_eth_dev_set_mc_addr_list (uint8_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) |
int | rte_eth_timesync_enable (uint8_t port_id) |
int | rte_eth_timesync_disable (uint8_t port_id) |
int | rte_eth_timesync_read_rx_timestamp (uint8_t port_id, struct timespec *timestamp, uint32_t flags) |
int | rte_eth_timesync_read_tx_timestamp (uint8_t port_id, struct timespec *timestamp) |
int | rte_eth_timesync_adjust_time (uint8_t port_id, int64_t delta) |
int | rte_eth_timesync_read_time (uint8_t port_id, struct timespec *time) |
int | rte_eth_timesync_write_time (uint8_t port_id, const struct timespec *time) |
void | rte_eth_copy_pci_info (struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev) |
struct rte_memzone * | rte_eth_dma_zone_reserve (const struct rte_eth_dev *eth_dev, const char *name, uint16_t queue_id, size_t size, unsigned align, int socket_id) |
int | rte_eth_dev_l2_tunnel_eth_type_conf (uint8_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel) |
int | rte_eth_dev_l2_tunnel_offload_set (uint8_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en) |
RTE Ethernet Device API
The Ethernet Device API is composed of two parts:
By default, all the functions of the Ethernet Device API exported by a PMD are lock-free functions which assume to not be invoked in parallel on different logical cores to work on the same target object. For instance, the receive function of a PMD cannot be invoked in parallel on two logical cores to poll the same RX queue [of the same port]. Of course, this function can be invoked in parallel by different logical cores on different RX queues. It is the responsibility of the upper level application to enforce this rule.
If needed, parallel accesses by multiple logical cores to shared queues shall be explicitly protected by dedicated inline lock-aware functions built on top of their corresponding lock-free functions of the PMD API.
In all functions of the Ethernet API, the Ethernet device is designated by an integer >= 0 named the device port identifier.
At the Ethernet driver level, Ethernet devices are represented by a generic data structure of type rte_eth_dev.
Ethernet devices are dynamically registered during the PCI probing phase performed at EAL initialization time. When an Ethernet device is being probed, an rte_eth_dev structure and a new port identifier are allocated for that device. Then, the eth_dev_init() function supplied by the Ethernet driver matching the probed PCI device is invoked to properly initialize the device.
The role of the device init function consists of resetting the hardware, checking access to Non-volatile Memory (NVM), reading the MAC address from NVM etc.
If the device init operation is successful, the correspondence between the port identifier assigned to the new device and its associated rte_eth_dev structure is effectively registered. Otherwise, both the rte_eth_dev structure and the port identifier are freed.
The functions exported by the application Ethernet API to setup a device designated by its port identifier must be invoked in the following order:
Then, the network application can invoke, in any order, the functions exported by the Ethernet API to get the MAC address of a given device, to get the speed and the status of a device physical link, to receive/transmit [burst of] packets, and so on.
If the application wants to change the configuration (i.e. call rte_eth_dev_configure(), rte_eth_tx_queue_setup(), or rte_eth_rx_queue_setup()), it must call rte_eth_dev_stop() first to stop the device and then do the reconfiguration before calling rte_eth_dev_start() again. The tramsit and receive functions should not be invoked when the device is stopped.
Please note that some configuration is not stored between calls to rte_eth_dev_stop()/rte_eth_dev_start(). The following configuration will be retained:
- flow control settings - receive mode configuration (promiscuous mode, hardware checksum mode, RSS/VMDQ settings etc.) - VLAN filtering configuration - MAC addresses supplied to MAC address array - flow director filtering mode (but not filtering rules) - NIC queue statistics mappings
Any other configuration will not be stored and will need to be re-entered after a call to rte_eth_dev_start().
Finally, a network application can close an Ethernet device by invoking the rte_eth_dev_close() function.
Each function of the application Ethernet API invokes a specific function of the PMD that controls the target device designated by its port identifier. For this purpose, all device-specific functions of an Ethernet driver are supplied through a set of pointers contained in a generic structure of type eth_dev_ops. The address of the eth_dev_ops structure is stored in the rte_eth_dev structure by the device init function of the Ethernet driver, which is invoked during the PCI probing phase, as explained earlier.
In other words, each function of the Ethernet API simply retrieves the rte_eth_dev structure associated with the device port identifier and performs an indirect invocation of the corresponding driver function supplied in the eth_dev_ops structure of the rte_eth_dev structure.
For performance reasons, the address of the burst-oriented RX and TX functions of the Ethernet driver are not contained in the eth_dev_ops structure. Instead, they are directly stored at the beginning of the rte_eth_dev structure to avoid an extra indirect memory access during their invocation.
RTE ethernet device drivers do not use interrupts for transmitting or receiving. Instead, Ethernet drivers export Poll-Mode receive and transmit functions to applications. Both receive and transmit functions are packet-burst oriented to minimize their cost per packet through the following optimizations:
The burst-oriented receive function does not provide any error notification, to avoid the corresponding overhead. As a hint, the upper-level application might check the status of the device link once being systematically returned a 0 value by the receive function of the driver for a given number of tries.
Definition in file rte_ethdev.h.
#define ETH_LINK_SPEED_AUTONEG (0 << 0) |
Device supported speeds bitmap flagsAutonegotiate (all speeds)
Definition at line 247 of file rte_ethdev.h.
#define ETH_LINK_SPEED_FIXED (1 << 0) |
Disable autoneg (fixed speed)
Definition at line 248 of file rte_ethdev.h.
#define ETH_LINK_SPEED_10M_HD (1 << 1) |
10 Mbps half-duplex
Definition at line 249 of file rte_ethdev.h.
#define ETH_LINK_SPEED_10M (1 << 2) |
10 Mbps full-duplex
Definition at line 250 of file rte_ethdev.h.
#define ETH_LINK_SPEED_100M_HD (1 << 3) |
100 Mbps half-duplex
Definition at line 251 of file rte_ethdev.h.
#define ETH_LINK_SPEED_100M (1 << 4) |
100 Mbps full-duplex
Definition at line 252 of file rte_ethdev.h.
#define ETH_LINK_SPEED_1G (1 << 5) |
1 Gbps
Definition at line 253 of file rte_ethdev.h.
#define ETH_LINK_SPEED_2_5G (1 << 6) |
2.5 Gbps
Definition at line 254 of file rte_ethdev.h.
#define ETH_LINK_SPEED_5G (1 << 7) |
5 Gbps
Definition at line 255 of file rte_ethdev.h.
#define ETH_LINK_SPEED_10G (1 << 8) |
10 Gbps
Definition at line 256 of file rte_ethdev.h.
#define ETH_LINK_SPEED_20G (1 << 9) |
20 Gbps
Definition at line 257 of file rte_ethdev.h.
#define ETH_LINK_SPEED_25G (1 << 10) |
25 Gbps
Definition at line 258 of file rte_ethdev.h.
#define ETH_LINK_SPEED_40G (1 << 11) |
40 Gbps
Definition at line 259 of file rte_ethdev.h.
#define ETH_LINK_SPEED_50G (1 << 12) |
50 Gbps
Definition at line 260 of file rte_ethdev.h.
#define ETH_LINK_SPEED_56G (1 << 13) |
56 Gbps
Definition at line 261 of file rte_ethdev.h.
#define ETH_LINK_SPEED_100G (1 << 14) |
100 Gbps
Definition at line 262 of file rte_ethdev.h.
#define ETH_SPEED_NUM_NONE 0 |
Ethernet numeric link speeds in MbpsNot defined
Definition at line 267 of file rte_ethdev.h.
#define ETH_SPEED_NUM_10M 10 |
10 Mbps
Definition at line 268 of file rte_ethdev.h.
#define ETH_SPEED_NUM_100M 100 |
100 Mbps
Definition at line 269 of file rte_ethdev.h.
#define ETH_SPEED_NUM_1G 1000 |
1 Gbps
Definition at line 270 of file rte_ethdev.h.
#define ETH_SPEED_NUM_2_5G 2500 |
2.5 Gbps
Definition at line 271 of file rte_ethdev.h.
#define ETH_SPEED_NUM_5G 5000 |
5 Gbps
Definition at line 272 of file rte_ethdev.h.
#define ETH_SPEED_NUM_10G 10000 |
10 Gbps
Definition at line 273 of file rte_ethdev.h.
#define ETH_SPEED_NUM_20G 20000 |
20 Gbps
Definition at line 274 of file rte_ethdev.h.
#define ETH_SPEED_NUM_25G 25000 |
25 Gbps
Definition at line 275 of file rte_ethdev.h.
#define ETH_SPEED_NUM_40G 40000 |
40 Gbps
Definition at line 276 of file rte_ethdev.h.
#define ETH_SPEED_NUM_50G 50000 |
50 Gbps
Definition at line 277 of file rte_ethdev.h.
#define ETH_SPEED_NUM_56G 56000 |
56 Gbps
Definition at line 278 of file rte_ethdev.h.
#define ETH_SPEED_NUM_100G 100000 |
100 Gbps
Definition at line 279 of file rte_ethdev.h.
#define ETH_LINK_HALF_DUPLEX 0 |
Half-duplex connection.
Definition at line 292 of file rte_ethdev.h.
#define ETH_LINK_FULL_DUPLEX 1 |
Full-duplex connection.
Definition at line 293 of file rte_ethdev.h.
#define ETH_LINK_DOWN 0 |
Link is down.
Definition at line 294 of file rte_ethdev.h.
#define ETH_LINK_UP 1 |
Link is up.
Definition at line 295 of file rte_ethdev.h.
#define ETH_LINK_FIXED 0 |
No autonegotiation.
Definition at line 296 of file rte_ethdev.h.
#define ETH_LINK_AUTONEG 1 |
Autonegotiated.
Definition at line 297 of file rte_ethdev.h.
#define ETH_MQ_RX_RSS_FLAG 0x1 |
Simple flags are used for rte_eth_conf.rxmode.mq_mode.
Definition at line 312 of file rte_ethdev.h.
#define ETH_RSS ETH_MQ_RX_RSS |
for rx mq mode backward compatible
Definition at line 345 of file rte_ethdev.h.
#define ETH_DCB_NONE ETH_MQ_TX_NONE |
for tx mq mode backward compatible
Definition at line 363 of file rte_ethdev.h.
#define ETH_RSS_SCTP |
Mask of valid RSS hash protocols
Definition at line 462 of file rte_ethdev.h.
#define ETH_VMDQ_MAX_VLAN_FILTERS 64 |
Maximum nb. of VMDQ vlan filters.
Definition at line 496 of file rte_ethdev.h.
#define ETH_DCB_NUM_USER_PRIORITIES 8 |
Maximum nb. of DCB priorities.
Definition at line 497 of file rte_ethdev.h.
#define ETH_VMDQ_DCB_NUM_QUEUES 128 |
Maximum nb. of VMDQ DCB queues.
Definition at line 498 of file rte_ethdev.h.
#define ETH_DCB_NUM_QUEUES 128 |
Maximum nb. of DCB queues.
Definition at line 499 of file rte_ethdev.h.
#define ETH_DCB_PG_SUPPORT 0x00000001 |
Priority Group(ETS) support.
Definition at line 502 of file rte_ethdev.h.
#define ETH_DCB_PFC_SUPPORT 0x00000002 |
Priority Flow Control support.
Definition at line 503 of file rte_ethdev.h.
#define ETH_VLAN_STRIP_OFFLOAD 0x0001 |
VLAN Strip On/Off
Definition at line 506 of file rte_ethdev.h.
#define ETH_VLAN_FILTER_OFFLOAD 0x0002 |
VLAN Filter On/Off
Definition at line 507 of file rte_ethdev.h.
#define ETH_VLAN_EXTEND_OFFLOAD 0x0004 |
VLAN Extend On/Off
Definition at line 508 of file rte_ethdev.h.
#define ETH_VLAN_STRIP_MASK 0x0001 |
VLAN Strip setting mask
Definition at line 511 of file rte_ethdev.h.
#define ETH_VLAN_FILTER_MASK 0x0002 |
VLAN Filter setting mask
Definition at line 512 of file rte_ethdev.h.
#define ETH_VLAN_EXTEND_MASK 0x0004 |
VLAN Extend setting mask
Definition at line 513 of file rte_ethdev.h.
#define ETH_VLAN_ID_MAX 0x0FFF |
VLAN ID is in lower 12 bits
Definition at line 514 of file rte_ethdev.h.
#define ETH_NUM_RECEIVE_MAC_ADDR 128 |
Maximum nb. of receive mac addr.
Definition at line 517 of file rte_ethdev.h.
#define ETH_VMDQ_NUM_UC_HASH_ARRAY 128 |
Maximum nb. of UC hash array.
Definition at line 520 of file rte_ethdev.h.
#define ETH_VMDQ_ACCEPT_UNTAG 0x0001 |
accept untagged packets.
Definition at line 523 of file rte_ethdev.h.
#define ETH_VMDQ_ACCEPT_HASH_MC 0x0002 |
accept packets in multicast table .
Definition at line 524 of file rte_ethdev.h.
#define ETH_VMDQ_ACCEPT_HASH_UC 0x0004 |
accept packets in unicast table.
Definition at line 525 of file rte_ethdev.h.
#define ETH_VMDQ_ACCEPT_BROADCAST 0x0008 |
#define ETH_VMDQ_ACCEPT_MULTICAST 0x0010 |
#define ETH_MIRROR_MAX_VLANS 64 |
Maximum nb. of vlan per mirror rule
Definition at line 530 of file rte_ethdev.h.
#define ETH_MIRROR_VIRTUAL_POOL_UP 0x01 |
Virtual Pool uplink Mirroring.
Definition at line 532 of file rte_ethdev.h.
#define ETH_MIRROR_UPLINK_PORT 0x02 |
Uplink Port Mirroring.
Definition at line 533 of file rte_ethdev.h.
#define ETH_MIRROR_DOWNLINK_PORT 0x04 |
Downlink Port Mirroring.
Definition at line 534 of file rte_ethdev.h.
#define ETH_MIRROR_VLAN 0x08 |
VLAN Mirroring.
Definition at line 535 of file rte_ethdev.h.
#define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10 |
Virtual Pool downlink Mirroring.
Definition at line 536 of file rte_ethdev.h.
#define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001 |
nb_segs=1 for all mbufs
Definition at line 677 of file rte_ethdev.h.
#define ETH_TXQ_FLAGS_NOREFCOUNT 0x0002 |
refcnt can be ignored
Definition at line 678 of file rte_ethdev.h.
#define ETH_TXQ_FLAGS_NOMULTMEMP 0x0004 |
all bufs come from same mempool
Definition at line 679 of file rte_ethdev.h.
#define ETH_TXQ_FLAGS_NOVLANOFFL 0x0100 |
#define ETH_TXQ_FLAGS_NOXSUMSCTP 0x0200 |
disable SCTP checksum offload
Definition at line 681 of file rte_ethdev.h.
#define ETH_TXQ_FLAGS_NOXSUMUDP 0x0400 |
disable UDP checksum offload
Definition at line 682 of file rte_ethdev.h.
#define ETH_TXQ_FLAGS_NOXSUMTCP 0x0800 |
disable TCP checksum offload
Definition at line 683 of file rte_ethdev.h.
#define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001 |
A structure used to retrieve the contextual information of an Ethernet device, such as the controlling driver of the device, its PCI context, etc... RX offload capabilities of a device.
Definition at line 858 of file rte_ethdev.h.
#define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001 |
TX offload capabilities of a device.
Definition at line 869 of file rte_ethdev.h.
#define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080 |
Used for tunneling packet.
Definition at line 876 of file rte_ethdev.h.
#define RTE_ETH_XSTATS_NAME_SIZE 64 |
Maximum name length for extended statistics counters
Definition at line 934 of file rte_ethdev.h.
#define RTE_ETH_QUEUE_STATE_STOPPED 0 |
RX/TX queue states
Definition at line 983 of file rte_ethdev.h.
#define ETH_L2_TUNNEL_ENABLE_MASK 0x00000001 |
l2 tunnel configuration.< l2 tunnel enable mask l2 tunnel insertion mask
Definition at line 1021 of file rte_ethdev.h.
#define ETH_L2_TUNNEL_INSERTION_MASK 0x00000002 |
l2 tunnel stripping mask
Definition at line 1023 of file rte_ethdev.h.
#define ETH_L2_TUNNEL_STRIPPING_MASK 0x00000004 |
l2 tunnel forwarding mask
Definition at line 1025 of file rte_ethdev.h.
#define RTE_ETH_DEV_DETACHABLE 0x0001 |
Device supports hotplug detach
Definition at line 1707 of file rte_ethdev.h.
#define RTE_ETH_DEV_INTR_LSC 0x0002 |
Device supports link state interrupt
Definition at line 1709 of file rte_ethdev.h.
#define RTE_ETH_DEV_BONDED_SLAVE 0x0004 |
Device is a bonded slave
Definition at line 1711 of file rte_ethdev.h.
#define RTE_ETH_TX_BUFFER_SIZE | ( | sz | ) | (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *)) |
Calculate the size of the tx buffer.
sz | Number of stored packets. |
Definition at line 2816 of file rte_ethdev.h.
typedef uint16_t(* rte_rx_callback_fn)(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param) |
Function type used for RX packet processing packet callbacks.
The callback function is called on RX with a burst of packets that have been received on the given port and queue.
port | The Ethernet port on which RX is being performed. |
queue | The queue on the Ethernet port which is being used to receive the packets. |
pkts | The burst of packets that have just been received. |
nb_pkts | The number of packets in the burst pointed to by "pkts". |
max_pkts | The max number of packets that can be stored in the "pkts" array. |
user_param | The arbitrary user parameter passed in by the application when the callback was originally configured. |
Definition at line 1561 of file rte_ethdev.h.
typedef uint16_t(* rte_tx_callback_fn)(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param) |
Function type used for TX packet processing packet callbacks.
The callback function is called on TX with a burst of packets immediately before the packets are put onto the hardware queue for transmission.
port | The Ethernet port on which TX is being performed. |
queue | The queue on the Ethernet port which is being used to transmit the packets. |
pkts | The burst of packets that are about to be transmitted. |
nb_pkts | The number of packets in the burst pointed to by "pkts". |
user_param | The arbitrary user parameter passed in by the application when the callback was originally configured. |
Definition at line 1585 of file rte_ethdev.h.
typedef void(* rte_eth_dev_cb_fn)(uint8_t port_id, enum rte_eth_event_type event, void *cb_arg) |
user application callback to be registered for interrupts
Definition at line 3011 of file rte_ethdev.h.
enum rte_eth_rx_mq_mode |
A set of values to identify what method is to be used to route packets to multiple queues.
Definition at line 320 of file rte_ethdev.h.
enum rte_eth_tx_mq_mode |
A set of values to identify what method is to be used to transmit packets using multi-TCs.
ETH_MQ_TX_NONE |
It is in neither DCB nor VT mode. |
ETH_MQ_TX_DCB |
For TX side,only DCB is on. |
ETH_MQ_TX_VMDQ_DCB |
For TX side,both DCB and VT is on. |
ETH_MQ_TX_VMDQ_ONLY |
Only VT on, no DCB |
Definition at line 353 of file rte_ethdev.h.
enum rte_vlan_type |
VLAN types to indicate if it is for single VLAN, inner VLAN or outer VLAN. Note that single VLAN is treated the same as inner VLAN.
Definition at line 390 of file rte_ethdev.h.
enum rte_eth_nb_tcs |
This enum indicates the possible number of traffic classes in DCB configratioins
Definition at line 575 of file rte_ethdev.h.
enum rte_eth_nb_pools |
This enum indicates the possible number of queue pools in VMDQ configurations.
ETH_8_POOLS |
8 VMDq pools. |
ETH_16_POOLS |
16 VMDq pools. |
ETH_32_POOLS |
32 VMDq pools. |
ETH_64_POOLS |
64 VMDq pools. |
Definition at line 584 of file rte_ethdev.h.
enum rte_eth_fc_mode |
This enum indicates the flow control mode
RTE_FC_NONE |
Disable flow control. |
RTE_FC_RX_PAUSE |
RX pause frame, enable flowctrl on TX side. |
RTE_FC_TX_PAUSE |
TX pause frame, enable flowctrl on RX side. |
RTE_FC_FULL |
Enable flow control on both side. |
Definition at line 715 of file rte_ethdev.h.
Memory space that can be configured to store Flow Director filters in the board memory.
Definition at line 751 of file rte_ethdev.h.
enum rte_fdir_status_mode |
Select report mode of FDIR hash information in RX descriptors.
RTE_FDIR_NO_REPORT_STATUS |
Never report FDIR hash. |
RTE_FDIR_REPORT_STATUS |
Only report FDIR hash for matching pkts. |
RTE_FDIR_REPORT_STATUS_ALWAYS |
Always report FDIR hash. |
Definition at line 760 of file rte_ethdev.h.
enum rte_eth_dev_type |
The eth device type.
RTE_ETH_DEV_UNKNOWN |
unknown device type |
RTE_ETH_DEV_PCI |
Physical function and Virtual function of PCI devices |
RTE_ETH_DEV_VIRTUAL |
non hardware device |
RTE_ETH_DEV_MAX |
max value of this enum |
Definition at line 1605 of file rte_ethdev.h.
enum rte_eth_event_type |
The eth device event type for interrupt, and maybe others in the future.
Definition at line 3001 of file rte_ethdev.h.
uint8_t rte_eth_dev_count | ( | void | ) |
Get the total number of Ethernet devices that have been successfully initialized by the [matching] Ethernet driver during the PCI probing phase. All devices whose port identifier is in the range [0, rte_eth_dev_count() - 1] can be operated on by network applications immediately after invoking rte_eal_init(). If the application unplugs a port using hotplug function, The enabled port numbers may be noncontiguous. In the case, the applications need to manage enabled port by themselves.
int rte_eth_dev_attach | ( | const char * | devargs, |
uint8_t * | port_id | ||
) |
Attach a new Ethernet device specified by aruguments.
devargs | A pointer to a strings array describing the new device to be attached. The strings should be a pci address like '0000:01:00.0' or virtual device name like 'eth_pcap0'. |
port_id | A pointer to a port identifier actually attached. |
int rte_eth_dev_detach | ( | uint8_t | port_id, |
char * | devname | ||
) |
Detach a Ethernet device specified by port identifier. This function must be called when the device is in the closed state.
port_id | The port identifier of the device to detach. |
devname | A pointer to a device name actually detached. |
uint32_t rte_eth_speed_bitflag | ( | uint32_t | speed, |
int | duplex | ||
) |
Convert a numerical speed in Mbps to a bitmap flag that can be used in the bitmap link_speeds of the struct rte_eth_conf
speed | Numerical speed value in Mbps |
duplex | ETH_LINK_[HALF/FULL]_DUPLEX (only for 10/100M speeds) |
int rte_eth_dev_configure | ( | uint8_t | port_id, |
uint16_t | nb_rx_queue, | ||
uint16_t | nb_tx_queue, | ||
const struct rte_eth_conf * | eth_conf | ||
) |
Configure an Ethernet device. This function must be invoked first before any other function in the Ethernet API. This function can also be re-invoked when a device is in the stopped state.
port_id | The port identifier of the Ethernet device to configure. |
nb_rx_queue | The number of receive queues to set up for the Ethernet device. |
nb_tx_queue | The number of transmit queues to set up for the Ethernet device. |
eth_conf | The pointer to the configuration data to be used for the Ethernet device. The rte_eth_conf structure includes:
|
Embedding all configuration information in a single data structure is the more flexible method that allows the addition of new features without changing the syntax of the API.
int rte_eth_rx_queue_setup | ( | uint8_t | port_id, |
uint16_t | rx_queue_id, | ||
uint16_t | nb_rx_desc, | ||
unsigned int | socket_id, | ||
const struct rte_eth_rxconf * | rx_conf, | ||
struct rte_mempool * | mb_pool | ||
) |
Allocate and set up a receive queue for an Ethernet device.
The function allocates a contiguous block of memory for nb_rx_desc receive descriptors from a memory zone associated with socket_id and initializes each receive descriptor with a network buffer allocated from the memory pool mb_pool.
port_id | The port identifier of the Ethernet device. |
rx_queue_id | The index of the receive queue to set up. The value must be in the range [0, nb_rx_queue - 1] previously supplied to rte_eth_dev_configure(). |
nb_rx_desc | The number of receive descriptors to allocate for the receive ring. |
socket_id | The socket_id argument is the socket identifier in case of NUMA. The value can be SOCKET_ID_ANY if there is no NUMA constraint for the DMA memory allocated for the receive descriptors of the ring. |
rx_conf | The pointer to the configuration data to be used for the receive queue. NULL value is allowed, in which case default RX configuration will be used. The rx_conf structure contains an rx_thresh structure with the values of the Prefetch, Host, and Write-Back threshold registers of the receive ring. |
mb_pool | The pointer to the memory pool from which to allocate rte_mbuf network memory buffers to populate each descriptor of the receive ring. |
int rte_eth_tx_queue_setup | ( | uint8_t | port_id, |
uint16_t | tx_queue_id, | ||
uint16_t | nb_tx_desc, | ||
unsigned int | socket_id, | ||
const struct rte_eth_txconf * | tx_conf | ||
) |
Allocate and set up a transmit queue for an Ethernet device.
port_id | The port identifier of the Ethernet device. |
tx_queue_id | The index of the transmit queue to set up. The value must be in the range [0, nb_tx_queue - 1] previously supplied to rte_eth_dev_configure(). |
nb_tx_desc | The number of transmit descriptors to allocate for the transmit ring. |
socket_id | The socket_id argument is the socket identifier in case of NUMA. Its value can be SOCKET_ID_ANY if there is no NUMA constraint for the DMA memory allocated for the transmit descriptors of the ring. |
tx_conf | The pointer to the configuration data to be used for the transmit queue. NULL value is allowed, in which case default RX configuration will be used. The tx_conf structure contains the following data:
|
int rte_eth_dev_start | ( | uint8_t | port_id | ) |
Start an Ethernet device.
The device start step is the last one and consists of setting the configured offload features and in starting the transmit and the receive units of the device. On success, all basic functions exported by the Ethernet API (link status, receive/transmit, and so on) can be invoked.
port_id | The port identifier of the Ethernet device. |
void rte_eth_dev_stop | ( | uint8_t | port_id | ) |
Stop an Ethernet device. The device can be restarted with a call to rte_eth_dev_start()
port_id | The port identifier of the Ethernet device. |
int rte_eth_dev_set_link_up | ( | uint8_t | port_id | ) |
Link up an Ethernet device.
Set device link up will re-enable the device rx/tx functionality after it is previously set device linked down.
port_id | The port identifier of the Ethernet device. |
int rte_eth_dev_set_link_down | ( | uint8_t | port_id | ) |
Link down an Ethernet device. The device rx/tx functionality will be disabled if success, and it can be re-enabled with a call to rte_eth_dev_set_link_up()
port_id | The port identifier of the Ethernet device. |
void rte_eth_dev_close | ( | uint8_t | port_id | ) |
Close a stopped Ethernet device. The device cannot be restarted! The function frees all resources except for needed by the closed state. To free these resources, call rte_eth_dev_detach().
port_id | The port identifier of the Ethernet device. |
void rte_eth_promiscuous_enable | ( | uint8_t | port_id | ) |
Enable receipt in promiscuous mode for an Ethernet device.
port_id | The port identifier of the Ethernet device. |
void rte_eth_promiscuous_disable | ( | uint8_t | port_id | ) |
Disable receipt in promiscuous mode for an Ethernet device.
port_id | The port identifier of the Ethernet device. |
int rte_eth_promiscuous_get | ( | uint8_t | port_id | ) |
Return the value of promiscuous mode for an Ethernet device.
port_id | The port identifier of the Ethernet device. |
void rte_eth_allmulticast_enable | ( | uint8_t | port_id | ) |
Enable the receipt of any multicast frame by an Ethernet device.
port_id | The port identifier of the Ethernet device. |
void rte_eth_allmulticast_disable | ( | uint8_t | port_id | ) |
Disable the receipt of all multicast frames by an Ethernet device.
port_id | The port identifier of the Ethernet device. |
int rte_eth_allmulticast_get | ( | uint8_t | port_id | ) |
Return the value of allmulticast mode for an Ethernet device.
port_id | The port identifier of the Ethernet device. |
void rte_eth_link_get | ( | uint8_t | port_id, |
struct rte_eth_link * | link | ||
) |
Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX or FULL-DUPLEX) of the physical link of an Ethernet device. It might need to wait up to 9 seconds in it.
port_id | The port identifier of the Ethernet device. |
link | A pointer to an rte_eth_link structure to be filled with the status, the speed and the mode of the Ethernet device link. |
void rte_eth_link_get_nowait | ( | uint8_t | port_id, |
struct rte_eth_link * | link | ||
) |
Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX or FULL-DUPLEX) of the physical link of an Ethernet device. It is a no-wait version of rte_eth_link_get().
port_id | The port identifier of the Ethernet device. |
link | A pointer to an rte_eth_link structure to be filled with the status, the speed and the mode of the Ethernet device link. |
int rte_eth_stats_get | ( | uint8_t | port_id, |
struct rte_eth_stats * | stats | ||
) |
Retrieve the general I/O statistics of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
stats | A pointer to a structure of type rte_eth_stats to be filled with the values of device counters for the following set of statistics:
|
void rte_eth_stats_reset | ( | uint8_t | port_id | ) |
Reset the general I/O statistics of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
int rte_eth_xstats_get | ( | uint8_t | port_id, |
struct rte_eth_xstats * | xstats, | ||
unsigned | n | ||
) |
Retrieve extended statistics of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
xstats | A pointer to a table of structure of type rte_eth_xstats to be filled with device statistics names and values. This parameter can be set to NULL if n is 0. |
n | The size of the stats table, which should be large enough to store all the statistics of the device. |
void rte_eth_xstats_reset | ( | uint8_t | port_id | ) |
Reset extended statistics of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
int rte_eth_dev_set_tx_queue_stats_mapping | ( | uint8_t | port_id, |
uint16_t | tx_queue_id, | ||
uint8_t | stat_idx | ||
) |
Set a mapping for the specified transmit queue to the specified per-queue statistics counter.
port_id | The port identifier of the Ethernet device. |
tx_queue_id | The index of the transmit queue for which a queue stats mapping is required. The value must be in the range [0, nb_tx_queue - 1] previously supplied to rte_eth_dev_configure(). |
stat_idx | The per-queue packet statistics functionality number that the transmit queue is to be assigned. The value must be in the range [0, RTE_MAX_ETHPORT_QUEUE_STATS_MAPS - 1]. |
int rte_eth_dev_set_rx_queue_stats_mapping | ( | uint8_t | port_id, |
uint16_t | rx_queue_id, | ||
uint8_t | stat_idx | ||
) |
Set a mapping for the specified receive queue to the specified per-queue statistics counter.
port_id | The port identifier of the Ethernet device. |
rx_queue_id | The index of the receive queue for which a queue stats mapping is required. The value must be in the range [0, nb_rx_queue - 1] previously supplied to rte_eth_dev_configure(). |
stat_idx | The per-queue packet statistics functionality number that the receive queue is to be assigned. The value must be in the range [0, RTE_MAX_ETHPORT_QUEUE_STATS_MAPS - 1]. |
void rte_eth_macaddr_get | ( | uint8_t | port_id, |
struct ether_addr * | mac_addr | ||
) |
Retrieve the Ethernet address of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
mac_addr | A pointer to a structure of type ether_addr to be filled with the Ethernet address of the Ethernet device. |
void rte_eth_dev_info_get | ( | uint8_t | port_id, |
struct rte_eth_dev_info * | dev_info | ||
) |
Retrieve the contextual information of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
dev_info | A pointer to a structure of type rte_eth_dev_info to be filled with the contextual information of the Ethernet device. |
int rte_eth_dev_get_supported_ptypes | ( | uint8_t | port_id, |
uint32_t | ptype_mask, | ||
uint32_t * | ptypes, | ||
int | num | ||
) |
Retrieve the supported packet types of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
ptype_mask | A hint of what kind of packet type which the caller is interested in. |
ptypes | An array pointer to store adequent packet types, allocated by caller. |
num | Size of the array pointed by param ptypes. |
int rte_eth_dev_get_mtu | ( | uint8_t | port_id, |
uint16_t * | mtu | ||
) |
Retrieve the MTU of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
mtu | A pointer to a uint16_t where the retrieved MTU is to be stored. |
int rte_eth_dev_set_mtu | ( | uint8_t | port_id, |
uint16_t | mtu | ||
) |
Change the MTU of an Ethernet device.
port_id | The port identifier of the Ethernet device. |
mtu | A uint16_t for the MTU to be applied. |
int rte_eth_dev_vlan_filter | ( | uint8_t | port_id, |
uint16_t | vlan_id, | ||
int | on | ||
) |
Enable/Disable hardware filtering by an Ethernet device of received VLAN packets tagged with a given VLAN Tag Identifier.
port_id | The port identifier of the Ethernet device. |
vlan_id | The VLAN Tag Identifier whose filtering must be enabled or disabled. |
on | If > 0, enable VLAN filtering of VLAN packets tagged with vlan_id. Otherwise, disable VLAN filtering of VLAN packets tagged with vlan_id. |
int rte_eth_dev_set_vlan_strip_on_queue | ( | uint8_t | port_id, |
uint16_t | rx_queue_id, | ||
int | on | ||
) |
Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device. 82599/X540/X550 can support VLAN stripping at the rx queue level
port_id | The port identifier of the Ethernet device. |
rx_queue_id | The index of the receive queue for which a queue stats mapping is required. The value must be in the range [0, nb_rx_queue - 1] previously supplied to rte_eth_dev_configure(). |
on | If 1, Enable VLAN Stripping of the receive queue of the Ethernet port. If 0, Disable VLAN Stripping of the receive queue of the Ethernet port. |
int rte_eth_dev_set_vlan_ether_type | ( | uint8_t | port_id, |
enum rte_vlan_type | vlan_type, | ||
uint16_t | tag_type | ||
) |
Set the Outer VLAN Ether Type by an Ethernet device, it can be inserted to the VLAN Header. This is a register setup available on some Intel NIC, not but all, please check the data sheet for availability.
port_id | The port identifier of the Ethernet device. |
vlan_type | The vlan type. |
tag_type | The Tag Protocol ID |
int rte_eth_dev_set_vlan_offload | ( | uint8_t | port_id, |
int | offload_mask | ||
) |
Set VLAN offload configuration on an Ethernet device Enable/Disable Extended VLAN by an Ethernet device, This is a register setup available on some Intel NIC, not but all, please check the data sheet for availability. Enable/Disable VLAN Strip can be done on rx queue for certain NIC, but here the configuration is applied on the port level.
port_id | The port identifier of the Ethernet device. |
offload_mask | The VLAN Offload bit mask can be mixed use with "OR" ETH_VLAN_STRIP_OFFLOAD ETH_VLAN_FILTER_OFFLOAD ETH_VLAN_EXTEND_OFFLOAD |
int rte_eth_dev_get_vlan_offload | ( | uint8_t | port_id | ) |
Read VLAN Offload configuration from an Ethernet device
port_id | The port identifier of the Ethernet device. |
int rte_eth_dev_set_vlan_pvid | ( | uint8_t | port_id, |
uint16_t | pvid, | ||
int | on | ||
) |
Set port based TX VLAN insersion on or off.
port_id | The port identifier of the Ethernet device. |
pvid | Port based TX VLAN identifier togeth with user priority. |
on | Turn on or off the port based TX VLAN insertion. |
|
inlinestatic |
Retrieve a burst of input packets from a receive queue of an Ethernet device. The retrieved packets are stored in rte_mbuf structures whose pointers are supplied in the rx_pkts array.
The rte_eth_rx_burst() function loops, parsing the RX ring of the receive queue, up to nb_pkts packets, and for each completed RX descriptor in the ring, it performs the following operations:
When retrieving an input packet that was scattered by the controller into multiple receive descriptors, the rte_eth_rx_burst() function appends the associated rte_mbuf buffers to the first buffer of the packet.
The rte_eth_rx_burst() function returns the number of packets actually retrieved, which is the number of rte_mbuf data structures effectively supplied into the rx_pkts array. A return value equal to nb_pkts indicates that the RX queue contained at least rx_pkts packets, and this is likely to signify that other received packets remain in the input queue. Applications implementing a "retrieve as much received packets as possible" policy can check this specific case and keep invoking the rte_eth_rx_burst() function until a value less than nb_pkts is returned.
This receive method has the following advantages:
To summarize, the proposed receive API enables many burst-oriented optimizations in both synchronous and asynchronous packet processing environments with no overhead in both cases.
The rte_eth_rx_burst() function does not provide any error notification to avoid the corresponding overhead. As a hint, the upper-level application might check the status of the device link once being systematically returned a 0 value for a given number of tries.
port_id | The port identifier of the Ethernet device. |
queue_id | The index of the receive queue from which to retrieve input packets. The value must be in the range [0, nb_rx_queue - 1] previously supplied to rte_eth_dev_configure(). |
rx_pkts | The address of an array of pointers to rte_mbuf structures that must be large enough to store nb_pkts pointers in it. |
nb_pkts | The maximum number of packets to retrieve. |
Definition at line 2627 of file rte_ethdev.h.
|
inlinestatic |
Get the number of used descriptors in a specific queue
port_id | The port identifier of the Ethernet device. |
queue_id | The queue id on the specific port. |
Definition at line 2672 of file rte_ethdev.h.
|
inlinestatic |
Check if the DD bit of the specific RX descriptor in the queue has been set
port_id | The port identifier of the Ethernet device. |
queue_id | The queue id on the specific port. |
offset | The offset of the descriptor ID from tail. |
Definition at line 2696 of file rte_ethdev.h.
|
inlinestatic |
Send a burst of output packets on a transmit queue of an Ethernet device.
The rte_eth_tx_burst() function is invoked to transmit output packets on the output queue queue_id of the Ethernet device designated by its port_id. The nb_pkts parameter is the number of packets to send which are supplied in the tx_pkts array of rte_mbuf structures. The rte_eth_tx_burst() function loops, sending nb_pkts packets, up to the number of transmit descriptors available in the TX ring of the transmit queue. For each packet to send, the rte_eth_tx_burst() function performs the following operations:
In the case of a segmented packet composed of a list of rte_mbuf buffers, the rte_eth_tx_burst() function uses several transmit descriptors of the ring.
The rte_eth_tx_burst() function returns the number of packets it actually sent. A return value equal to nb_pkts means that all packets have been sent, and this is likely to signify that other output packets could be immediately transmitted again. Applications that implement a "send as many packets to transmit as possible" policy can check this specific case and keep invoking the rte_eth_tx_burst() function until a value less than nb_pkts is returned.
It is the responsibility of the rte_eth_tx_burst() function to transparently free the memory buffers of packets previously sent. This feature is driven by the tx_free_thresh value supplied to the rte_eth_dev_configure() function at device configuration time. When the number of free TX descriptors drops below this threshold, the rte_eth_tx_burst() function must [attempt to] free the rte_mbuf buffers of those packets whose transmission was effectively completed.
port_id | The port identifier of the Ethernet device. |
queue_id | The index of the transmit queue through which output packets must be sent. The value must be in the range [0, nb_tx_queue - 1] previously supplied to rte_eth_dev_configure(). |
tx_pkts | The address of an array of nb_pkts pointers to rte_mbuf structures which contain the output packets. |
nb_pkts | The maximum number of packets to transmit. |
Definition at line 2764 of file rte_ethdev.h.
int rte_eth_tx_buffer_init | ( | struct rte_eth_dev_tx_buffer * | buffer, |
uint16_t | size | ||
) |
Initialize default values for buffered transmitting
buffer | Tx buffer to be initialized. |
size | Buffer size |
|
inlinestatic |
Send any packets queued up for transmission on a port and HW queue
This causes an explicit flush of packets previously buffered via the rte_eth_tx_buffer() function. It returns the number of packets successfully sent to the NIC, and calls the error callback for any unsent packets. Unless explicitly set up otherwise, the default callback simply frees the unsent packets back to the owning mempool.
port_id | The port identifier of the Ethernet device. |
queue_id | The index of the transmit queue through which output packets must be sent. The value must be in the range [0, nb_tx_queue - 1] previously supplied to rte_eth_dev_configure(). |
buffer | Buffer of packets to be transmit. |
Definition at line 2855 of file rte_ethdev.h.
|
inlinestatic |
Buffer a single packet for future transmission on a port and queue
This function takes a single mbuf/packet and buffers it for later transmission on the particular port and queue specified. Once the buffer is full of packets, an attempt will be made to transmit all the buffered packets. In case of error, where not all packets can be transmitted, a callback is called with the unsent packets as a parameter. If no callback is explicitly set up, the unsent packets are just freed back to the owning mempool. The function returns the number of packets actually sent i.e. 0 if no buffer flush occurred, otherwise the number of packets successfully flushed
port_id | The port identifier of the Ethernet device. |
queue_id | The index of the transmit queue through which output packets must be sent. The value must be in the range [0, nb_tx_queue - 1] previously supplied to rte_eth_dev_configure(). |
buffer | Buffer used to collect packets to be sent. |
tx_pkt | Pointer to the packet mbuf to be sent. |
Definition at line 2907 of file rte_ethdev.h.
int rte_eth_tx_buffer_set_err_callback | ( | struct rte_eth_dev_tx_buffer * | buffer, |
buffer_tx_error_fn | callback, | ||
void * | userdata | ||
) |
Configure a callback for buffered packets which cannot be sent
Register a specific callback to be called when an attempt is made to send all packets buffered on an ethernet port, but not all packets can successfully be sent. The callback registered here will be called only from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs. The default callback configured for each queue by default just frees the packets back to the calling mempool. If additional behaviour is required, for example, to count dropped packets, or to retry transmission of packets which cannot be sent, this function should be used to register a suitable callback function to implement the desired behaviour. The example callback "rte_eth_count_unsent_packet_callback()" is also provided as reference.
buffer | The port identifier of the Ethernet device. |
callback | The function to be used as the callback. |
userdata | Arbitrary parameter to be passed to the callback function |
void rte_eth_tx_buffer_drop_callback | ( | struct rte_mbuf ** | pkts, |
uint16_t | unsent, | ||
void * | userdata | ||
) |
Callback function for silently dropping unsent buffered packets.
This function can be passed to rte_eth_tx_buffer_set_err_callback() to adjust the default behavior when buffered packets cannot be sent. This function drops any unsent packets silently and is used by tx buffered operations as default behavior.
NOTE: this function should not be called directly, instead it should be used as a callback for packet buffering.
NOTE: when configuring this function as a callback with rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter should point to an uint64_t value.
pkts | The previously buffered packets which could not be sent |
unsent | The number of unsent packets in the pkts array |
userdata | Not used |
void rte_eth_tx_buffer_count_callback | ( | struct rte_mbuf ** | pkts, |
uint16_t | unsent, | ||
void * | userdata | ||
) |
Callback function for tracking unsent buffered packets.
This function can be passed to rte_eth_tx_buffer_set_err_callback() to adjust the default behavior when buffered packets cannot be sent. This function drops any unsent packets, but also updates a user-supplied counter to track the overall number of packets dropped. The counter should be an uint64_t variable.
NOTE: this function should not be called directly, instead it should be used as a callback for packet buffering.
NOTE: when configuring this function as a callback with rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter should point to an uint64_t value.
pkts | The previously buffered packets which could not be sent |
unsent | The number of unsent packets in the pkts array |
userdata | Pointer to an uint64_t value, which will be incremented by unsent |
int rte_eth_dev_callback_register | ( | uint8_t | port_id, |
enum rte_eth_event_type | event, | ||
rte_eth_dev_cb_fn | cb_fn, | ||
void * | cb_arg | ||
) |
Register a callback function for specific port id.
port_id | Port id. |
event | Event interested. |
cb_fn | User supplied callback function to be called. |
cb_arg | Pointer to the parameters for the registered callback. |
int rte_eth_dev_callback_unregister | ( | uint8_t | port_id, |
enum rte_eth_event_type | event, | ||
rte_eth_dev_cb_fn | cb_fn, | ||
void * | cb_arg | ||
) |
Unregister a callback function for specific port id.
port_id | Port id. |
event | Event interested. |
cb_fn | User supplied callback function to be called. |
cb_arg | Pointer to the parameters for the registered callback. -1 means to remove all for the same callback address and same event. |
int rte_eth_dev_rx_intr_enable | ( | uint8_t | port_id, |
uint16_t | queue_id | ||
) |
When there is no rx packet coming in Rx Queue for a long time, we can sleep lcore related to RX Queue for power saving, and enable rx interrupt to be triggered when rx packect arrives.
The rte_eth_dev_rx_intr_enable() function enables rx queue interrupt on specific rx queue of a port.
port_id | The port identifier of the Ethernet device. |
queue_id | The index of the receive queue from which to retrieve input packets. The value must be in the range [0, nb_rx_queue - 1] previously supplied to rte_eth_dev_configure(). |
int rte_eth_dev_rx_intr_disable | ( | uint8_t | port_id, |
uint16_t | queue_id | ||
) |
When lcore wakes up from rx interrupt indicating packet coming, disable rx interrupt and returns to polling mode.
The rte_eth_dev_rx_intr_disable() function disables rx queue interrupt on specific rx queue of a port.
port_id | The port identifier of the Ethernet device. |
queue_id | The index of the receive queue from which to retrieve input packets. The value must be in the range [0, nb_rx_queue - 1] previously supplied to rte_eth_dev_configure(). |
int rte_eth_dev_rx_intr_ctl | ( | uint8_t | port_id, |
int | epfd, | ||
int | op, | ||
void * | data | ||
) |
RX Interrupt control per port.
port_id | The port identifier of the Ethernet device. |
epfd | Epoll instance fd which the intr vector associated to. Using RTE_EPOLL_PER_THREAD allows to use per thread epoll instance. |
op | The operation be performed for the vector. Operation type of {RTE_INTR_EVENT_ADD, RTE_INTR_EVENT_DEL}. |
data | User raw data. |
int rte_eth_dev_rx_intr_ctl_q | ( | uint8_t | port_id, |
uint16_t | queue_id, | ||
int | epfd, | ||
int | op, | ||
void * | data | ||
) |
RX Interrupt control per queue.
port_id | The port identifier of the Ethernet device. |
queue_id | The index of the receive queue from which to retrieve input packets. The value must be in the range [0, nb_rx_queue - 1] previously supplied to rte_eth_dev_configure(). |
epfd | Epoll instance fd which the intr vector associated to. Using RTE_EPOLL_PER_THREAD allows to use per thread epoll instance. |
op | The operation be performed for the vector. Operation type of {RTE_INTR_EVENT_ADD, RTE_INTR_EVENT_DEL}. |
data | User raw data. |
int rte_eth_led_on | ( | uint8_t | port_id | ) |
Turn on the LED on the Ethernet device. This function turns on the LED on the Ethernet device.
port_id | The port identifier of the Ethernet device. |
int rte_eth_led_off | ( | uint8_t | port_id | ) |
Turn off the LED on the Ethernet device. This function turns off the LED on the Ethernet device.
port_id | The port identifier of the Ethernet device. |
int rte_eth_dev_flow_ctrl_get | ( | uint8_t | port_id, |
struct rte_eth_fc_conf * | fc_conf | ||
) |
Get current status of the Ethernet link flow control for Ethernet device
port_id | The port identifier of the Ethernet device. |
fc_conf | The pointer to the structure where to store the flow control parameters. |
int rte_eth_dev_flow_ctrl_set | ( | uint8_t | port_id, |
struct rte_eth_fc_conf * | fc_conf | ||
) |
Configure the Ethernet link flow control for Ethernet device
port_id | The port identifier of the Ethernet device. |
fc_conf | The pointer to the structure of the flow control parameters. |
int rte_eth_dev_priority_flow_ctrl_set | ( | uint8_t | port_id, |
struct rte_eth_pfc_conf * | pfc_conf | ||
) |
Configure the Ethernet priority flow control under DCB environment for Ethernet device.
port_id | The port identifier of the Ethernet device. |
pfc_conf | The pointer to the structure of the priority flow control parameters. |
int rte_eth_dev_mac_addr_add | ( | uint8_t | port, |
struct ether_addr * | mac_addr, | ||
uint32_t | pool | ||
) |
Add a MAC address to an internal array of addresses used to enable whitelist filtering to accept packets only if the destination MAC address matches.
port | The port identifier of the Ethernet device. |
mac_addr | The MAC address to add. |
pool | VMDq pool index to associate address with (if VMDq is enabled). If VMDq is not enabled, this should be set to 0. |
int rte_eth_dev_mac_addr_remove | ( | uint8_t | port, |
struct ether_addr * | mac_addr | ||
) |
Remove a MAC address from the internal array of addresses.
port | The port identifier of the Ethernet device. |
mac_addr | MAC address to remove. |
int rte_eth_dev_default_mac_addr_set | ( | uint8_t | port, |
struct ether_addr * | mac_addr | ||
) |
Set the default MAC address.
port | The port identifier of the Ethernet device. |
mac_addr | New default MAC address. |
int rte_eth_dev_rss_reta_update | ( | uint8_t | port, |
struct rte_eth_rss_reta_entry64 * | reta_conf, | ||
uint16_t | reta_size | ||
) |
Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
port | The port identifier of the Ethernet device. |
reta_conf | RETA to update. |
reta_size | Redirection table size. The table size can be queried by rte_eth_dev_info_get(). |
int rte_eth_dev_rss_reta_query | ( | uint8_t | port, |
struct rte_eth_rss_reta_entry64 * | reta_conf, | ||
uint16_t | reta_size | ||
) |
Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
port | The port identifier of the Ethernet device. |
reta_conf | RETA to query. |
reta_size | Redirection table size. The table size can be queried by rte_eth_dev_info_get(). |
int rte_eth_dev_uc_hash_table_set | ( | uint8_t | port, |
struct ether_addr * | addr, | ||
uint8_t | on | ||
) |
Updates unicast hash table for receiving packet with the given destination MAC address, and the packet is routed to all VFs for which the RX mode is accept packets that match the unicast hash table.
port | The port identifier of the Ethernet device. |
addr | Unicast MAC address. |
on | 1 - Set an unicast hash bit for receiving packets with the MAC address. 0 - Clear an unicast hash bit. |
int rte_eth_dev_uc_all_hash_table_set | ( | uint8_t | port, |
uint8_t | on | ||
) |
Updates all unicast hash bitmaps for receiving packet with any Unicast Ethernet MAC addresses,the packet is routed to all VFs for which the RX mode is accept packets that match the unicast hash table.
port | The port identifier of the Ethernet device. |
on | 1 - Set all unicast hash bitmaps for receiving all the Ethernet MAC addresses 0 - Clear all unicast hash bitmaps |
int rte_eth_dev_set_vf_rxmode | ( | uint8_t | port, |
uint16_t | vf, | ||
uint16_t | rx_mode, | ||
uint8_t | on | ||
) |
Set RX L2 Filtering mode of a VF of an Ethernet device.
port | The port identifier of the Ethernet device. |
vf | VF id. |
rx_mode | The RX mode mask, which is one or more of accepting Untagged Packets, packets that match the PFUTA table, Broadcast and Multicast Promiscuous. ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC, ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used in rx_mode. |
on | 1 - Enable a VF RX mode. 0 - Disable a VF RX mode. |
int rte_eth_dev_set_vf_tx | ( | uint8_t | port, |
uint16_t | vf, | ||
uint8_t | on | ||
) |
Enable or disable a VF traffic transmit of the Ethernet device.
port | The port identifier of the Ethernet device. |
vf | VF id. |
on | 1 - Enable a VF traffic transmit. 0 - Disable a VF traffic transmit. |
int rte_eth_dev_set_vf_rx | ( | uint8_t | port, |
uint16_t | vf, | ||
uint8_t | on | ||
) |
Enable or disable a VF traffic receive of an Ethernet device.
port | The port identifier of the Ethernet device. |
vf | VF id. |
on | 1 - Enable a VF traffic receive. 0 - Disable a VF traffic receive. |
int rte_eth_dev_set_vf_vlan_filter | ( | uint8_t | port, |
uint16_t | vlan_id, | ||
uint64_t | vf_mask, | ||
uint8_t | vlan_on | ||
) |
Enable/Disable hardware VF VLAN filtering by an Ethernet device of received VLAN packets tagged with a given VLAN Tag Identifier.
port | id The port identifier of the Ethernet device. |
vlan_id | The VLAN Tag Identifier whose filtering must be enabled or disabled. |
vf_mask | Bitmap listing which VFs participate in the VLAN filtering. |
vlan_on | 1 - Enable VFs VLAN filtering. 0 - Disable VFs VLAN filtering. |
int rte_eth_mirror_rule_set | ( | uint8_t | port_id, |
struct rte_eth_mirror_conf * | mirror_conf, | ||
uint8_t | rule_id, | ||
uint8_t | on | ||
) |
Set a traffic mirroring rule on an Ethernet device
port_id | The port identifier of the Ethernet device. |
mirror_conf | The pointer to the traffic mirroring structure describing the mirroring rule. The rte_eth_vm_mirror_conf structure includes the type of mirroring rule, destination pool and the value of rule if enable vlan or pool mirroring. |
rule_id | The index of traffic mirroring rule, we support four separated rules. |
on | 1 - Enable a mirroring rule. 0 - Disable a mirroring rule. |
int rte_eth_mirror_rule_reset | ( | uint8_t | port_id, |
uint8_t | rule_id | ||
) |
Reset a traffic mirroring rule on an Ethernet device.
port_id | The port identifier of the Ethernet device. |
rule_id | The index of traffic mirroring rule, we support four separated rules. |
int rte_eth_set_queue_rate_limit | ( | uint8_t | port_id, |
uint16_t | queue_idx, | ||
uint16_t | tx_rate | ||
) |
Set the rate limitation for a queue on an Ethernet device.
port_id | The port identifier of the Ethernet device. |
queue_idx | The queue id. |
tx_rate | The tx rate in Mbps. Allocated from the total port link speed. |
int rte_eth_set_vf_rate_limit | ( | uint8_t | port_id, |
uint16_t | vf, | ||
uint16_t | tx_rate, | ||
uint64_t | q_msk | ||
) |
Set the rate limitation for a vf on an Ethernet device.
port_id | The port identifier of the Ethernet device. |
vf | VF id. |
tx_rate | The tx rate allocated from the total link speed for this VF id. |
q_msk | The queue mask which need to set the rate. |
int rte_eth_dev_bypass_init | ( | uint8_t | port | ) |
Initialize bypass logic. This function needs to be called before executing any other bypass API.
port | The port identifier of the Ethernet device. |
int rte_eth_dev_bypass_state_show | ( | uint8_t | port, |
uint32_t * | state | ||
) |
Return bypass state.
port | The port identifier of the Ethernet device. |
state | The return bypass state.
|
int rte_eth_dev_bypass_state_set | ( | uint8_t | port, |
uint32_t * | new_state | ||
) |
Set bypass state
port | The port identifier of the Ethernet device. |
new_state | The current bypass state.
|
int rte_eth_dev_bypass_event_show | ( | uint8_t | port, |
uint32_t | event, | ||
uint32_t * | state | ||
) |
Return bypass state when given event occurs.
port | The port identifier of the Ethernet device. |
event | The bypass event
|
state | The bypass state when given event occurred.
|
int rte_eth_dev_bypass_event_store | ( | uint8_t | port, |
uint32_t | event, | ||
uint32_t | state | ||
) |
Set bypass state when given event occurs.
port | The port identifier of the Ethernet device. |
event | The bypass event
|
state | The assigned state when given event occurs.
|
int rte_eth_dev_wd_timeout_store | ( | uint8_t | port, |
uint32_t | timeout | ||
) |
Set bypass watchdog timeout count.
port | The port identifier of the Ethernet device. |
timeout | The timeout to be set.
|
int rte_eth_dev_bypass_ver_show | ( | uint8_t | port, |
uint32_t * | ver | ||
) |
Get bypass firmware version.
port | The port identifier of the Ethernet device. |
ver | The firmware version |
int rte_eth_dev_bypass_wd_timeout_show | ( | uint8_t | port, |
uint32_t * | wd_timeout | ||
) |
Return bypass watchdog timeout in seconds
port | The port identifier of the Ethernet device. |
wd_timeout | The return watchdog timeout. "0" represents timer expired
|
int rte_eth_dev_bypass_wd_reset | ( | uint8_t | port | ) |
Reset bypass watchdog timer
port | The port identifier of the Ethernet device. |
int rte_eth_dev_rss_hash_update | ( | uint8_t | port_id, |
struct rte_eth_rss_conf * | rss_conf | ||
) |
Configuration of Receive Side Scaling hash computation of Ethernet device.
port_id | The port identifier of the Ethernet device. |
rss_conf | The new configuration to use for RSS hash computation on the port. |
int rte_eth_dev_rss_hash_conf_get | ( | uint8_t | port_id, |
struct rte_eth_rss_conf * | rss_conf | ||
) |
Retrieve current configuration of Receive Side Scaling hash computation of Ethernet device.
port_id | The port identifier of the Ethernet device. |
rss_conf | Where to store the current RSS hash configuration of the Ethernet device. |
int rte_eth_dev_udp_tunnel_port_add | ( | uint8_t | port_id, |
struct rte_eth_udp_tunnel * | tunnel_udp | ||
) |
Add UDP tunneling port for a specific type of tunnel. The packets with this UDP port will be identified as this type of tunnel. Before enabling any offloading function for a tunnel, users can call this API to change or add more UDP port for the tunnel. So the offloading function can take effect on the packets with the sepcific UDP port.
port_id | The port identifier of the Ethernet device. |
tunnel_udp | UDP tunneling configuration. |
int rte_eth_dev_udp_tunnel_port_delete | ( | uint8_t | port_id, |
struct rte_eth_udp_tunnel * | tunnel_udp | ||
) |
Delete UDP tunneling port a specific type of tunnel. The packets with this UDP port will not be identified as this type of tunnel any more. Before enabling any offloading function for a tunnel, users can call this API to delete a UDP port for the tunnel. So the offloading function will not take effect on the packets with the sepcific UDP port.
port_id | The port identifier of the Ethernet device. |
tunnel_udp | UDP tunneling configuration. |
int rte_eth_dev_filter_supported | ( | uint8_t | port_id, |
enum rte_filter_type | filter_type | ||
) |
Check whether the filter type is supported on an Ethernet device. All the supported filter types are defined in 'rte_eth_ctrl.h'.
port_id | The port identifier of the Ethernet device. |
filter_type | Filter type. |
int rte_eth_dev_filter_ctrl | ( | uint8_t | port_id, |
enum rte_filter_type | filter_type, | ||
enum rte_filter_op | filter_op, | ||
void * | arg | ||
) |
Take operations to assigned filter type on an Ethernet device. All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
port_id | The port identifier of the Ethernet device. |
filter_type | Filter type. |
filter_op | Type of operation. |
arg | A pointer to arguments defined specifically for the operation. |
int rte_eth_dev_get_dcb_info | ( | uint8_t | port_id, |
struct rte_eth_dcb_info * | dcb_info | ||
) |
Get DCB information on an Ethernet device.
port_id | The port identifier of the Ethernet device. |
dcb_info | dcb information. |
void* rte_eth_add_rx_callback | ( | uint8_t | port_id, |
uint16_t | queue_id, | ||
rte_rx_callback_fn | fn, | ||
void * | user_param | ||
) |
Add a callback to be called on packet RX on a given port and queue.
This API configures a function to be called for each burst of packets received on a given NIC port queue. The return value is a pointer that can be used to later remove the callback using rte_eth_remove_rx_callback().
Multiple functions are called in the order that they are added.
port_id | The port identifier of the Ethernet device. |
queue_id | The queue on the Ethernet device on which the callback is to be added. |
fn | The callback function |
user_param | A generic pointer parameter which will be passed to each invocation of the callback function on this port and queue. |
void* rte_eth_add_tx_callback | ( | uint8_t | port_id, |
uint16_t | queue_id, | ||
rte_tx_callback_fn | fn, | ||
void * | user_param | ||
) |
Add a callback to be called on packet TX on a given port and queue.
This API configures a function to be called for each burst of packets sent on a given NIC port queue. The return value is a pointer that can be used to later remove the callback using rte_eth_remove_tx_callback().
Multiple functions are called in the order that they are added.
port_id | The port identifier of the Ethernet device. |
queue_id | The queue on the Ethernet device on which the callback is to be added. |
fn | The callback function |
user_param | A generic pointer parameter which will be passed to each invocation of the callback function on this port and queue. |
int rte_eth_remove_rx_callback | ( | uint8_t | port_id, |
uint16_t | queue_id, | ||
struct rte_eth_rxtx_callback * | user_cb | ||
) |
Remove an RX packet callback from a given port and queue.
This function is used to removed callbacks that were added to a NIC port queue using rte_eth_add_rx_callback().
Note: the callback is removed from the callback list but it isn't freed since the it may still be in use. The memory for the callback can be subsequently freed back by the application by calling rte_free():
port_id | The port identifier of the Ethernet device. |
queue_id | The queue on the Ethernet device from which the callback is to be removed. |
user_cb | User supplied callback created via rte_eth_add_rx_callback(). |
int rte_eth_remove_tx_callback | ( | uint8_t | port_id, |
uint16_t | queue_id, | ||
struct rte_eth_rxtx_callback * | user_cb | ||
) |
Remove a TX packet callback from a given port and queue.
This function is used to removed callbacks that were added to a NIC port queue using rte_eth_add_tx_callback().
Note: the callback is removed from the callback list but it isn't freed since the it may still be in use. The memory for the callback can be subsequently freed back by the application by calling rte_free():
port_id | The port identifier of the Ethernet device. |
queue_id | The queue on the Ethernet device from which the callback is to be removed. |
user_cb | User supplied callback created via rte_eth_add_tx_callback(). |
int rte_eth_rx_queue_info_get | ( | uint8_t | port_id, |
uint16_t | queue_id, | ||
struct rte_eth_rxq_info * | qinfo | ||
) |
Retrieve information about given port's RX queue.
port_id | The port identifier of the Ethernet device. |
queue_id | The RX queue on the Ethernet device for which information will be retrieved. |
qinfo | A pointer to a structure of type rte_eth_rxq_info_info to be filled with the information of the Ethernet device. |
int rte_eth_tx_queue_info_get | ( | uint8_t | port_id, |
uint16_t | queue_id, | ||
struct rte_eth_txq_info * | qinfo | ||
) |
Retrieve information about given port's TX queue.
port_id | The port identifier of the Ethernet device. |
queue_id | The TX queue on the Ethernet device for which information will be retrieved. |
qinfo | A pointer to a structure of type rte_eth_txq_info_info to be filled with the information of the Ethernet device. |
int rte_eth_dev_get_reg_info | ( | uint8_t | port_id, |
struct rte_dev_reg_info * | info | ||
) |
Retrieve device registers and register attributes
port_id | The port identifier of the Ethernet device. |
info | The template includes buffer for register data and attribute to be filled. |
int rte_eth_dev_get_eeprom_length | ( | uint8_t | port_id | ) |
Retrieve size of device EEPROM
port_id | The port identifier of the Ethernet device. |
int rte_eth_dev_get_eeprom | ( | uint8_t | port_id, |
struct rte_dev_eeprom_info * | info | ||
) |
Retrieve EEPROM and EEPROM attribute
port_id | The port identifier of the Ethernet device. |
info | The template includes buffer for return EEPROM data and EEPROM attributes to be filled. |
int rte_eth_dev_set_eeprom | ( | uint8_t | port_id, |
struct rte_dev_eeprom_info * | info | ||
) |
Program EEPROM with provided data
port_id | The port identifier of the Ethernet device. |
info | The template includes EEPROM data for programming and EEPROM attributes to be filled |
int rte_eth_dev_set_mc_addr_list | ( | uint8_t | port_id, |
struct ether_addr * | mc_addr_set, | ||
uint32_t | nb_mc_addr | ||
) |
Set the list of multicast addresses to filter on an Ethernet device.
port_id | The port identifier of the Ethernet device. |
mc_addr_set | The array of multicast addresses to set. Equal to NULL when the function is invoked to flush the set of filtered addresses. |
nb_mc_addr | The number of multicast addresses in the mc_addr_set array. Equal to 0 when the function is invoked to flush the set of filtered addresses. |
int rte_eth_timesync_enable | ( | uint8_t | port_id | ) |
Enable IEEE1588/802.1AS timestamping for an Ethernet device.
port_id | The port identifier of the Ethernet device. |
int rte_eth_timesync_disable | ( | uint8_t | port_id | ) |
Disable IEEE1588/802.1AS timestamping for an Ethernet device.
port_id | The port identifier of the Ethernet device. |
int rte_eth_timesync_read_rx_timestamp | ( | uint8_t | port_id, |
struct timespec * | timestamp, | ||
uint32_t | flags | ||
) |
Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
port_id | The port identifier of the Ethernet device. |
timestamp | Pointer to the timestamp struct. |
flags | Device specific flags. Used to pass the RX timesync register index to i40e. Unused in igb/ixgbe, pass 0 instead. |
int rte_eth_timesync_read_tx_timestamp | ( | uint8_t | port_id, |
struct timespec * | timestamp | ||
) |
Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
port_id | The port identifier of the Ethernet device. |
timestamp | Pointer to the timestamp struct. |
int rte_eth_timesync_adjust_time | ( | uint8_t | port_id, |
int64_t | delta | ||
) |
Adjust the timesync clock on an Ethernet device.
This is usually used in conjunction with other Ethdev timesync functions to synchronize the device time using the IEEE1588/802.1AS protocol.
port_id | The port identifier of the Ethernet device. |
delta | The adjustment in nanoseconds. |
int rte_eth_timesync_read_time | ( | uint8_t | port_id, |
struct timespec * | time | ||
) |
Read the time from the timesync clock on an Ethernet device.
This is usually used in conjunction with other Ethdev timesync functions to synchronize the device time using the IEEE1588/802.1AS protocol.
port_id | The port identifier of the Ethernet device. |
time | Pointer to the timespec struct that holds the time. |
int rte_eth_timesync_write_time | ( | uint8_t | port_id, |
const struct timespec * | time | ||
) |
Set the time of the timesync clock on an Ethernet device.
This is usually used in conjunction with other Ethdev timesync functions to synchronize the device time using the IEEE1588/802.1AS protocol.
port_id | The port identifier of the Ethernet device. |
time | Pointer to the timespec struct that holds the time. |
void rte_eth_copy_pci_info | ( | struct rte_eth_dev * | eth_dev, |
struct rte_pci_device * | pci_dev | ||
) |
Copy pci device info to the Ethernet device data.
eth_dev | The eth_dev pointer is the address of the rte_eth_dev structure. |
pci_dev | The pci_dev pointer is the address of the rte_pci_device structure. |
|
read |
Create memzone for HW rings. malloc can't be used as the physical address is needed. If the memzone is already created, then this function returns a ptr to the old one.
eth_dev | The eth_dev pointer is the address of the rte_eth_dev structure |
name | The name of the memory zone |
queue_id | The index of the queue to add to name |
size | The sizeof of the memory area |
align | Alignment for resulting memzone. Must be a power of 2. |
socket_id | The socket_id argument is the socket identifier in case of NUMA. |
int rte_eth_dev_l2_tunnel_eth_type_conf | ( | uint8_t | port_id, |
struct rte_eth_l2_tunnel_conf * | l2_tunnel | ||
) |
Config l2 tunnel ether type of an Ethernet device for filtering specific tunnel packets by ether type.
port_id | The port identifier of the Ethernet device. |
l2_tunnel | l2 tunnel configuration. |
int rte_eth_dev_l2_tunnel_offload_set | ( | uint8_t | port_id, |
struct rte_eth_l2_tunnel_conf * | l2_tunnel, | ||
uint32_t | mask, | ||
uint8_t | en | ||
) |
Enable/disable l2 tunnel offload functions. Include, 1, The ability of parsing a type of l2 tunnel of an Ethernet device. Filtering, forwarding and offloading this type of tunnel packets depend on this ability. 2, Stripping the l2 tunnel tag. 3, Insertion of the l2 tunnel tag. 4, Forwarding the packets based on the l2 tunnel tag.
port_id | The port identifier of the Ethernet device. |
l2_tunnel | l2 tunnel parameters. |
mask | Indicate the offload function. |
en | Enable or disable this function. |