ethdev: add device fields from PCI layer
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index 62c166e..4f7b64b 100644 (file)
@@ -195,7 +195,9 @@ struct rte_eth_stats {
        uint64_t ibytes;    /**< Total number of successfully received bytes. */
        uint64_t obytes;    /**< Total number of successfully transmitted bytes. */
        uint64_t imissed;
-       /**< Deprecated; Total of RX missed packets (e.g full FIFO). */
+       /**< Total of RX packets dropped by the HW,
+        * because there are no available mbufs (i.e. RX queues are full).
+        */
        uint64_t ibadcrc;
        /**< Deprecated; Total of RX packets with CRC error. */
        uint64_t ibadlen;
@@ -543,20 +545,20 @@ enum rte_eth_nb_pools {
 /* This structure may be extended in future. */
 struct rte_eth_dcb_rx_conf {
        enum rte_eth_nb_tcs nb_tcs; /**< Possible DCB TCs, 4 or 8 TCs */
-       uint8_t dcb_queue[ETH_DCB_NUM_USER_PRIORITIES];
-       /**< Possible DCB queue,4 or 8. */
+       /** Traffic class each UP mapped to. */
+       uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
 };
 
 struct rte_eth_vmdq_dcb_tx_conf {
        enum rte_eth_nb_pools nb_queue_pools; /**< With DCB, 16 or 32 pools. */
-       uint8_t dcb_queue[ETH_DCB_NUM_USER_PRIORITIES];
-       /**< Possible DCB queue,4 or 8. */
+       /** Traffic class each UP mapped to. */
+       uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
 };
 
 struct rte_eth_dcb_tx_conf {
        enum rte_eth_nb_tcs nb_tcs; /**< Possible DCB TCs, 4 or 8 TCs. */
-       uint8_t dcb_queue[ETH_DCB_NUM_USER_PRIORITIES];
-       /**< Possible DCB queue,4 or 8. */
+       /** Traffic class each UP mapped to. */
+       uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
 };
 
 struct rte_eth_vmdq_tx_conf {
@@ -583,7 +585,7 @@ struct rte_eth_vmdq_dcb_conf {
                uint16_t vlan_id; /**< The vlan id of the received frame */
                uint64_t pools;   /**< Bitmask of pools for packet rx */
        } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]; /**< VMDq vlan pool maps. */
-       uint8_t dcb_queue[ETH_DCB_NUM_USER_PRIORITIES];
+       uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
        /**< Selects a queue in a pool */
 };
 
@@ -652,6 +654,15 @@ struct rte_eth_txconf {
        uint8_t tx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */
 };
 
+/**
+ * A structure contains information about HW descriptor ring limitations.
+ */
+struct rte_eth_desc_lim {
+       uint16_t nb_max;   /**< Max allowed number of descriptors. */
+       uint16_t nb_min;   /**< Min allowed number of descriptors. */
+       uint16_t nb_align; /**< Number of descriptors should be aligned to. */
+};
+
 /**
  * This enum indicates the flow control mode
  */
@@ -731,120 +742,14 @@ struct rte_eth_udp_tunnel {
        uint8_t prot_type;
 };
 
-/**
- *  Possible l4type of FDIR filters.
- */
-enum rte_l4type {
-       RTE_FDIR_L4TYPE_NONE = 0,       /**< None. */
-       RTE_FDIR_L4TYPE_UDP,            /**< UDP. */
-       RTE_FDIR_L4TYPE_TCP,            /**< TCP. */
-       RTE_FDIR_L4TYPE_SCTP,           /**< SCTP. */
-};
-
-/**
- *  Select IPv4 or IPv6 FDIR filters.
- */
-enum rte_iptype {
-       RTE_FDIR_IPTYPE_IPV4 = 0,     /**< IPv4. */
-       RTE_FDIR_IPTYPE_IPV6 ,        /**< IPv6. */
-};
-
-/**
- *  A structure used to define a FDIR packet filter.
- */
-struct rte_fdir_filter {
-       uint16_t flex_bytes; /**< Flex bytes value to match. */
-       uint16_t vlan_id; /**< VLAN ID value to match, 0 otherwise. */
-       uint16_t port_src; /**< Source port to match, 0 otherwise. */
-       uint16_t port_dst; /**< Destination port to match, 0 otherwise. */
-       union {
-               uint32_t ipv4_addr; /**< IPv4 source address to match. */
-               uint32_t ipv6_addr[4]; /**< IPv6 source address to match. */
-       } ip_src; /**< IPv4/IPv6 source address to match (union of above). */
-       union {
-               uint32_t ipv4_addr; /**< IPv4 destination address to match. */
-               uint32_t ipv6_addr[4]; /**< IPv6 destination address to match */
-       } ip_dst; /**< IPv4/IPv6 destination address to match (union of above). */
-       enum rte_l4type l4type; /**< l4type to match: NONE/UDP/TCP/SCTP. */
-       enum rte_iptype iptype; /**< IP packet type to match: IPv4 or IPv6. */
-};
-
-/**
- *  A structure used to configure FDIR masks that are used by the device
- *  to match the various fields of RX packet headers.
- *  @note The only_ip_flow field has the opposite meaning compared to other
- *  masks!
- */
-struct rte_fdir_masks {
-       /** When set to 1, packet l4type is \b NOT relevant in filters, and
-          source and destination port masks must be set to zero. */
-       uint8_t only_ip_flow;
-       /** If set to 1, vlan_id is relevant in filters. */
-       uint8_t vlan_id;
-       /** If set to 1, vlan_prio is relevant in filters. */
-       uint8_t vlan_prio;
-       /** If set to 1, flexbytes is relevant in filters. */
-       uint8_t flexbytes;
-       /** If set to 1, set the IPv6 masks. Otherwise set the IPv4 masks. */
-       uint8_t set_ipv6_mask;
-       /** When set to 1, comparison of destination IPv6 address with IP6AT
-           registers is meaningful. */
-       uint8_t comp_ipv6_dst;
-       /** Mask of Destination IPv4 Address. All bits set to 1 define the
-           relevant bits to use in the destination address of an IPv4 packet
-           when matching it against FDIR filters. */
-       uint32_t dst_ipv4_mask;
-       /** Mask of Source IPv4 Address. All bits set to 1 define
-           the relevant bits to use in the source address of an IPv4 packet
-           when matching it against FDIR filters. */
-       uint32_t src_ipv4_mask;
-       /** Mask of Source IPv6 Address. All bits set to 1 define the
-           relevant BYTES to use in the source address of an IPv6 packet
-           when matching it against FDIR filters. */
-       uint16_t dst_ipv6_mask;
-       /** Mask of Destination IPv6 Address. All bits set to 1 define the
-           relevant BYTES to use in the destination address of an IPv6 packet
-           when matching it against FDIR filters. */
-       uint16_t src_ipv6_mask;
-       /** Mask of Source Port. All bits set to 1 define the relevant
-           bits to use in the source port of an IP packets when matching it
-           against FDIR filters. */
-       uint16_t src_port_mask;
-       /** Mask of Destination Port. All bits set to 1 define the relevant
-           bits to use in the destination port of an IP packet when matching it
-           against FDIR filters. */
-       uint16_t dst_port_mask;
-};
-
-/**
- *  A structure used to report the status of the flow director filters in use.
- */
-struct rte_eth_fdir {
-       /** Number of filters with collision indication. */
-       uint16_t collision;
-       /** Number of free (non programmed) filters. */
-       uint16_t free;
-       /** The Lookup hash value of the added filter that updated the value
-          of the MAXLEN field */
-       uint16_t maxhash;
-       /** Longest linked list of filters in the table. */
-       uint8_t maxlen;
-       /** Number of added filters. */
-       uint64_t add;
-       /** Number of removed filters. */
-       uint64_t remove;
-       /** Number of failed added filters (no more space in device). */
-       uint64_t f_add;
-       /** Number of failed removed filters. */
-       uint64_t f_remove;
-};
-
 /**
  * A structure used to enable/disable specific device interrupts.
  */
 struct rte_intr_conf {
        /** enable/disable lsc interrupt. 0 (default) - disable, 1 enable */
        uint16_t lsc;
+       /** enable/disable rxq interrupt. 0 (default) - disable, 1 enable */
+       uint16_t rxq;
 };
 
 /**
@@ -943,8 +848,30 @@ struct rte_eth_dev_info {
        uint16_t vmdq_queue_base; /**< First queue ID for VMDQ pools. */
        uint16_t vmdq_queue_num;  /**< Queue number for VMDQ pools. */
        uint16_t vmdq_pool_base;  /**< First ID of VMDQ pools. */
+       struct rte_eth_desc_lim rx_desc_lim;  /**< RX descriptors limits */
+       struct rte_eth_desc_lim tx_desc_lim;  /**< TX descriptors limits */
 };
 
+/**
+ * Ethernet device RX queue information structure.
+ * Used to retieve information about configured queue.
+ */
+struct rte_eth_rxq_info {
+       struct rte_mempool *mp;     /**< mempool used by that queue. */
+       struct rte_eth_rxconf conf; /**< queue config parameters. */
+       uint8_t scattered_rx;       /**< scattered packets RX supported. */
+       uint16_t nb_desc;           /**< configured number of RXDs. */
+} __rte_cache_aligned;
+
+/**
+ * Ethernet device TX queue information structure.
+ * Used to retieve information about configured queue.
+ */
+struct rte_eth_txq_info {
+       struct rte_eth_txconf conf; /**< queue config parameters. */
+       uint16_t nb_desc;           /**< configured number of TXDs. */
+} __rte_cache_aligned;
+
 /** Maximum name length for extended statistics counters */
 #define RTE_ETH_XSTATS_NAME_SIZE 64
 
@@ -960,6 +887,38 @@ struct rte_eth_xstats {
        uint64_t value;
 };
 
+#define ETH_DCB_NUM_TCS    8
+#define ETH_MAX_VMDQ_POOL  64
+
+/**
+ * A structure used to get the information of queue and
+ * TC mapping on both TX and RX paths.
+ */
+struct rte_eth_dcb_tc_queue_mapping {
+       /** rx queues assigned to tc per Pool */
+       struct {
+               uint8_t base;
+               uint8_t nb_queue;
+       } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
+       /** rx queues assigned to tc per Pool */
+       struct {
+               uint8_t base;
+               uint8_t nb_queue;
+       } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
+};
+
+/**
+ * A structure used to get the information of DCB.
+ * It includes TC UP mapping and queue TC mapping.
+ */
+struct rte_eth_dcb_info {
+       uint8_t nb_tcs;        /**< number of TCs */
+       uint8_t prio_tc[ETH_DCB_NUM_USER_PRIORITIES]; /**< Priority to tc */
+       uint8_t tc_bws[ETH_DCB_NUM_TCS]; /**< TX BW percentage for each TC */
+       /** rx queues assigned to tc */
+       struct rte_eth_dcb_tc_queue_mapping tc_queue;
+};
+
 struct rte_eth_dev;
 
 struct rte_eth_dev_callback;
@@ -1053,6 +1012,14 @@ typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
                                    const struct rte_eth_txconf *tx_conf);
 /**< @internal Setup a transmit queue of an Ethernet device. */
 
+typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev,
+                                   uint16_t rx_queue_id);
+/**< @internal Enable interrupt of a receive queue of an Ethernet device. */
+
+typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev,
+                                   uint16_t rx_queue_id);
+/**< @internal Disable interrupt of a receive queue of an Ethernet device. */
+
 typedef void (*eth_queue_release_t)(void *queue);
 /**< @internal Release memory resources allocated by given RX/TX queue. */
 
@@ -1063,6 +1030,12 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
 /**< @internal Check DD bit of specific RX descriptor */
 
+typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
+       uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
+
+typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
+       uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
+
 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
 /**< @internal Set MTU. */
 
@@ -1098,45 +1071,6 @@ typedef uint16_t (*eth_tx_burst_t)(void *txq,
                                   uint16_t nb_pkts);
 /**< @internal Send output packets on a transmit queue of an Ethernet device. */
 
-typedef int (*fdir_add_signature_filter_t)(struct rte_eth_dev *dev,
-                                          struct rte_fdir_filter *fdir_ftr,
-                                          uint8_t rx_queue);
-/**< @internal Setup a new signature filter rule on an Ethernet device */
-
-typedef int (*fdir_update_signature_filter_t)(struct rte_eth_dev *dev,
-                                             struct rte_fdir_filter *fdir_ftr,
-                                             uint8_t rx_queue);
-/**< @internal Update a signature filter rule on an Ethernet device */
-
-typedef int (*fdir_remove_signature_filter_t)(struct rte_eth_dev *dev,
-                                             struct rte_fdir_filter *fdir_ftr);
-/**< @internal Remove a  signature filter rule on an Ethernet device */
-
-typedef void (*fdir_infos_get_t)(struct rte_eth_dev *dev,
-                                struct rte_eth_fdir *fdir);
-/**< @internal Get information about fdir status */
-
-typedef int (*fdir_add_perfect_filter_t)(struct rte_eth_dev *dev,
-                                        struct rte_fdir_filter *fdir_ftr,
-                                        uint16_t soft_id, uint8_t rx_queue,
-                                        uint8_t drop);
-/**< @internal Setup a new perfect filter rule on an Ethernet device */
-
-typedef int (*fdir_update_perfect_filter_t)(struct rte_eth_dev *dev,
-                                           struct rte_fdir_filter *fdir_ftr,
-                                           uint16_t soft_id, uint8_t rx_queue,
-                                           uint8_t drop);
-/**< @internal Update a perfect filter rule on an Ethernet device */
-
-typedef int (*fdir_remove_perfect_filter_t)(struct rte_eth_dev *dev,
-                                           struct rte_fdir_filter *fdir_ftr,
-                                           uint16_t soft_id);
-/**< @internal Remove a perfect filter rule on an Ethernet device */
-
-typedef int (*fdir_set_masks_t)(struct rte_eth_dev *dev,
-                               struct rte_fdir_masks *fdir_masks);
-/**< @internal Setup flow director masks on an Ethernet device */
-
 typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev,
                               struct rte_eth_fc_conf *fc_conf);
 /**< @internal Get current flow control parameter on an Ethernet device */
@@ -1344,6 +1278,10 @@ typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
                                 void *arg);
 /**< @internal Take operations to assigned filter type on an Ethernet device */
 
+typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,
+                                struct rte_eth_dcb_info *dcb_info);
+/**< @internal Get dcb information on an Ethernet device */
+
 /**
  * @internal A structure containing the functions exported by an Ethernet driver.
  */
@@ -1380,6 +1318,10 @@ struct eth_dev_ops {
        eth_queue_release_t        rx_queue_release;/**< Release RX queue.*/
        eth_rx_queue_count_t       rx_queue_count; /**< Get Rx queue count. */
        eth_rx_descriptor_done_t   rx_descriptor_done;  /**< Check rxd DD bit */
+       /**< Enable Rx queue interrupt. */
+       eth_rx_enable_intr_t       rx_queue_intr_enable;
+       /**< Disable Rx queue interrupt.*/
+       eth_rx_disable_intr_t      rx_queue_intr_disable;
        eth_tx_queue_setup_t       tx_queue_setup;/**< Set up device TX queue.*/
        eth_queue_release_t        tx_queue_release;/**< Release TX queue.*/
        eth_dev_led_on_t           dev_led_on;    /**< Turn on LED. */
@@ -1402,23 +1344,6 @@ struct eth_dev_ops {
        eth_udp_tunnel_del_t       udp_tunnel_del;
        eth_set_queue_rate_limit_t set_queue_rate_limit;   /**< Set queue rate limit */
        eth_set_vf_rate_limit_t    set_vf_rate_limit;   /**< Set VF rate limit */
-
-       /** Add a signature filter. */
-       fdir_add_signature_filter_t fdir_add_signature_filter;
-       /** Update a signature filter. */
-       fdir_update_signature_filter_t fdir_update_signature_filter;
-       /** Remove a signature filter. */
-       fdir_remove_signature_filter_t fdir_remove_signature_filter;
-       /** Get information about FDIR status. */
-       fdir_infos_get_t fdir_infos_get;
-       /** Add a perfect filter. */
-       fdir_add_perfect_filter_t fdir_add_perfect_filter;
-       /** Update a perfect filter. */
-       fdir_update_perfect_filter_t fdir_update_perfect_filter;
-       /** Remove a perfect filter. */
-       fdir_remove_perfect_filter_t fdir_remove_perfect_filter;
-       /** Setup masks for FDIR filtering. */
-       fdir_set_masks_t fdir_set_masks;
        /** Update redirection table. */
        reta_update_t reta_update;
        /** Query redirection table. */
@@ -1451,9 +1376,13 @@ struct eth_dev_ops {
        rss_hash_update_t rss_hash_update;
        /** Get current RSS hash configuration. */
        rss_hash_conf_get_t rss_hash_conf_get;
-       eth_filter_ctrl_t              filter_ctrl;          /**< common filter control*/
+       eth_filter_ctrl_t              filter_ctrl;
+       /**< common filter control. */
        eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs */
-
+       eth_rxq_info_get_t rxq_info_get;
+       /**< retrieve RX queue information. */
+       eth_txq_info_get_t txq_info_get;
+       /**< retrieve TX queue information. */
        /** Turn IEEE1588/802.1AS timestamping on. */
        eth_timesync_enable_t timesync_enable;
        /** Turn IEEE1588/802.1AS timestamping off. */
@@ -1462,6 +1391,9 @@ struct eth_dev_ops {
        eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
        /** Read the IEEE1588/802.1AS TX timestamp. */
        eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
+
+       /** Get DCB information */
+       eth_get_dcb_info get_dcb_info;
 };
 
 /**
@@ -1618,11 +1550,20 @@ struct rte_eth_dev_data {
        uint8_t port_id;           /**< Device [external] port identifier. */
        uint8_t promiscuous   : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
                scattered_rx : 1,  /**< RX of scattered packets is ON(1) / OFF(0) */
-               lro          : 1,  /**< RX LRO is ON(1) / OFF(0) */
                all_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */
-               dev_started : 1;   /**< Device state: STARTED(1) / STOPPED(0). */
+               dev_started : 1,   /**< Device state: STARTED(1) / STOPPED(0). */
+               lro         : 1;   /**< RX LRO is ON(1) / OFF(0) */
+       uint32_t dev_flags; /**< Capabilities */
+       enum rte_kernel_driver kdrv;    /**< Kernel driver passthrough */
+       int numa_node;  /**< NUMA node connection */
+       const char *drv_name;   /**< Driver name */
 };
 
+/** Device supports hotplug detach */
+#define RTE_ETH_DEV_DETACHABLE   0x0001
+/** Device supports link state interrupt */
+#define RTE_ETH_DEV_INTR_LSC     0x0002
+
 /**
  * @internal
  * The pool of *rte_eth_dev* structures. The size of the pool
@@ -2668,222 +2609,6 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
 }
 #endif
 
-/**
- * Setup a new signature filter rule on an Ethernet device
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param fdir_filter
- *   The pointer to the fdir filter structure describing the signature filter
- *   rule.
- *   The *rte_fdir_filter* structure includes the values of the different fields
- *   to match: source and destination IP addresses, vlan id, flexbytes, source
- *   and destination ports, and so on.
- * @param rx_queue
- *   The index of the RX queue where to store RX packets matching the added
- *   signature filter defined in fdir_filter.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support flow director mode.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-ENOSYS) if the FDIR mode is not configured in signature mode
- *               on *port_id*.
- *   - (-EINVAL) if the fdir_filter information is not correct.
- */
-int rte_eth_dev_fdir_add_signature_filter(uint8_t port_id,
-                                         struct rte_fdir_filter *fdir_filter,
-                                         uint8_t rx_queue);
-
-/**
- * Update a signature filter rule on an Ethernet device.
- * If the rule doesn't exits, it is created.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param fdir_ftr
- *   The pointer to the structure describing the signature filter rule.
- *   The *rte_fdir_filter* structure includes the values of the different fields
- *   to match: source and destination IP addresses, vlan id, flexbytes, source
- *   and destination ports, and so on.
- * @param rx_queue
- *   The index of the RX queue where to store RX packets matching the added
- *   signature filter defined in fdir_ftr.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support flow director mode.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-ENOSYS) if the flow director mode is not configured in signature mode
- *     on *port_id*.
- *   - (-EINVAL) if the fdir_filter information is not correct.
- */
-int rte_eth_dev_fdir_update_signature_filter(uint8_t port_id,
-                                            struct rte_fdir_filter *fdir_ftr,
-                                            uint8_t rx_queue);
-
-/**
- * Remove a signature filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param fdir_ftr
- *   The pointer to the structure describing the signature filter rule.
- *   The *rte_fdir_filter* structure includes the values of the different fields
- *   to match: source and destination IP addresses, vlan id, flexbytes, source
- *   and destination ports, and so on.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support flow director mode.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-ENOSYS) if the flow director mode is not configured in signature mode
- *     on *port_id*.
- *   - (-EINVAL) if the fdir_filter information is not correct.
- */
-int rte_eth_dev_fdir_remove_signature_filter(uint8_t port_id,
-                                            struct rte_fdir_filter *fdir_ftr);
-
-/**
- * Retrieve the flow director information of an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param fdir
- *   A pointer to a structure of type *rte_eth_dev_fdir* to be filled with
- *   the flow director information of the Ethernet device.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support flow director mode.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-ENOSYS) if the flow director mode is not configured on *port_id*.
- */
-int rte_eth_dev_fdir_get_infos(uint8_t port_id, struct rte_eth_fdir *fdir);
-
-/**
- * Add a new perfect filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param fdir_filter
- *   The pointer to the structure describing the perfect filter rule.
- *   The *rte_fdir_filter* structure includes the values of the different fields
- *   to match: source and destination IP addresses, vlan id, flexbytes, source
- *   and destination ports, and so on.
- *   IPv6 are not supported.
- * @param soft_id
- *    The 16-bit value supplied in the field hash.fdir.id of mbuf for RX
- *    packets matching the perfect filter.
- * @param rx_queue
- *   The index of the RX queue where to store RX packets matching the added
- *   perfect filter defined in fdir_filter.
- * @param drop
- *    If drop is set to 1, matching RX packets are stored into the RX drop
- *    queue defined in the rte_fdir_conf.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support flow director mode.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-ENOSYS) if the flow director mode is not configured in perfect mode
- *               on *port_id*.
- *   - (-EINVAL) if the fdir_filter information is not correct.
- */
-int rte_eth_dev_fdir_add_perfect_filter(uint8_t port_id,
-                                       struct rte_fdir_filter *fdir_filter,
-                                       uint16_t soft_id, uint8_t rx_queue,
-                                       uint8_t drop);
-
-/**
- * Update a perfect filter rule on an Ethernet device.
- * If the rule doesn't exits, it is created.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param fdir_filter
- *   The pointer to the structure describing the perfect filter rule.
- *   The *rte_fdir_filter* structure includes the values of the different fields
- *   to match: source and destination IP addresses, vlan id, flexbytes, source
- *   and destination ports, and so on.
- *   IPv6 are not supported.
- * @param soft_id
- *    The 16-bit value supplied in the field hash.fdir.id of mbuf for RX
- *    packets matching the perfect filter.
- * @param rx_queue
- *   The index of the RX queue where to store RX packets matching the added
- *   perfect filter defined in fdir_filter.
- * @param drop
- *    If drop is set to 1, matching RX packets are stored into the RX drop
- *    queue defined in the rte_fdir_conf.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support flow director mode.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-ENOSYS) if the flow director mode is not configured in perfect mode
- *      on *port_id*.
- *   - (-EINVAL) if the fdir_filter information is not correct.
- */
-int rte_eth_dev_fdir_update_perfect_filter(uint8_t port_id,
-                                          struct rte_fdir_filter *fdir_filter,
-                                          uint16_t soft_id, uint8_t rx_queue,
-                                          uint8_t drop);
-
-/**
- * Remove a perfect filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param fdir_filter
- *   The pointer to the structure describing the perfect filter rule.
- *   The *rte_fdir_filter* structure includes the values of the different fields
- *   to match: source and destination IP addresses, vlan id, flexbytes, source
- *   and destination ports, and so on.
- *   IPv6 are not supported.
- * @param soft_id
- *    The soft_id value provided when adding/updating the removed filter.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support flow director mode.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-ENOSYS) if the flow director mode is not configured in perfect mode
- *      on *port_id*.
- *   - (-EINVAL) if the fdir_filter information is not correct.
- */
-int rte_eth_dev_fdir_remove_perfect_filter(uint8_t port_id,
-                                          struct rte_fdir_filter *fdir_filter,
-                                          uint16_t soft_id);
-/**
- * Configure globally the masks for flow director mode for an Ethernet device.
- * For example, the device can match packets with only the first 24 bits of
- * the IPv4 source address.
- *
- * The following fields can be masked: IPv4 addresses and L4 port numbers.
- * The following fields can be either enabled or disabled completely for the
- * matching functionality: VLAN ID tag; VLAN Priority + CFI bit; Flexible 2-byte
- * tuple.
- * IPv6 masks are not supported.
- *
- * All filters must comply with the masks previously configured.
- * For example, with a mask equal to 255.255.255.0 for the source IPv4 address,
- * all IPv4 filters must be created with a source IPv4 address that fits the
- * "X.X.X.0" format.
- *
- * This function flushes all filters that have been previously added in
- * the device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param fdir_mask
- *   The pointer to the fdir mask structure describing relevant headers fields
- *   and relevant bits to use when matching packets addresses and ports.
- *   IPv6 masks are not supported.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support flow director mode.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-ENOSYS) if the flow director mode is not configured in perfect
- *      mode on *port_id*.
- *   - (-EINVAL) if the fdir_filter information is not correct
- */
-int rte_eth_dev_fdir_set_masks(uint8_t port_id,
-                              struct rte_fdir_masks *fdir_mask);
-
 /**
  * The eth device event type for interrupt, and maybe others in the future.
  */
@@ -2956,6 +2681,92 @@ int rte_eth_dev_callback_unregister(uint8_t port_id,
 void _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
                                enum rte_eth_event_type event);
 
+/**
+ * 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.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param 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().
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ *     that operation.
+ *   - (-ENODEV) if *port_id* invalid.
+ */
+int rte_eth_dev_rx_intr_enable(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.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param 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().
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ *     that operation.
+ *   - (-ENODEV) if *port_id* invalid.
+ */
+int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id);
+
+/**
+ * RX Interrupt control per port.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param epfd
+ *   Epoll instance fd which the intr vector associated to.
+ *   Using RTE_EPOLL_PER_THREAD allows to use per thread epoll instance.
+ * @param op
+ *   The operation be performed for the vector.
+ *   Operation type of {RTE_INTR_EVENT_ADD, RTE_INTR_EVENT_DEL}.
+ * @param data
+ *   User raw data.
+ * @return
+ *   - On success, zero.
+ *   - On failure, a negative value.
+ */
+int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data);
+
+/**
+ * RX Interrupt control per queue.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param 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().
+ * @param epfd
+ *   Epoll instance fd which the intr vector associated to.
+ *   Using RTE_EPOLL_PER_THREAD allows to use per thread epoll instance.
+ * @param op
+ *   The operation be performed for the vector.
+ *   Operation type of {RTE_INTR_EVENT_ADD, RTE_INTR_EVENT_DEL}.
+ * @param data
+ *   User raw data.
+ * @return
+ *   - On success, zero.
+ *   - On failure, a negative value.
+ */
+int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id,
+                             int epfd, int op, void *data);
+
 /**
  * Turn on the LED on the Ethernet device.
  * This function turns on the LED on the Ethernet device.
@@ -3600,6 +3411,21 @@ int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_ty
 int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type,
                        enum rte_filter_op filter_op, void *arg);
 
+/**
+ * Get DCB information on an Ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param dcb_info
+ *   dcb information.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if port identifier is invalid.
+ *   - (-ENOTSUP) if hardware doesn't support.
+ */
+int rte_eth_dev_get_dcb_info(uint8_t port_id,
+                            struct rte_eth_dcb_info *dcb_info);
+
 /**
  * Add a callback to be called on packet RX on a given port and queue.
  *
@@ -3721,6 +3547,46 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id,
                struct rte_eth_rxtx_callback *user_cb);
 
 /**
+ * Retrieve information about given port's RX 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 qinfo
+ *   A pointer to a structure of type *rte_eth_rxq_info_info* to be filled with
+ *   the information of the Ethernet device.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The port_id or the queue_id is out of range.
+ */
+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 TX queue.
+ *
+ * @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 qinfo
+ *   A pointer to a structure of type *rte_eth_txq_info_info* to be filled with
+ *   the information of the Ethernet device.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The port_id or the queue_id is out of range.
+ */
+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
@@ -3878,6 +3744,20 @@ extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
 extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
                                              struct timespec *timestamp);
 
+/**
+ * Copy pci device info to the Ethernet device data.
+ *
+ * @param eth_dev
+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
+ * @param pci_dev
+ * The *pci_dev* pointer is the address of the *rte_pci_device* structure.
+ *
+ * @return
+ *   - 0 on success, negative on error
+ */
+extern void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev);
+
+
 #ifdef __cplusplus
 }
 #endif