X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_ethdev%2Frte_ethdev.h;h=ec95f9b19412de96a337496c3b29f73f5eddc0e1;hb=ad0a4ae491fe3b10338441dfdf11a9b3a1c05798;hp=4ea85795ff9121b05af156d91a4e5e5d7a52c9a9;hpb=9970a9ad07db7745ca6bc441819b287940ae86ea;p=dpdk.git diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 4ea85795ff..ec95f9b194 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -479,7 +479,8 @@ struct rte_eth_rss_conf { #define RTE_ETH_FLOW_GENEVE 20 /**< GENEVE protocol based flow */ #define RTE_ETH_FLOW_NVGRE 21 /**< NVGRE protocol based flow */ #define RTE_ETH_FLOW_VXLAN_GPE 22 /**< VXLAN-GPE protocol based flow */ -#define RTE_ETH_FLOW_MAX 23 +#define RTE_ETH_FLOW_GTPU 23 /**< GTPU protocol based flow */ +#define RTE_ETH_FLOW_MAX 24 /* * The RSS offload types are defined based on flow types. @@ -507,6 +508,7 @@ struct rte_eth_rss_conf { #define ETH_RSS_VXLAN (1ULL << RTE_ETH_FLOW_VXLAN) #define ETH_RSS_GENEVE (1ULL << RTE_ETH_FLOW_GENEVE) #define ETH_RSS_NVGRE (1ULL << RTE_ETH_FLOW_NVGRE) +#define ETH_RSS_GTPU (1ULL << RTE_ETH_FLOW_GTPU) #define ETH_RSS_IP ( \ ETH_RSS_IPV4 | \ @@ -1212,6 +1214,35 @@ struct rte_eth_txq_info { uint16_t nb_desc; /**< configured number of TXDs. */ } __rte_cache_min_aligned; +/** + * Burst mode types, values can be ORed to define the burst mode of a driver. + */ +enum rte_eth_burst_mode_option { + RTE_ETH_BURST_SCALAR = (1 << 0), + RTE_ETH_BURST_VECTOR = (1 << 1), + + /**< bits[15:2] are reserved for each vector type */ + RTE_ETH_BURST_ALTIVEC = (1 << 2), + RTE_ETH_BURST_NEON = (1 << 3), + RTE_ETH_BURST_SSE = (1 << 4), + RTE_ETH_BURST_AVX2 = (1 << 5), + RTE_ETH_BURST_AVX512 = (1 << 6), + + RTE_ETH_BURST_SCATTERED = (1 << 16), /**< Support scattered packets */ + RTE_ETH_BURST_BULK_ALLOC = (1 << 17), /**< Support mbuf bulk alloc */ + RTE_ETH_BURST_SIMPLE = (1 << 18), + + RTE_ETH_BURST_PER_QUEUE = (1 << 19), /**< Support per queue burst */ +}; + +/** + * Ethernet device RX/TX queue packet burst mode information structure. + * Used to retrieve information about packet burst mode setting. + */ +struct rte_eth_burst_mode { + uint64_t options; +}; + /** Maximum name length for extended statistics counters */ #define RTE_ETH_XSTATS_NAME_SIZE 64 @@ -1566,9 +1597,11 @@ int rte_eth_dev_owner_unset(const uint16_t port_id, * * @param owner_id * The owner identifier. + * @return + * 0 on success, negative errno value on error. */ __rte_experimental -void rte_eth_dev_owner_delete(const uint64_t owner_id); +int rte_eth_dev_owner_delete(const uint64_t owner_id); /** * @warning @@ -2060,16 +2093,26 @@ int rte_eth_promiscuous_get(uint16_t port_id); * * @param port_id * The port identifier of the Ethernet device. + * @return + * - (0) if successful. + * - (-ENOTSUP) if support for allmulticast_enable() does not exist + * for the device. + * - (-ENODEV) if *port_id* invalid. */ -void rte_eth_allmulticast_enable(uint16_t port_id); +int rte_eth_allmulticast_enable(uint16_t port_id); /** * Disable the receipt of all multicast frames by an Ethernet device. * * @param port_id * The port identifier of the Ethernet device. + * @return + * - (0) if successful. + * - (-ENOTSUP) if support for allmulticast_disable() does not exist + * for the device. + * - (-ENODEV) if *port_id* invalid. */ -void rte_eth_allmulticast_disable(uint16_t port_id); +int rte_eth_allmulticast_disable(uint16_t port_id); /** * Return the value of allmulticast mode for an Ethernet device. @@ -2093,8 +2136,12 @@ int rte_eth_allmulticast_get(uint16_t port_id); * @param 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. + * @return + * - (0) if successful. + * - (-ENOTSUP) if the function is not supported in PMD driver. + * - (-ENODEV) if *port_id* invalid. */ -void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); +int rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2106,8 +2153,12 @@ void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); * @param 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. + * @return + * - (0) if successful. + * - (-ENOTSUP) if the function is not supported in PMD driver. + * - (-ENODEV) if *port_id* invalid. */ -void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link); +int rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the general I/O statistics of an Ethernet device. @@ -2343,8 +2394,11 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, * @param mac_addr * A pointer to a structure of type *ether_addr* to be filled with * the Ethernet address of the Ethernet device. + * @return + * - (0) if successful + * - (-ENODEV) if *port_id* invalid. */ -void rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr); +int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr); /** * Retrieve the contextual information of an Ethernet device. @@ -3577,6 +3631,62 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo); +/** + * Retrieve information about the Rx packet burst mode. + * + * @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 mode + * A pointer to a structure of type *rte_eth_burst_mode* to be filled + * with the information of the packet burst mode. + * + * @return + * - 0: Success + * - -ENOTSUP: routine is not supported by the device PMD. + * - -EINVAL: The port_id or the queue_id is out of range. + */ +__rte_experimental +int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, + struct rte_eth_burst_mode *mode); + +/** + * Retrieve information about the Tx packet burst mode. + * + * @param port_id + * The port identifier of the Ethernet device. + * @param queue_id + * The Tx queue on the Ethernet device for which information + * will be retrieved. + * @param mode + * A pointer to a structure of type *rte_eth_burst_mode* to be filled + * with the information of the packet burst mode. + * + * @return + * - 0: Success + * - -ENOTSUP: routine is not supported by the device PMD. + * - -EINVAL: The port_id or the queue_id is out of range. + */ +__rte_experimental +int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, + struct rte_eth_burst_mode *mode); + +/** + * Retrieve name about burst mode option. + * + * @param option + * The burst mode option of type *rte_eth_burst_mode_option*. + * + * @return + * - "": Not found + * - "xxx": name of the mode option. + */ +__rte_experimental +const char * +rte_eth_burst_mode_option_name(uint64_t option); + /** * Retrieve device registers and register attributes (number of registers and * register size)