ethdev: add supported hash function check
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index 784c6fa..b9eb8ae 100644 (file)
@@ -988,6 +988,27 @@ struct rte_eth_conf {
 
 struct rte_pci_device;
 
+/*
+ * Fallback default preferred Rx/Tx port parameters.
+ * These are used if an application requests default parameters
+ * but the PMD does not provide preferred values.
+ */
+#define RTE_ETH_DEV_FALLBACK_RX_RINGSIZE 512
+#define RTE_ETH_DEV_FALLBACK_TX_RINGSIZE 512
+#define RTE_ETH_DEV_FALLBACK_RX_NBQUEUES 1
+#define RTE_ETH_DEV_FALLBACK_TX_NBQUEUES 1
+
+/**
+ * Preferred Rx/Tx port parameters.
+ * There are separate instances of this structure for transmission
+ * and reception respectively.
+ */
+struct rte_eth_dev_portconf {
+       uint16_t burst_size; /**< Device-preferred burst size */
+       uint16_t ring_size; /**< Device-preferred size of queue rings */
+       uint16_t nb_queues; /**< Device-preferred number of queues */
+};
+
 /**
  * Ethernet device information
  */
@@ -1029,6 +1050,10 @@ struct rte_eth_dev_info {
        /** Configured number of rx/tx queues */
        uint16_t nb_rx_queues; /**< Number of RX queues. */
        uint16_t nb_tx_queues; /**< Number of TX queues. */
+       /** Rx parameter recommendations */
+       struct rte_eth_dev_portconf default_rxportconf;
+       /** Tx parameter recommendations */
+       struct rte_eth_dev_portconf default_txportconf;
 };
 
 /**
@@ -1360,8 +1385,31 @@ int __rte_experimental rte_eth_dev_owner_get(const uint16_t port_id,
  * @return
  *   - The total number of usable Ethernet devices.
  */
+__rte_deprecated
 uint16_t rte_eth_dev_count(void);
 
+/**
+ * Get the number of ports which are usable for the application.
+ *
+ * These devices must be iterated by using the macro
+ * ``RTE_ETH_FOREACH_DEV`` or ``RTE_ETH_FOREACH_DEV_OWNED_BY``
+ * to deal with non-contiguous ranges of devices.
+ *
+ * @return
+ *   The count of available Ethernet devices.
+ */
+uint16_t __rte_experimental rte_eth_dev_count_avail(void);
+
+/**
+ * Get the total number of ports which are allocated.
+ *
+ * Some devices may not be available for the application.
+ *
+ * @return
+ *   The total count of Ethernet devices.
+ */
+uint16_t __rte_experimental rte_eth_dev_count_total(void);
+
 /**
  * Attach a new Ethernet device specified by arguments.
  *
@@ -2435,6 +2483,46 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
 int
 rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
 
+/**
+ * Subtypes for IPsec offload event(@ref RTE_ETH_EVENT_IPSEC) raised by
+ * eth device.
+ */
+enum rte_eth_event_ipsec_subtype {
+       RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
+                       /**< Unknown event type */
+       RTE_ETH_EVENT_IPSEC_ESN_OVERFLOW,
+                       /**< Sequence number overflow */
+       RTE_ETH_EVENT_IPSEC_SA_TIME_EXPIRY,
+                       /**< Soft time expiry of SA */
+       RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY,
+                       /**< Soft byte expiry of SA */
+       RTE_ETH_EVENT_IPSEC_MAX
+                       /**< Max value of this enum */
+};
+
+/**
+ * Descriptor for @ref RTE_ETH_EVENT_IPSEC event. Used by eth dev to send extra
+ * information of the IPsec offload event.
+ */
+struct rte_eth_event_ipsec_desc {
+       enum rte_eth_event_ipsec_subtype subtype;
+                       /**< Type of RTE_ETH_EVENT_IPSEC_* event */
+       uint64_t metadata;
+                       /**< Event specific metadata
+                        *
+                        * For the following events, *userdata* registered
+                        * with the *rte_security_session* would be returned
+                        * as metadata,
+                        *
+                        * - @ref RTE_ETH_EVENT_IPSEC_ESN_OVERFLOW
+                        * - @ref RTE_ETH_EVENT_IPSEC_SA_TIME_EXPIRY
+                        * - @ref RTE_ETH_EVENT_IPSEC_SA_BYTE_EXPIRY
+                        *
+                        * @see struct rte_security_session_conf
+                        *
+                        */
+};
+
 /**
  * The eth device event type for interrupt, and maybe others in the future.
  */
@@ -2450,6 +2538,7 @@ enum rte_eth_event_type {
        RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
        RTE_ETH_EVENT_NEW,      /**< port is probed */
        RTE_ETH_EVENT_DESTROY,  /**< port is released */
+       RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
        RTE_ETH_EVENT_MAX       /**< max value of this enum */
 };
 
@@ -3863,6 +3952,9 @@ static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
  * invoke this function concurrently on the same tx queue without SW lock.
  * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
  *
+ * @see rte_eth_tx_prepare to perform some prior checks or adjustments
+ * for offloads.
+ *
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param queue_id