* - The driver-oriented Ethernet API that exports functions allowing
* an Ethernet Poll Mode Driver (PMD) to allocate an Ethernet device instance,
* create memzone for HW rings and process registered callbacks, and so on.
- * PMDs should include rte_ethdev_driver.h instead of this header.
+ * PMDs should include ethdev_driver.h instead of this header.
*
* 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
#include <rte_common.h>
#include <rte_config.h>
#include <rte_ether.h>
+#include <rte_power_intrinsics.h>
#include "rte_ethdev_trace_fp.h"
#include "rte_dev_info.h"
* Not all statistics fields in struct rte_eth_stats are supported
* by any type of network interface card (NIC). If any statistics
* field is not supported, its value is 0.
+ * All byte-related statistics do not include Ethernet FCS regardless
+ * of whether these bytes have been delivered to the application
+ * (see DEV_RX_OFFLOAD_KEEP_CRC).
*/
struct rte_eth_stats {
uint64_t ipackets; /**< Total number of successfully received packets. */
#define ETH_RSS_L2TPV3 (1ULL << 29)
#define ETH_RSS_PFCP (1ULL << 30)
#define ETH_RSS_PPPOE (1ULL << 31)
+#define ETH_RSS_ECPRI (1ULL << 32)
+#define ETH_RSS_MPLS (1ULL << 33)
/*
* We use the following macros to combine with above ETH_RSS_* for
ETH_RSS_PORT | \
ETH_RSS_VXLAN | \
ETH_RSS_GENEVE | \
- ETH_RSS_NVGRE)
+ ETH_RSS_NVGRE | \
+ ETH_RSS_MPLS)
/*
* Definitions used for redirection table entry size.
};
/**
- * Tunneled type.
+ * Tunnel type for device-specific classifier configuration.
+ * @see rte_eth_udp_tunnel
*/
enum rte_eth_tunnel_type {
RTE_TUNNEL_TYPE_NONE = 0,
RTE_TUNNEL_TYPE_IP_IN_GRE,
RTE_L2_TUNNEL_TYPE_E_TAG,
RTE_TUNNEL_TYPE_VXLAN_GPE,
+ RTE_TUNNEL_TYPE_ECPRI,
RTE_TUNNEL_TYPE_MAX,
};
/**
* UDP tunneling configuration.
- * Used to config the UDP port for a type of tunnel.
- * NICs need the UDP port to identify the tunnel type.
- * Normally a type of tunnel has a default UDP port, this structure can be used
- * in case if the users want to change or support more UDP port.
+ *
+ * Used to configure the classifier of a device,
+ * associating an UDP port with a type of tunnel.
+ *
+ * Some NICs may need such configuration to properly parse a tunnel
+ * with any standard or custom UDP port.
*/
struct rte_eth_udp_tunnel {
uint16_t udp_port; /**< UDP port used for the tunnel. */
- uint8_t prot_type; /**< Tunnel type. Defined in rte_eth_tunnel_type. */
+ uint8_t prot_type; /**< Tunnel type. @see rte_eth_tunnel_type */
};
/**
* The mbuf field and flag are registered when the offload is configured.
*/
#define DEV_TX_OFFLOAD_SEND_ON_TIMESTAMP 0x00200000
-
-
-#define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
-/**< Device supports Rx queue setup after device started*/
-#define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002
-/**< Device supports Tx queue setup after device started*/
-
/*
* If new Tx offload capabilities are defined, they also must be
* mentioned in rte_tx_offload_names in rte_ethdev.c file.
*/
+/**@{@name Device capabilities
+ * Non-offload capabilities reported in rte_eth_dev_info.dev_capa.
+ */
+/** Device supports Rx queue setup after device started. */
+#define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
+/** Device supports Tx queue setup after device started. */
+#define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002
+/**@}*/
+
/*
* Fallback default preferred Rx/Tx port parameters.
* These are used if an application requests default parameters
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
- /**
+/**
* Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
* @param port_id
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
- /**
+/**
* 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.
int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,
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.
int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
uint16_t tx_rate);
- /**
+/**
* Configuration of Receive Side Scaling hash computation of Ethernet device.
*
* @param port_id
int rte_eth_dev_rss_hash_update(uint16_t port_id,
struct rte_eth_rss_conf *rss_conf);
- /**
+/**
* Retrieve current configuration of Receive Side Scaling hash computation
* of Ethernet device.
*
rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
struct rte_eth_rss_conf *rss_conf);
- /**
- * 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 specific UDP port.
+/**
+ * Add UDP tunneling port for a type of tunnel.
+ *
+ * Some NICs may require such configuration to properly parse a tunnel
+ * with any standard or custom UDP port.
+ * The packets with this UDP port will be parsed for this type of tunnel.
+ * The device parser will also check the rest of the tunnel headers
+ * before classifying the packet.
+ *
+ * With some devices, this API will affect packet classification, i.e.:
+ * - mbuf.packet_type reported on Rx
+ * - rte_flow rules with tunnel items
*
* @param port_id
* The port identifier of the Ethernet device.
rte_eth_dev_udp_tunnel_port_add(uint16_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 specific UDP port.
+/**
+ * Delete UDP tunneling port for a type of tunnel.
+ *
+ * The packets with this UDP port will not be classified as this type of tunnel
+ * anymore if the device use such mapping for tunnel packet classification.
+ *
+ * @see rte_eth_dev_udp_tunnel_port_add
*
* @param port_id
* The port identifier of the Ethernet device.
rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
struct rte_eth_udp_tunnel *tunnel_udp);
-/**
- * Check whether the filter type is supported on an Ethernet device.
- * All the supported filter types are defined in 'rte_eth_ctrl.h'.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param filter_type
- * Filter type.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this filter type.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- */
-__rte_deprecated
-int rte_eth_dev_filter_supported(uint16_t port_id,
- enum rte_filter_type filter_type);
-
-/**
- * Take operations to assigned filter type on an Ethernet device.
- * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param filter_type
- * Filter type.
- * @param filter_op
- * Type of operation.
- * @param arg
- * A pointer to arguments defined specifically for the operation.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
- */
-__rte_deprecated
-int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
- enum rte_filter_op filter_op, void *arg);
-
/**
* Get DCB information on an Ethernet device.
*
int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
struct rte_eth_burst_mode *mode);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Retrieve the monitor condition for a given receive queue.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The Rx queue on the Ethernet device for which information
+ * will be retrieved.
+ * @param pmc
+ * The pointer to power-optimized monitoring condition structure.
+ *
+ * @return
+ * - 0: Success.
+ * -ENOTSUP: Operation not supported.
+ * -EINVAL: Invalid parameters.
+ * -ENODEV: Invalid port ID.
+ */
+__rte_experimental
+int rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id,
+ struct rte_power_monitor_cond *pmc);
+
/**
* Retrieve device registers and register attributes (number of registers and
* register size)
int
rte_eth_read_clock(uint16_t port_id, uint64_t *clock);
-/**
- * Config l2 tunnel ether type of an Ethernet device for filtering specific
- * tunnel packets by ether type.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel configuration.
- *
- * @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
- */
-int
-rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel);
-
-/**
- * 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.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel parameters.
- * @param mask
- * Indicate the offload function.
- * @param en
- * Enable or disable this function.
- *
- * @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
- */
-int
-rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-
/**
* Get the port id from device name. The device name should be specified
* as below:
* burst-oriented optimizations in both synchronous and asynchronous
* packet processing environments with no overhead in both cases.
*
+ * @note
+ * Some drivers using vector instructions require that *nb_pkts* is
+ * divisible by 4 or 8, depending on the driver implementation.
+ *
* 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
* must be large enough to store *nb_pkts* pointers in it.
* @param nb_pkts
* The maximum number of packets to retrieve.
+ * The value must be divisible by 8 in order to work with any driver.
* @return
* The number of packets actually retrieved, which is the number
* of pointers to *rte_mbuf* structures effectively supplied to the