ethdev: introduce generic dummy packet burst function
[dpdk.git] / lib / ethdev / ethdev_driver.h
index dcbffd4..6d697a8 100644 (file)
@@ -227,7 +227,7 @@ typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);
  * @retval -E_RTE_SECONDARY
  *   Function was called from a secondary process instance and not supported.
  * @retval -ETIMEDOUT
- *   Attempt to enable promiscuos mode failed because of timeout.
+ *   Attempt to enable promiscuous mode failed because of timeout.
  * @retval -EAGAIN
  *   Failed to enable promiscuous mode.
  */
@@ -252,7 +252,7 @@ typedef int (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
  * @retval -E_RTE_SECONDARY
  *   Function was called from a secondary process instance and not supported.
  * @retval -ETIMEDOUT
- *   Attempt to disable promiscuos mode failed because of timeout.
+ *   Attempt to disable promiscuous mode failed because of timeout.
  * @retval -EAGAIN
  *   Failed to disable promiscuous mode.
  */
@@ -533,6 +533,13 @@ typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
 typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
                                struct rte_eth_pfc_conf *pfc_conf);
 
+/** @internal Get info for queue based PFC on an Ethernet device. */
+typedef int (*priority_flow_ctrl_queue_info_get_t)(struct rte_eth_dev *dev,
+                       struct rte_eth_pfc_queue_info *pfc_queue_info);
+/** @internal Configure queue based PFC parameter on an Ethernet device. */
+typedef int (*priority_flow_ctrl_queue_config_t)(struct rte_eth_dev *dev,
+                       struct rte_eth_pfc_queue_conf *pfc_queue_conf);
+
 /** @internal Update RSS redirection table on an Ethernet device. */
 typedef int (*reta_update_t)(struct rte_eth_dev *dev,
                             struct rte_eth_rss_reta_entry64 *reta_conf,
@@ -990,6 +997,73 @@ typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev,
 typedef int (*eth_rx_metadata_negotiate_t)(struct rte_eth_dev *dev,
                                       uint64_t *features);
 
+/**
+ * @internal
+ * Get IP reassembly offload capability of a PMD.
+ *
+ * @param dev
+ *   Port (ethdev) handle
+ *
+ * @param[out] conf
+ *   IP reassembly capability supported by the PMD
+ *
+ * @return
+ *   Negative errno value on error, zero otherwise
+ */
+typedef int (*eth_ip_reassembly_capability_get_t)(struct rte_eth_dev *dev,
+               struct rte_eth_ip_reassembly_params *capa);
+
+/**
+ * @internal
+ * Get IP reassembly offload configuration parameters set in PMD.
+ *
+ * @param dev
+ *   Port (ethdev) handle
+ *
+ * @param[out] conf
+ *   Configuration parameters for IP reassembly.
+ *
+ * @return
+ *   Negative errno value on error, zero otherwise
+ */
+typedef int (*eth_ip_reassembly_conf_get_t)(struct rte_eth_dev *dev,
+               struct rte_eth_ip_reassembly_params *conf);
+
+/**
+ * @internal
+ * Set configuration parameters for enabling IP reassembly offload in hardware.
+ *
+ * @param dev
+ *   Port (ethdev) handle
+ *
+ * @param[in] conf
+ *   Configuration parameters for IP reassembly.
+ *
+ * @return
+ *   Negative errno value on error, zero otherwise
+ */
+typedef int (*eth_ip_reassembly_conf_set_t)(struct rte_eth_dev *dev,
+               const struct rte_eth_ip_reassembly_params *conf);
+
+/**
+ * @internal
+ * Dump private info from device to a file.
+ *
+ * @param dev
+ *   Port (ethdev) handle.
+ * @param file
+ *   A pointer to a file for output.
+ *
+ * @return
+ *   Negative value on error, 0 on success.
+ *
+ * @retval 0
+ *   Success
+ * @retval -EINVAL
+ *   Invalid file
+ */
+typedef int (*eth_dev_priv_dump_t)(struct rte_eth_dev *dev, FILE *file);
+
 /**
  * @internal A structure containing the functions exported by an Ethernet driver.
  */
@@ -1080,6 +1154,10 @@ struct eth_dev_ops {
        flow_ctrl_set_t            flow_ctrl_set; /**< Setup flow control */
        /** Setup priority flow control */
        priority_flow_ctrl_set_t   priority_flow_ctrl_set;
+       /** Priority flow control queue info get */
+       priority_flow_ctrl_queue_info_get_t priority_flow_ctrl_queue_info_get;
+       /** Priority flow control queue configure */
+       priority_flow_ctrl_queue_config_t priority_flow_ctrl_queue_config;
 
        /** Set Unicast Table Array */
        eth_uc_hash_table_set_t    uc_hash_table_set;
@@ -1186,6 +1264,16 @@ struct eth_dev_ops {
         * kinds of metadata to the PMD
         */
        eth_rx_metadata_negotiate_t rx_metadata_negotiate;
+
+       /** Get IP reassembly capability */
+       eth_ip_reassembly_capability_get_t ip_reassembly_capability_get;
+       /** Get IP reassembly configuration */
+       eth_ip_reassembly_conf_get_t ip_reassembly_conf_get;
+       /** Set IP reassembly configuration */
+       eth_ip_reassembly_conf_set_t ip_reassembly_conf_set;
+
+       /** Dump private info from device */
+       eth_dev_priv_dump_t eth_dev_priv_dump;
 };
 
 /**
@@ -1421,6 +1509,23 @@ rte_eth_linkstatus_get(const struct rte_eth_dev *dev,
        *dst = __atomic_load_n(src, __ATOMIC_SEQ_CST);
 }
 
+/**
+ * @internal
+ * Dummy DPDK callback for Rx/Tx packet burst.
+ *
+ * @param queue
+ *  Pointer to Rx/Tx queue
+ * @param pkts
+ *  Packet array
+ * @param nb_pkts
+ *  Number of packets in packet array
+ */
+__rte_internal
+uint16_t
+rte_eth_pkt_burst_dummy(void *queue __rte_unused,
+               struct rte_mbuf **pkts __rte_unused,
+               uint16_t nb_pkts __rte_unused);
+
 /**
  * Allocate an unique switch domain identifier.
  *
@@ -1629,6 +1734,24 @@ rte_eth_hairpin_queue_peer_bind(uint16_t cur_port, uint16_t cur_queue,
                                struct rte_hairpin_peer_info *peer_info,
                                uint32_t direction);
 
+/**
+ * @internal
+ * Get rte_eth_dev from device name. The device name should be specified
+ * as below:
+ * - PCIe address (Domain:Bus:Device.Function), for example 0000:2:00.0
+ * - SoC device name, for example fsl-gmac0
+ * - vdev dpdk name, for example net_[pcap0|null0|tap0]
+ *
+ * @param name
+ *   PCI address or name of the device
+ * @return
+ *   - rte_eth_dev if successful
+ *   - NULL on failure
+ */
+__rte_internal
+struct rte_eth_dev*
+rte_eth_dev_get_by_name(const char *name);
+
 /**
  * @internal
  * Reset the current queue state and configuration to disconnect (unbind) it
@@ -1652,6 +1775,14 @@ int
 rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue,
                                  uint32_t direction);
 
+/**
+ * @internal
+ * Register mbuf dynamic field and flag for IP reassembly incomplete case.
+ */
+__rte_internal
+int
+rte_eth_ip_reassembly_dynfield_register(int *field_offset, int *flag);
+
 
 /*
  * Legacy ethdev API used internally by drivers.