net/mlx5: handle Rx CQE compression
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index f39199a..ebe6578 100644 (file)
@@ -363,8 +363,8 @@ struct rte_eth_rxmode {
  */
 enum rte_vlan_type {
        ETH_VLAN_TYPE_UNKNOWN = 0,
-       ETH_VLAN_TYPE_INNER, /**< Single VLAN, or inner VLAN. */
-       ETH_VLAN_TYPE_OUTER, /**< Outer VLAN. */
+       ETH_VLAN_TYPE_INNER, /**< Inner VLAN. */
+       ETH_VLAN_TYPE_OUTER, /**< Single VLAN, or outer VLAN. */
        ETH_VLAN_TYPE_MAX,
 };
 
@@ -413,6 +413,10 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_IPV6_EX            (1ULL << RTE_ETH_FLOW_IPV6_EX)
 #define ETH_RSS_IPV6_TCP_EX        (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
 #define ETH_RSS_IPV6_UDP_EX        (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
+#define ETH_RSS_PORT               (1ULL << RTE_ETH_FLOW_PORT)
+#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_IP ( \
        ETH_RSS_IPV4 | \
@@ -437,6 +441,12 @@ struct rte_eth_rss_conf {
        ETH_RSS_NONFRAG_IPV4_SCTP | \
        ETH_RSS_NONFRAG_IPV6_SCTP)
 
+#define ETH_RSS_TUNNEL ( \
+       ETH_RSS_VXLAN  | \
+       ETH_RSS_GENEVE | \
+       ETH_RSS_NVGRE)
+
+
 /**< Mask of valid RSS hash protocols */
 #define ETH_RSS_PROTO_MASK ( \
        ETH_RSS_IPV4 | \
@@ -454,7 +464,11 @@ struct rte_eth_rss_conf {
        ETH_RSS_L2_PAYLOAD | \
        ETH_RSS_IPV6_EX | \
        ETH_RSS_IPV6_TCP_EX | \
-       ETH_RSS_IPV6_UDP_EX)
+       ETH_RSS_IPV6_UDP_EX | \
+       ETH_RSS_PORT  | \
+       ETH_RSS_VXLAN | \
+       ETH_RSS_GENEVE | \
+       ETH_RSS_NVGRE)
 
 /*
  * Definitions used for redirection table entry size.
@@ -463,6 +477,7 @@ struct rte_eth_rss_conf {
  */
 #define ETH_RSS_RETA_SIZE_64  64
 #define ETH_RSS_RETA_SIZE_128 128
+#define ETH_RSS_RETA_SIZE_256 256
 #define ETH_RSS_RETA_SIZE_512 512
 #define RTE_RETA_GROUP_SIZE   64
 
@@ -1142,7 +1157,7 @@ typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
 
 typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
                               enum rte_vlan_type type, uint16_t tpid);
-/**< @internal set the outer VLAN-TPID by an Ethernet device. */
+/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
 
 typedef void (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
 /**< @internal set VLAN offload function by an Ethernet device. */
@@ -1428,7 +1443,7 @@ struct eth_dev_ops {
        /**< Get packet types supported and identified by device*/
        mtu_set_t                  mtu_set; /**< Set MTU. */
        vlan_filter_set_t          vlan_filter_set;  /**< Filter VLAN Setup. */
-       vlan_tpid_set_t            vlan_tpid_set;      /**< Outer VLAN TPID Setup. */
+       vlan_tpid_set_t            vlan_tpid_set;      /**< Outer/Inner VLAN TPID Setup. */
        vlan_strip_queue_set_t     vlan_strip_queue_set; /**< VLAN Stripping on queue. */
        vlan_offload_set_t         vlan_offload_set; /**< Set VLAN Offload. */
        vlan_pvid_set_t            vlan_pvid_set; /**< Set port based TX VLAN insertion */
@@ -1635,7 +1650,7 @@ struct rte_eth_dev {
        struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
        uint8_t attached; /**< Flag indicating the port is attached */
        enum rte_eth_dev_type dev_type; /**< Flag indicating the device type */
-};
+} __rte_cache_aligned;
 
 struct rte_eth_dev_sriov {
        uint8_t active;               /**< SRIOV is active with 16, 32 or 64 pools */
@@ -2009,7 +2024,7 @@ 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);
 
-/*
+/**
  * Return the NUMA socket to which an Ethernet device is connected
  *
  * @param port_id
@@ -2021,7 +2036,7 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
  */
 int rte_eth_dev_socket_id(uint8_t port_id);
 
-/*
+/**
  * Check if port_id of device is attached
  *
  * @param port_id
@@ -2032,7 +2047,7 @@ int rte_eth_dev_socket_id(uint8_t port_id);
  */
 int rte_eth_dev_is_valid_port(uint8_t port_id);
 
-/*
+/**
  * Allocate mbuf from mempool, setup the DMA physical address
  * and then start RX for specified queue of a port. It is used
  * when rx_deferred_start flag of the specified queue is true.
@@ -2050,7 +2065,7 @@ int rte_eth_dev_is_valid_port(uint8_t port_id);
  */
 int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
 
-/*
+/**
  * Stop specified RX queue of a port
  *
  * @param port_id
@@ -2066,7 +2081,7 @@ int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
  */
 int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
 
-/*
+/**
  * Start TX for specified queue of a port. It is used when tx_deferred_start
  * flag of the specified queue is true.
  *
@@ -2083,7 +2098,7 @@ int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
  */
 int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id);
 
-/*
+/**
  * Stop specified TX queue of a port
  *
  * @param port_id
@@ -2441,6 +2456,7 @@ int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu);
  *   - (-ENOTSUP) if operation is not supported.
  *   - (-ENODEV) if *port_id* invalid.
  *   - (-EINVAL) if *mtu* invalid.
+ *   - (-EBUSY) if operation is not allowed when the port is running
  */
 int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu);
 
@@ -4030,7 +4046,7 @@ int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
 int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
        struct rte_eth_txq_info *qinfo);
 
-/*
+/**
  * Retrieve number of available registers for access
  *
  * @param port_id
@@ -4325,6 +4341,35 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id,
                                  uint32_t mask,
                                  uint8_t en);
 
+/**
+* Get the port id from pci adrress or device name
+* Ex: 0000:2:00.0 or vdev name eth_pcap0
+*
+* @param name
+*  pci address or name of the device
+* @param port_id
+*   pointer to port identifier of the device
+* @return
+*   - (0) if successful.
+*   - (-ENODEV or -EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id);
+
+/**
+* Get the device name from port id
+*
+* @param port_id
+*   pointer to port identifier of the device
+* @param name
+*  pci address or name of the device
+* @return
+*   - (0) if successful.
+*   - (-EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);
+
 #ifdef __cplusplus
 }
 #endif