eal: fix plugin loading without requiring full path
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index 48a540d..e92bf8d 100644 (file)
@@ -198,26 +198,26 @@ struct rte_eth_stats {
        /**< Total of RX packets dropped by the HW,
         * because there are no available mbufs (i.e. RX queues are full).
         */
-       uint64_t ibadcrc;
+       uint64_t ibadcrc __rte_deprecated;
        /**< Deprecated; Total of RX packets with CRC error. */
-       uint64_t ibadlen;
+       uint64_t ibadlen __rte_deprecated;
        /**< Deprecated; Total of RX packets with bad length. */
        uint64_t ierrors;   /**< Total number of erroneous received packets. */
        uint64_t oerrors;   /**< Total number of failed transmitted packets. */
        uint64_t imcasts;
        /**< Deprecated; Total number of multicast received packets. */
        uint64_t rx_nombuf; /**< Total number of RX mbuf allocation failures. */
-       uint64_t fdirmatch;
+       uint64_t fdirmatch __rte_deprecated;
        /**< Deprecated; Total number of RX packets matching a filter. */
-       uint64_t fdirmiss;
+       uint64_t fdirmiss __rte_deprecated;
        /**< Deprecated; Total number of RX packets not matching any filter. */
-       uint64_t tx_pause_xon;
+       uint64_t tx_pause_xon __rte_deprecated;
         /**< Deprecated; Total nb. of XON pause frame sent. */
-       uint64_t rx_pause_xon;
+       uint64_t rx_pause_xon __rte_deprecated;
        /**< Deprecated; Total nb. of XON pause frame received. */
-       uint64_t tx_pause_xoff;
+       uint64_t tx_pause_xoff __rte_deprecated;
        /**< Deprecated; Total nb. of XOFF pause frame sent. */
-       uint64_t rx_pause_xoff;
+       uint64_t rx_pause_xoff __rte_deprecated;
        /**< Deprecated; Total nb. of XOFF pause frame received. */
        uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
        /**< Total number of queue RX packets. */
@@ -1206,6 +1206,17 @@ typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev,
                                                struct timespec *timestamp);
 /**< @internal Function used to read a TX IEEE1588/802.1AS timestamp. */
 
+typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t);
+/**< @internal Function used to adjust the device clock */
+
+typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev,
+                                     struct timespec *timestamp);
+/**< @internal Function used to get time from the device clock. */
+
+typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev,
+                                      const struct timespec *timestamp);
+/**< @internal Function used to get time from the device clock */
+
 typedef int (*eth_get_reg_length_t)(struct rte_eth_dev *dev);
 /**< @internal Retrieve device register count  */
 
@@ -1400,6 +1411,12 @@ struct eth_dev_ops {
 
        /** Get DCB information */
        eth_get_dcb_info get_dcb_info;
+       /** Adjust the device clock.*/
+       eth_timesync_adjust_time timesync_adjust_time;
+       /** Get the device clock time. */
+       eth_timesync_read_time timesync_read_time;
+       /** Set the device clock time. */
+       eth_timesync_write_time timesync_write_time;
 };
 
 /**
@@ -3754,6 +3771,60 @@ 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);
 
+/**
+ * Adjust the timesync clock on an Ethernet device.
+ *
+ * This is usually used in conjunction with other Ethdev timesync functions to
+ * synchronize the device time using the IEEE1588/802.1AS protocol.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param delta
+ *   The adjustment in nanoseconds.
+ *
+ * @return
+ *   - 0: Success.
+ *   - -ENODEV: The port ID is invalid.
+ *   - -ENOTSUP: The function is not supported by the Ethernet driver.
+ */
+extern int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta);
+
+/**
+ * Read the time from the timesync clock on an Ethernet device.
+ *
+ * This is usually used in conjunction with other Ethdev timesync functions to
+ * synchronize the device time using the IEEE1588/802.1AS protocol.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param time
+ *   Pointer to the timespec struct that holds the time.
+ *
+ * @return
+ *   - 0: Success.
+ */
+extern int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time);
+
+/**
+ * Set the time of the timesync clock on an Ethernet device.
+ *
+ * This is usually used in conjunction with other Ethdev timesync functions to
+ * synchronize the device time using the IEEE1588/802.1AS protocol.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param time
+ *   Pointer to the timespec struct that holds the time.
+ *
+ * @return
+ *   - 0: Success.
+ *   - -EINVAL: No timestamp is available.
+ *   - -ENODEV: The port ID is invalid.
+ *   - -ENOTSUP: The function is not supported by the Ethernet driver.
+ */
+extern int rte_eth_timesync_write_time(uint8_t port_id,
+                                      const struct timespec *time);
+
 /**
  * Copy pci device info to the Ethernet device data.
  *
@@ -3768,6 +3839,30 @@ extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
 extern void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev);
 
 
+/**
+ * Create memzone for HW rings.
+ * malloc can't be used as the physical address is needed.
+ * If the memzone is already created, then this function returns a ptr
+ * to the old one.
+ *
+ * @param eth_dev
+ *   The *eth_dev* pointer is the address of the *rte_eth_dev* structure
+ * @param name
+ *   The name of the memory zone
+ * @param queue_id
+ *   The index of the queue to add to name
+ * @param size
+ *   The sizeof of the memory area
+ * @param align
+ *   Alignment for resulting memzone. Must be a power of 2.
+ * @param socket_id
+ *   The *socket_id* argument is the socket identifier in case of NUMA.
+ */
+const struct rte_memzone *
+rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
+                        uint16_t queue_id, size_t size,
+                        unsigned align, int socket_id);
+
 #ifdef __cplusplus
 }
 #endif