ethdev: add Rx HW timestamp capability
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index 0379eea..0b731bb 100644 (file)
@@ -369,6 +369,7 @@ struct rte_eth_rxmode {
                hw_strip_crc     : 1, /**< Enable CRC stripping by hardware. */
                enable_scatter   : 1, /**< Enable scatter packets rx handler */
                enable_lro       : 1, /**< Enable LRO */
+               hw_timestamp     : 1, /**< Enable HW timestamp */
                /**
                 * When set the offload bitfield should be ignored.
                 * Instead per-port Rx offloads should be set on offloads
@@ -922,7 +923,7 @@ struct rte_eth_conf {
                /**< Port dcb RX configuration. */
                struct rte_eth_vmdq_rx_conf vmdq_rx_conf;
                /**< Port vmdq RX configuration. */
-       } rx_adv_conf; /**< Port RX filtering configuration (union). */
+       } rx_adv_conf; /**< Port RX filtering configuration. */
        union {
                struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf;
                /**< Port vmdq+dcb TX configuration. */
@@ -961,6 +962,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_JUMBO_FRAME     0x00000800
 #define DEV_RX_OFFLOAD_CRC_STRIP       0x00001000
 #define DEV_RX_OFFLOAD_SCATTER         0x00002000
+#define DEV_RX_OFFLOAD_TIMESTAMP       0x00004000
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
                                 DEV_RX_OFFLOAD_UDP_CKSUM | \
                                 DEV_RX_OFFLOAD_TCP_CKSUM)
@@ -1501,6 +1503,10 @@ 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 */
 
+typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev,
+                                               const char *pool);
+/**< @internal Test if a port supports specific mempool ops */
+
 /**
  * @internal A structure containing the functions exported by an Ethernet driver.
  */
@@ -1621,6 +1627,8 @@ struct eth_dev_ops {
 
        eth_tm_ops_get_t tm_ops_get;
        /**< Get Traffic Management (TM) operations. */
+       eth_pool_ops_supported_t pool_ops_supported;
+       /**< Test if a port supports specific mempool ops */
 };
 
 /**
@@ -2363,8 +2371,12 @@ int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats);
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
+ * @return
+ *   - (0) if device notified to reset stats.
+ *   - (-ENOTSUP) if hardware doesn't support.
+ *   - (-ENODEV) if *port_id* invalid.
  */
-void rte_eth_stats_reset(uint16_t port_id);
+int rte_eth_stats_reset(uint16_t port_id);
 
 /**
  * Retrieve names of extended statistics of an Ethernet device.
@@ -4555,6 +4567,24 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
                                     uint16_t *nb_rx_desc,
                                     uint16_t *nb_tx_desc);
 
+
+/**
+ * Test if a port supports specific mempool ops.
+ *
+ * @param port_id
+ *   Port identifier of the Ethernet device.
+ * @param [in] pool
+ *   The name of the pool operations to test.
+ * @return
+ *   - 0: best mempool ops choice for this port.
+ *   - 1: mempool ops are supported for this port.
+ *   - -ENOTSUP: mempool ops not supported for this port.
+ *   - -ENODEV: Invalid port Identifier.
+ *   - -EINVAL: Pool param is null.
+ */
+int
+rte_eth_dev_pool_ops_supported(uint8_t port_id, const char *pool);
+
 #ifdef __cplusplus
 }
 #endif