* [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header
@ 2017-12-01 2:29 Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage Ferruh Yigit
` (7 more replies)
0 siblings, 8 replies; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 2:29 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
remove RTE_ETHDEV_HAS_LRO_SUPPORT flag from header.
Flag seems added with the patch that adds LRO support, and intention
looks like giving a pointer to application that library supports LRO.
Fixes: 8eecb3295aed ("ixgbe: add LRO support")
Cc: vladz@cloudius-systems.com
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 341c2d624..e620c3706 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -172,9 +172,6 @@ extern "C" {
#include <stdint.h>
-/* Use this macro to check if LRO API is supported */
-#define RTE_ETHDEV_HAS_LRO_SUPPORT
-
#include <rte_log.h>
#include <rte_interrupts.h>
#include <rte_dev.h>
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage
2017-12-01 2:29 [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
@ 2017-12-01 2:29 ` Ferruh Yigit
2017-12-01 9:01 ` Hemant Agrawal
2017-12-01 23:52 ` Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs Ferruh Yigit
` (6 subsequent siblings)
7 siblings, 2 replies; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 2:29 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon
Cc: dev, vladz, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
port_id is now 16bits, update function parameter according.
Fixes: 4c270218aa26 ("ethdev: support security APIs")
Cc: stable@dpdk.org
Cc: declan.doherty@intel.com
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Boris Pismenny <borisp@mellanox.com>
Cc: Aviad Yehezkel <aviadye@mellanox.com>
Cc: Radu Nicolau <radu.nicolau@intel.com>
Cc: Declan Doherty <declan.doherty@intel.com>
---
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 318af2869..eed3d3005 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -301,7 +301,7 @@ rte_eth_dev_socket_id(uint16_t port_id)
}
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id)
+rte_eth_dev_get_sec_ctx(uint16_t port_id)
{
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL);
return rte_eth_devices[port_id].security_ctx;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index e620c3706..59189096e 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1745,7 +1745,7 @@ struct rte_eth_dev {
} __rte_cache_aligned;
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
+rte_eth_dev_get_sec_ctx(uint16_t port_id);
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs
2017-12-01 2:29 [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage Ferruh Yigit
@ 2017-12-01 2:29 ` Ferruh Yigit
2017-12-01 6:24 ` Shreyansh Jain
2017-12-01 8:59 ` Hemant Agrawal
2017-12-01 2:29 ` [dpdk-dev] [PATCH 4/7] ethdev: separate internal structures into own header Ferruh Yigit
` (5 subsequent siblings)
7 siblings, 2 replies; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 2:29 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon, Hemant Agrawal, Shreyansh Jain,
Nipun Gupta, Jerin Jacob, Santosh Shukla, John W. Linville,
Shepard Siegel, Ed Czeck, John Miller, Allain Legacy,
Matt Peters, Harish Patil, Rasesh Mody, Stephen Hurd,
Ajit Khaparde, Declan Doherty, Rahul Lakkireddy, Wenzhuo Lu,
Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
John Daley, Nelson Escobar, Gaetan Rivet, Qi Zhang, Xiao Wang,
Jingjing Wu, Beilei Xing, Chao Zhu, Jianbo Liu,
Konstantin Ananyev, Shijith Thotton,
Srisivasubramanian Srinivasan, Adrien Mazarguil,
Nelio Laranjeiro, Yongseok Koh, Jacek Siuda, Tomasz Duszynski,
Dmitri Epshtein, Natalie Samsonov, Alejandro Lucero,
Tetsuya Mukawa, Shahed Shaikh, Bruce Richardson,
Andrew Rybchenko, Jasvinder Singh, Cristian Dumitrescu,
Matej Vido, Pascal Mazon, Maciej Czekaj, Yuanhan Liu,
Maxime Coquelin, Shrikrishna Khare
Cc: dev, vladz
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.
There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.
More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
drivers/net/bonding/rte_eth_bond_private.h | 2 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 2 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 2 +-
drivers/net/e1000/igb_flow.c | 2 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 2 +-
drivers/net/enic/enic_clsf.c | 2 +-
drivers/net/enic/enic_ethdev.c | 2 +-
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/failsafe/failsafe.c | 2 +-
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 2 +-
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/rte_pmd_i40e.h | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 2 +-
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +-
drivers/net/kni/rte_eth_kni.c | 2 +-
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 2 +-
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/mlx5.c | 2 +-
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
| 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mrvl/mrvl_ethdev.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/null/rte_eth_null.c | 2 +-
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 2 +-
drivers/net/qede/qede_ethdev.h | 2 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 2 +-
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 2 +-
drivers/net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 2 +-
drivers/net/tap/rte_eth_tap.c | 2 +-
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.c | 1 +
lib/librte_ether/rte_ethdev.h | 114 +----------------
lib/librte_ether/rte_ethdev_driver.h | 163 ++++++++++++++++++++++++
lib/librte_ether/rte_ethdev_pci.h | 2 +-
lib/librte_ether/rte_ethdev_vdev.h | 2 +-
149 files changed, 314 insertions(+), 255 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_driver.h
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 1cc8c8939..66f861aaa 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -53,7 +53,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_bus.h>
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index 9890e09ce..fec154545 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -44,7 +44,7 @@
#include <stdbool.h>
#include <net/if.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <compat.h>
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 480857e57..8f4993f3a 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -40,7 +40,7 @@
#include <rte_malloc.h>
#include <rte_devargs.h>
#include <rte_memcpy.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <fslmc_vfio.h>
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 7831201ad..eec5cdd94 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -48,7 +48,7 @@
#include <eal_filesystem.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index 334e1f5ad..55c38fd8d 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -45,7 +45,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
index ae189c72a..7a86d047a 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
@@ -44,7 +44,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index f00070f3f..6a6c8c3b6 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -50,7 +50,7 @@
#include<sys/eventfd.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index eeeb23127..a20a556d4 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -52,7 +52,7 @@
#include <rte_memory.h>
#include <rte_pci.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fslmc_vfio.h>
diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
index 005e6234d..a8da9803b 100644
--- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
+++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
@@ -44,7 +44,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <mc/fsl_dpcon.h>
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index 117b1453e..b743ec113 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -36,7 +36,7 @@
#include <rte_debug.h>
#include <rte_dev.h>
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <rte_lcore.h>
#include <rte_log.h>
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 8bcbaa892..7273108a7 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -40,7 +40,7 @@
#include <errno.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index fa84eb9c2..0cddfacdf 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -37,7 +37,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index 3a54a4c91..146787112 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -38,7 +38,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
int eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
diff --git a/drivers/net/ark/ark_ethdev_tx.h b/drivers/net/ark/ark_ethdev_tx.h
index 8aaafc22e..657f895a4 100644
--- a/drivers/net/ark/ark_ethdev_tx.h
+++ b/drivers/net/ark/ark_ethdev_tx.h
@@ -36,7 +36,7 @@
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
uint16_t eth_ark_xmit_pkts_noop(void *vtxq,
diff --git a/drivers/net/ark/ark_ext.h b/drivers/net/ark/ark_ext.h
index d26c8198b..031cfddc3 100644
--- a/drivers/net/ark/ark_ext.h
+++ b/drivers/net/ark/ark_ext.h
@@ -34,7 +34,7 @@
#ifndef _ARK_EXT_H_
#define _ARK_EXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* This is the template file for users who which to define a dynamic
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index aef2cf73b..41eb260e6 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -38,7 +38,7 @@
#include <assert.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 202a1d9be..2cadaab80 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -36,7 +36,7 @@
#include <locale.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktchkr.h"
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index 018f37b69..d3c3dee1e 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -38,7 +38,7 @@
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktgen.h"
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 9b342bfa3..0796b3bec 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -36,7 +36,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h
index 967d6dc50..37cac1589 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.h
+++ b/drivers/net/bnx2x/bnx2x_ethdev.h
@@ -33,7 +33,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_eal.h>
#include <rte_mempool.h>
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 8ab1c7f85..44fc2c6d0 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -40,7 +40,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
#include <rte_lcore.h>
#include <rte_spinlock.h>
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3b6813cbb..9cbbad847 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
diff --git a/drivers/net/bnxt/bnxt_stats.h b/drivers/net/bnxt/bnxt_stats.h
index 51d16f5d3..c1c83d57b 100644
--- a/drivers/net/bnxt/bnxt_stats.h
+++ b/drivers/net/bnxt/bnxt_stats.h
@@ -34,7 +34,7 @@
#ifndef _BNXT_STATS_H_
#define _BNXT_STATS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
void bnxt_free_stats(struct bnxt *bp);
int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index a31340742..f1972cfeb 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -36,7 +36,7 @@
#include <unistd.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h
index f881d30d6..cd7227ac2 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.h
+++ b/drivers/net/bnxt/rte_pmd_bnxt.h
@@ -34,7 +34,7 @@
#ifndef _PMD_BNXT_H_
#define _PMD_BNXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* Response sent back to the caller after callback
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 703bb397a..b002a8269 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -35,7 +35,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index fe2328954..f87e7752c 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -35,7 +35,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_tcp.h>
#include <rte_udp.h>
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index a5cfa6ac0..306004127 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -34,7 +34,7 @@
#ifndef _RTE_ETH_BOND_PRIVATE_H_
#define _RTE_ETH_BOND_PRIVATE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_bitmap.h>
diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 282e2e625..56f38c838 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -44,7 +44,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index dc153c731..5cd260f48 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 5b828c237..28db6c061 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -55,7 +55,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index fc10d9585..3d5aa596f 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index cf5a2ecfd..9b702cfe5 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -54,7 +54,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 5457d61b7..05b67eba7 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -35,7 +35,7 @@
/* System headers */
#include <stdbool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fsl_usd.h>
#include <fsl_qman.h>
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 41e57f2e2..8aef5d6e2 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -52,7 +52,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_ip.h>
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index e3ab90ac6..f35d7ec2b 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -35,7 +35,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 202f84f0a..1078e0002 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -35,7 +35,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 8ecd238dd..3dc627548 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -35,7 +35,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index a0c3b4dc5..6f8135337 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -45,7 +45,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 1d8f0794d..527a8ae51 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -60,7 +60,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index fdc139f35..9af9d3c24 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -45,7 +45,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index 22bad265f..4321fe055 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -44,7 +44,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index cd6ae2fbd..cdbef6d5a 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -45,7 +45,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 4ee12e9e4..eef11777d 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -60,7 +60,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 22db8951f..7ed8d0e63 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -32,7 +32,7 @@
*/
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_tcp.h>
#include <rte_atomic.h>
diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index 9b461424b..ac1d6a4c4 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -34,7 +34,7 @@
#include <libgen.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_hash.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 669dbf336..02353abfd 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -38,7 +38,7 @@
#include <rte_dev.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index a728d0777..0fd7dda3e 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -31,7 +31,7 @@
#include <errno.h>
#include <rte_log.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow_driver.h>
#include <rte_ether.h>
#include <rte_ip.h>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 8af0ccd3c..baf8e5c20 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -45,7 +45,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "enic_compat.h"
#include "enic.h"
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index e4b80d49c..bddecdb68 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -33,7 +33,7 @@
*/
#include "enic_compat.h"
-#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "wq_enet_desc.h"
#include "rq_enet_desc.h"
#include "cq_enet_desc.h"
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index a3663d516..32c1f19b6 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -31,7 +31,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include "enic_compat.h"
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 6bc5abac8..7cc758d10 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -33,7 +33,7 @@
#include <rte_alarm.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_devargs.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index e16a59036..2a204948f 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -35,7 +35,7 @@
#include <rte_debug.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_flow.h>
#include <rte_cycles.h>
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index d81cc3ca6..479091f54 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -38,7 +38,7 @@
#include <rte_atomic.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_devargs.h>
#define FAILSAFE_DRIVER_NAME "Fail-safe PMD"
diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c
index 70157c829..b52a7c437 100644
--- a/drivers/net/failsafe/failsafe_rxtx.c
+++ b/drivers/net/failsafe/failsafe_rxtx.c
@@ -34,7 +34,7 @@
#include <rte_atomic.h>
#include <rte_debug.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "failsafe_private.h"
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 2d05a4669..a6359c136 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index d6081e485..7ff14cd71 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -33,7 +33,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_net.h>
#include "fm10k.h"
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index ce042d3d2..fbd71c45f 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -33,7 +33,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "fm10k.h"
#include "base/fm10k_type.h"
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 811cc9ffe..e8fd613de 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -45,7 +45,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 91b5bb033..6bd967302 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -54,7 +54,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_dev.h>
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 3d7170d53..d43b2fb08 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -40,7 +40,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 7e4936e35..b5e52c487 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -39,7 +39,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_eth_ctrl.h>
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 94bb0cfd1..16ec4dd60 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -43,7 +43,7 @@
#include <rte_string_fns.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index ad06b71e6..3a90ad90d 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -46,7 +46,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index 5e4e472a3..f3fc82672 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index 39a6da061..c178f2084 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -34,7 +34,7 @@
#ifndef _I40E_RXTX_VEC_COMMON_H_
#define _I40E_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "i40e_ethdev.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index b5685e2b9..e549d1e8c 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 9d2d1f837..9476254f0 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -32,7 +32,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index 580ca4ae9..2233dbbbd 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -42,7 +42,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Response sent back to i40e driver from user app after callback
diff --git a/drivers/net/ixgbe/ixgbe_bypass.c b/drivers/net/ixgbe/ixgbe_bypass.c
index 38a449367..2b66041d5 100644
--- a/drivers/net/ixgbe/ixgbe_bypass.c
+++ b/drivers/net/ixgbe/ixgbe_bypass.c
@@ -33,7 +33,7 @@
#include <time.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_bypass_api.h"
#include "rte_pmd_ixgbe.h"
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ff19a564a..4fe01d9c9 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -55,7 +55,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 9281dc1a6..c25fe180b 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -42,7 +42,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_logs.h"
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 19c2d4799..42cad1815 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -54,7 +54,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index 105da11a0..68cb3a181 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ip.h>
#include <rte_jhash.h>
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 676e92c7b..5a3093fca 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -44,7 +44,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 9bc846245..4a30292cc 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -62,7 +62,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
index 9fc112b1c..9675703d2 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
@@ -34,7 +34,7 @@
#ifndef _IXGBE_RXTX_VEC_COMMON_H_
#define _IXGBE_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_rxtx.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index 2e87ffa0a..46c019140 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -32,7 +32,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 486239ba9..360741972 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -32,7 +32,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index f12737857..16721785e 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "base/ixgbe_api.h"
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 81b18f876..c96463aaf 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -39,7 +39,7 @@
#ifndef _PMD_IXGBE_H_
#define _PMD_IXGBE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Notify VF when PF link status changes.
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index 8f269532d..a4166e315 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -35,7 +35,7 @@
#include <pthread.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kni.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 7f7e98d78..bd1e9d478 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -33,7 +33,7 @@
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/base/lio_mbox.c b/drivers/net/liquidio/base/lio_mbox.c
index b4abc6235..f10f1bb90 100644
--- a/drivers/net/liquidio/base/lio_mbox.c
+++ b/drivers/net/liquidio/base/lio_mbox.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include "lio_logs.h"
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 6b5d52ef7..96501a8d9 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 759556c82..573670d55 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index f9e4f9d73..fe7aab009 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -57,7 +57,7 @@
#include <rte_common.h>
#include <rte_dev.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 3aeef87e9..1a7c086d7 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_interrupts.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 2f69e7d4f..42ac2438b 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -63,7 +63,7 @@
#include <rte_bus_pci.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_pci.h>
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 8b87b2989..378138bb7 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -57,7 +57,7 @@
#include <rte_byteorder.h>
#include <rte_errno.h>
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index 651fd37b6..ef48014ba 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -47,7 +47,7 @@
#endif
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c
index 50d197698..c0a96f721 100644
--- a/drivers/net/mlx4/mlx4_intr.c
+++ b/drivers/net/mlx4/mlx4_intr.c
@@ -52,7 +52,7 @@
#include <rte_alarm.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_io.h>
#include <rte_interrupts.h>
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index 53313c56f..c4c66560a 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -55,7 +55,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h
index 463df2b0b..84c32cb7e 100644
--- a/drivers/net/mlx4/mlx4_rxtx.h
+++ b/drivers/net/mlx4/mlx4_rxtx.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c
index 7882a4d0b..422420918 100644
--- a/drivers/net/mlx4/mlx4_txq.c
+++ b/drivers/net/mlx4/mlx4_txq.c
@@ -53,7 +53,7 @@
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 102a8c672..e6d965f70 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -51,7 +51,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index e6a69b823..00043ff4f 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -53,7 +53,7 @@
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_interrupts.h>
#include <rte_errno.h>
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index ca9ad0fef..d563f00c5 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -55,7 +55,7 @@
#include <sys/un.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_bus_pci.h>
#include <rte_mbuf.h>
#include <rte_common.h>
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 1eda83671..ce8307201 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -44,7 +44,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 9fb5ba5e7..a5e78ec8d 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -52,7 +52,7 @@
#endif
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5.h"
--git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index f4911359b..dcc2a2ab6 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -48,7 +48,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_rxtx.h"
diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c
index 6fb245ba1..897695855 100644
--- a/drivers/net/mlx5/mlx5_rxmode.c
+++ b/drivers/net/mlx5/mlx5_rxmode.c
@@ -45,7 +45,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_rxtx.h"
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index a4cdd374a..f230bdb11 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -52,7 +52,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_debug.h>
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 4cb6136fc..36234b870 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -34,7 +34,7 @@
#include <linux/sockios.h>
#include <linux/ethtool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index ed80a6bee..b0654bc50 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_interrupts.h>
#include <rte_alarm.h>
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index a786a6b63..14c6e9450 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -51,7 +51,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 6fc315ef3..af1fcf718 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -36,7 +36,7 @@
#include <assert.h>
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 293616528..5b6a1b3b7 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -32,7 +32,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_log.h>
#include <rte_malloc.h>
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 0501156ba..e461cc083 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -43,7 +43,7 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_debug.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ether.h>
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 032c30e9d..80fe0e5ce 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -32,7 +32,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h
index c47d4c6d3..bc0869892 100644
--- a/drivers/net/octeontx/octeontx_ethdev.h
+++ b/drivers/net/octeontx/octeontx_ethdev.h
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eventdev.h>
#include <rte_mempool.h>
#include <rte_memory.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c
index c97d5b351..30d908113 100644
--- a/drivers/net/octeontx/octeontx_rxtx.c
+++ b/drivers/net/octeontx/octeontx_rxtx.c
@@ -37,7 +37,7 @@
#include <rte_atomic.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index 382ff2b2f..7aa31c4f9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -33,7 +33,7 @@
#ifndef __OCTEONTX_RXTX_H__
#define __OCTEONTX_RXTX_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#ifndef __hot
#define __hot __attribute__((hot))
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 5a86752f9..1a8d88379 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -39,7 +39,7 @@
#include <pcap.h>
#include <rte_cycles.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 021de5c01..715319ab4 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -13,7 +13,7 @@
#include <sys/queue.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ip.h>
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index a73c631fe..98eb925a2 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -33,7 +33,7 @@
#include "rte_eth_ring.h"
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 7f11bf22d..e9dc66d7e 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -36,7 +36,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_spinlock.h>
diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index 3f6a604ba..ed369f570 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -33,7 +33,7 @@
#define _SFC_DP_RX_H
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h
index 94d1b1086..4eeeab2bb 100644
--- a/drivers/net/sfc/sfc_dp_tx.h
+++ b/drivers/net/sfc/sfc_dp_tx.h
@@ -32,7 +32,7 @@
#ifndef _SFC_DP_TX_H
#define _SFC_DP_TX_H
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 2f5f86f84..a4887844a 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -30,7 +30,7 @@
*/
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index 065defe0a..43b760993 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -32,7 +32,7 @@
#ifndef _SFC_EV_H_
#define _SFC_EV_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index f2050f65e..bc9aa55c0 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -31,7 +31,7 @@
#include <rte_tailq.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eth_ctrl.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 9e6282ead..53cd8248e 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -34,7 +34,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_tx.h b/drivers/net/sfc/sfc_tx.h
index 0c1c7083b..79a04dbda 100644
--- a/drivers/net/sfc/sfc_tx.h
+++ b/drivers/net/sfc/sfc_tx.h
@@ -33,7 +33,7 @@
#define _SFC_TX_H
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 3e47c2f98..201ad05a7 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -35,7 +35,7 @@
#include <stdlib.h>
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index 1f7580691..9cf632321 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -38,7 +38,7 @@
#include <rte_mbuf.h>
#include <rte_sched.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tm_driver.h>
#include "rte_eth_softnic.h"
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 74f151c4a..f1a5acc75 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -44,7 +44,7 @@
#include <libsze2.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 6b27679a8..d274b6dea 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -36,7 +36,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index 829f32f3e..00d6ad8a0 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -41,7 +41,7 @@
#include <linux/if_tun.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#ifdef IFF_MULTI_QUEUE
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index d65d3cee7..b0b740343 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -52,7 +52,7 @@
#include <rte_dev.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_interrupts.h>
#include <rte_log.h>
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index 71bc3cf2a..15c6af702 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -33,7 +33,7 @@
#ifndef __THUNDERX_NICVF_ETHDEV_H__
#define __THUNDERX_NICVF_ETHDEV_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define THUNDERX_NICVF_PMD_VERSION "2.0"
#define THUNDERX_REG_BYTES 8
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index e27776e6d..121b5b9ec 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -41,7 +41,7 @@
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h
index a3ccce290..f638e2011 100644
--- a/drivers/net/thunderx/nicvf_rxtx.h
+++ b/drivers/net/thunderx/nicvf_rxtx.h
@@ -34,7 +34,7 @@
#define __THUNDERX_NICVF_RXTX_H__
#include <rte_byteorder.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define NICVF_TX_OFFLOAD_MASK (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 0f8208ef1..9b7483203 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -39,7 +39,7 @@
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
struct nicvf_rbdr {
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 2536ee4a2..4b71ac397 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index e0328f61d..62bfff84a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -37,7 +37,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 3c5ce66ce..928a4363f 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -38,7 +38,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
struct virtqueue;
struct virtnet_ctl;
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 390c137c8..003aec7e7 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -44,7 +44,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index b5bc1c49f..56568ffa2 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -44,7 +44,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c
index b8b93551f..5933a6e15 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_neon.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c
@@ -40,7 +40,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c
index 94f65143b..fff63b463 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_sse.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c
@@ -43,7 +43,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 82d59ca8c..28a58e50d 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
#include <rte_malloc.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index aa396ab28..04fad23fb 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -61,7 +61,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 394cc9c05..9b6980eac 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -55,6 +55,7 @@ SRCS-y += ethdev_profile.c
# Export include files
#
SYMLINK-y-include += rte_ethdev.h
+SYMLINK-y-include += rte_ethdev_driver.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index eed3d3005..5558db7c4 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -66,6 +66,7 @@
#include "rte_ether.h"
#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "ethdev_profile.h"
static const char *MZ_RTE_ETH_DEV_DATA = "rte_eth_dev_data";
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 59189096e..f44858fd1 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -46,10 +46,10 @@
* to get its MAC address, the speed and the status of its physical link,
* to receive and to transmit packets, and so on.
*
- * - The driver-oriented Ethernet API that exports a function allowing
- * an Ethernet Poll Mode Driver (PMD) to simultaneously register itself as
- * an Ethernet device driver and as a PCI driver for a set of matching PCI
- * [Ethernet] devices classes.
+ * - The driver-oriented Ethernet API that exports functions allowing
+ * an Ethernet Poll Mode Driver (PMD) to allocate an Ethernet device instance,
+ * create memzone for HW rings and process registered callbacks, and so on.
+ * PMDs should include rte_ethdev_driver.h instead of this header.
*
* By default, all the functions of the Ethernet Device API exported by a PMD
* are lock-free functions which assume to not be invoked in parallel on
@@ -1856,53 +1856,6 @@ uint16_t rte_eth_find_next(uint16_t port_id);
*/
uint16_t rte_eth_dev_count(void);
-/**
- * @internal
- * Returns a ethdev slot specified by the unique identifier name.
- *
- * @param name
- * The pointer to the Unique identifier name for each Ethernet device
- * @return
- * - The pointer to the ethdev slot, on success. NULL on error
- */
-struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
-
-/**
- * @internal
- * Allocates a new ethdev slot for an ethernet device and returns the pointer
- * to that slot for the driver to use.
- *
- * @param name Unique identifier name for each Ethernet device
- * @param type Device type of this Ethernet device
- * @return
- * - Slot in the rte_dev_devices array for a new device;
- */
-struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
-
-/**
- * @internal
- * Attach to the ethdev already initialized by the primary
- * process.
- *
- * @param name Ethernet device's name.
- * @return
- * - Success: Slot in the rte_dev_devices array for attached
- * device.
- * - Error: Null pointer.
- */
-struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
-
-/**
- * @internal
- * Release the specified ethdev port.
- *
- * @param eth_dev
- * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
- * @return
- * - 0 on success, negative on error
- */
-int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
-
/**
* Attach a new Ethernet device specified by arguments.
*
@@ -1980,19 +1933,6 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
-/**
- * @internal
- * Release device queues and clear its configuration to force the user
- * application to reconfigure it. It is for internal use only.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- *
- * @return
- * void
- */
-void _rte_eth_dev_reset(struct rte_eth_dev *dev);
-
/**
* Allocate and set up a receive queue for an Ethernet device.
*
@@ -3573,28 +3513,6 @@ int rte_eth_dev_callback_unregister(uint16_t port_id,
enum rte_eth_event_type event,
rte_eth_dev_cb_fn cb_fn, void *cb_arg);
-/**
- * @internal Executes all the user application registered callbacks for
- * the specific device. It is for DPDK internal user only. User
- * application should not call it directly.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- * @param event
- * Eth device interrupt event type.
- * @param cb_arg
- * callback parameter.
- * @param ret_param
- * To pass data back to user application.
- * This allows the user application to decide if a particular function
- * is permitted or not.
- *
- * @return
- * int
- */
-int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
- enum rte_eth_event_type event, void *cb_arg, void *ret_param);
-
/**
* 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
@@ -4465,30 +4383,6 @@ int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
*/
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
-/**
- * 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);
-
/**
* Config l2 tunnel ether type of an Ethernet device for filtering specific
* tunnel packets by ether type.
diff --git a/lib/librte_ether/rte_ethdev_driver.h b/lib/librte_ether/rte_ethdev_driver.h
new file mode 100644
index 000000000..3e77d1439
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_driver.h
@@ -0,0 +1,163 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2017 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTE_ETHDEV_DRIVER_H_
+#define _RTE_ETHDEV_DRIVER_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device PMD API
+ *
+ * These APIs for the use from Ethernet drivers, user applications shouldn't
+ * use them.
+ *
+ */
+
+#include <rte_ethdev.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @internal
+ * Returns a ethdev slot specified by the unique identifier name.
+ *
+ * @param name
+ * The pointer to the Unique identifier name for each Ethernet device
+ * @return
+ * - The pointer to the ethdev slot, on success. NULL on error
+ */
+struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+
+/**
+ * @internal
+ * Allocates a new ethdev slot for an ethernet device and returns the pointer
+ * to that slot for the driver to use.
+ *
+ * @param name Unique identifier name for each Ethernet device
+ * @param type Device type of this Ethernet device
+ * @return
+ * - Slot in the rte_dev_devices array for a new device;
+ */
+struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
+
+/**
+ * @internal
+ * Attach to the ethdev already initialized by the primary
+ * process.
+ *
+ * @param name Ethernet device's name.
+ * @return
+ * - Success: Slot in the rte_dev_devices array for attached
+ * device.
+ * - Error: Null pointer.
+ */
+struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
+
+/**
+ * @internal
+ * Release the specified ethdev port.
+ *
+ * @param eth_dev
+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
+ * @return
+ * - 0 on success, negative on error
+ */
+int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
+
+/**
+ * @internal
+ * Release device queues and clear its configuration to force the user
+ * application to reconfigure it. It is for internal use only.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ *
+ * @return
+ * void
+ */
+void _rte_eth_dev_reset(struct rte_eth_dev *dev);
+
+/**
+ * @internal Executes all the user application registered callbacks for
+ * the specific device. It is for DPDK internal user only. User
+ * application should not call it directly.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ * @param event
+ * Eth device interrupt event type.
+ * @param cb_arg
+ * callback parameter.
+ * @param ret_param
+ * To pass data back to user application.
+ * This allows the user application to decide if a particular function
+ * is permitted or not.
+ *
+ * @return
+ * int
+ */
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+ enum rte_eth_event_type event, void *cb_arg, void *ret_param);
+
+/**
+ * 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
+
+#endif /* _RTE_ETHDEV_DRIVER_H_ */
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index 722075e09..2af330a09 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -37,7 +37,7 @@
#include <rte_malloc.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Copy pci device info to the Ethernet device data.
diff --git a/lib/librte_ether/rte_ethdev_vdev.h b/lib/librte_ether/rte_ethdev_vdev.h
index ff92e6ed0..a753c379f 100644
--- a/lib/librte_ether/rte_ethdev_vdev.h
+++ b/lib/librte_ether/rte_ethdev_vdev.h
@@ -36,7 +36,7 @@
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @internal
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH 4/7] ethdev: separate internal structures into own header
2017-12-01 2:29 [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs Ferruh Yigit
@ 2017-12-01 2:29 ` Ferruh Yigit
2017-12-01 5:44 ` Hemant Agrawal
2017-12-01 2:29 ` [dpdk-dev] [PATCH 5/7] ethdev: reorder inline functions Ferruh Yigit
` (4 subsequent siblings)
7 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 2:29 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
rte_ethdev_core.h created. Internal data structures are moved here.
These structures are mostly intended to be used by drivers, but they
need to be in the public header file because of the inline functions
in the ethdev.h header, and those inline functions are preferred to
kept because of the performance concerns.
The accessibility of the data structures are not changed, only logically
grouped to show that they are not intended to be used by applications.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.h | 579 +---------------------------------
lib/librte_ether/rte_ethdev_core.h | 619 +++++++++++++++++++++++++++++++++++++
3 files changed, 621 insertions(+), 578 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_core.h
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 9b6980eac..a87f47639 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -56,6 +56,7 @@ SRCS-y += ethdev_profile.c
#
SYMLINK-y-include += rte_ethdev.h
SYMLINK-y-include += rte_ethdev_driver.h
+SYMLINK-y-include += rte_ethdev_core.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index f44858fd1..e75e815e9 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1166,478 +1166,6 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
/**< l2 tunnel forwarding mask */
#define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
-/*
- * Definitions of all functions exported by an Ethernet driver through the
- * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
- * structure associated with an Ethernet device.
- */
-
-typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
-/**< @internal Ethernet device configuration. */
-
-typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to start a configured Ethernet device. */
-
-typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to stop a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link up a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link down a configured Ethernet device. */
-
-typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to close a configured Ethernet device. */
-
-typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
-/** <@internal Function used to reset a configured Ethernet device. */
-
-typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
-
-typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
-
-typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
- int wait_to_complete);
-/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
-
-typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_stats *igb_stats);
-/**< @internal Get global I/O statistics of an Ethernet device. */
-
-typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
-
-typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat *stats, unsigned n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
- const uint64_t *ids,
- uint64_t *values,
- unsigned int n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, unsigned size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
- unsigned int size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
- uint16_t queue_id,
- uint8_t stat_idx,
- uint8_t is_rx);
-/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
-
-typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_dev_info *dev_info);
-/**< @internal Get specific informations of an Ethernet device. */
-
-typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
-/**< @internal Get supported ptypes of an Ethernet device. */
-
-typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Start rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Stop rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- uint16_t nb_rx_desc,
- unsigned int socket_id,
- const struct rte_eth_rxconf *rx_conf,
- struct rte_mempool *mb_pool);
-/**< @internal Set up a receive queue of an Ethernet device. */
-
-typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t tx_queue_id,
- uint16_t nb_tx_desc,
- unsigned int socket_id,
- 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. */
-
-typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id);
-/**< @internal Get number of used descriptors on a receive queue. */
-
-typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
-/**< @internal Check DD bit of specific RX descriptor */
-
-typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
-/**< @internal Check the status of a Rx descriptor */
-
-typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
-/**< @internal Check the status of a Tx descriptor */
-
-typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
- char *fw_version, size_t fw_size);
-/**< @internal Get firmware information of an Ethernet device. */
-
-typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
-/**< @internal Force mbufs to be from TX ring. */
-
-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. */
-
-typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
-
-typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
- enum rte_vlan_type type, uint16_t tpid);
-/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
-
-typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
-/**< @internal set VLAN offload function by an Ethernet device. */
-
-typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal set port based TX VLAN insertion by an Ethernet device. */
-
-typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- int on);
-/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
-
-typedef uint16_t (*eth_rx_burst_t)(void *rxq,
- struct rte_mbuf **rx_pkts,
- uint16_t nb_pkts);
-/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_burst_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Send output packets on a transmit queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_prep_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Prepare output packets on a transmit queue of 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 */
-
-typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_fc_conf *fc_conf);
-/**< @internal Setup flow control parameter on an Ethernet device */
-
-typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_pfc_conf *pfc_conf);
-/**< @internal Setup priority flow control parameter on an Ethernet device */
-
-typedef int (*reta_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Update RSS redirection table on an Ethernet device */
-
-typedef int (*reta_query_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Query RSS redirection table on an Ethernet device */
-
-typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Update RSS hash configuration of an Ethernet device */
-
-typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Get current RSS hash configuration of an Ethernet device */
-
-typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
-/**< @internal Turn on SW controllable LED on an Ethernet device */
-
-typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
-/**< @internal Turn off SW controllable LED on an Ethernet device */
-
-typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
-/**< @internal Remove MAC address from receive address register */
-
-typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint32_t index,
- uint32_t vmdq);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint8_t on);
-/**< @internal Set a Unicast Hash bitmap */
-
-typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
- uint8_t on);
-/**< @internal Set all Unicast Hash bitmap */
-
-typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
- uint16_t queue_idx,
- uint16_t tx_rate);
-/**< @internal Set queue TX rate */
-
-typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
-/**< @internal Add a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
- uint8_t rule_id);
-/**< @internal Remove a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Add tunneling UDP port */
-
-typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Delete tunneling UDP port */
-
-typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-/**< @internal set the list of multicast addresses on an Ethernet device */
-
-typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
- struct timespec *timestamp,
- uint32_t flags);
-/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
-
-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_t)(struct rte_eth_dev *dev,
- struct rte_dev_reg_info *info);
-/**< @internal Retrieve registers */
-
-typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
-/**< @internal Retrieve eeprom size */
-
-typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Retrieve eeprom data */
-
-typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Program eeprom data */
-
-typedef int (*eth_l2_tunnel_eth_type_conf_t)
- (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
-/**< @internal config l2 tunnel ether type */
-
-typedef int (*eth_l2_tunnel_offload_set_t)
- (struct rte_eth_dev *dev,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**< @internal enable/disable the l2 tunnel offload functions */
-
-
-typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
- enum rte_filter_type filter_type,
- enum rte_filter_op filter_op,
- void *arg);
-/**< @internal Take operations to assigned filter type on an Ethernet device */
-
-typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
-
-typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Trafffic Metering and Policing (MTR) operations */
-
-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.
- */
-struct eth_dev_ops {
- eth_dev_configure_t dev_configure; /**< Configure device. */
- eth_dev_start_t dev_start; /**< Start device. */
- eth_dev_stop_t dev_stop; /**< Stop device. */
- eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
- eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
- eth_dev_close_t dev_close; /**< Close device. */
- eth_dev_reset_t dev_reset; /**< Reset device. */
- eth_link_update_t link_update; /**< Get device link state. */
-
- eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
- eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
- eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
- eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
- eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
- eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
- eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
- eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
- mtu_set_t mtu_set; /**< Set MTU. */
-
- eth_stats_get_t stats_get; /**< Get generic device statistics. */
- eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
- eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
- eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
- eth_xstats_get_names_t xstats_get_names;
- /**< Get names of extended statistics. */
- eth_queue_stats_mapping_set_t queue_stats_mapping_set;
- /**< Configure per queue stat counter mapping. */
-
- eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
- eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
- eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
- eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
- eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
- /**< Get packet types supported and identified by device. */
-
- vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
- vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
- vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
- vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
- vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
-
- eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
- eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
- eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
- eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
- eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
- eth_queue_release_t rx_queue_release; /**< Release RX queue. */
- eth_rx_queue_count_t rx_queue_count;
- /**< Get the number of used RX descriptors. */
- eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
- eth_rx_descriptor_status_t rx_descriptor_status;
- /**< Check the status of a Rx descriptor. */
- eth_tx_descriptor_status_t tx_descriptor_status;
- /**< Check the status of a Tx descriptor. */
- eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
- eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
- eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
- eth_queue_release_t tx_queue_release; /**< Release TX queue. */
- eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
-
- eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
- eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
-
- flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
- flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
- priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
-
- eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
- eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
-
- eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
- eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
-
- eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
- eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
- eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
- /** Config ether type of l2 tunnel. */
- eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
- /** Enable/disable l2 tunnel offload functions. */
-
- eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
-
- rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
- rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
- reta_update_t reta_update; /** Update redirection table. */
- reta_query_t reta_query; /** Query redirection table. */
-
- eth_get_reg_t get_reg; /**< Get registers. */
- eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
- eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
- eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
-
-
- eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
-
- eth_get_dcb_info get_dcb_info; /** Get DCB information. */
-
- eth_timesync_enable_t timesync_enable;
- /** Turn IEEE1588/802.1AS timestamping on. */
- eth_timesync_disable_t timesync_disable;
- /** Turn IEEE1588/802.1AS timestamping off. */
- eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
- /** Read the IEEE1588/802.1AS RX timestamp. */
- eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
- /** Read the IEEE1588/802.1AS TX timestamp. */
- eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
- eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
- eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
-
- eth_xstats_get_by_id_t xstats_get_by_id;
- /**< Get extended device statistic values by ID. */
- eth_xstats_get_names_by_id_t xstats_get_names_by_id;
- /**< Get name of extended device statistics by ID. */
-
- eth_tm_ops_get_t tm_ops_get;
- /**< Get Traffic Management (TM) operations. */
-
- eth_mtr_ops_get_t mtr_ops_get;
- /**< Get Traffic Metering and Policing (MTR) operations. */
-
- eth_pool_ops_supported_t pool_ops_supported;
- /**< Test if a port supports specific mempool ops */
-};
-
/**
* Function type used for RX packet processing packet callbacks.
*
@@ -1687,20 +1215,6 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
-/**
- * @internal
- * Structure used to hold information about the callbacks to be called for a
- * queue on RX and TX.
- */
-struct rte_eth_rxtx_callback {
- struct rte_eth_rxtx_callback *next;
- union{
- rte_rx_callback_fn rx;
- rte_tx_callback_fn tx;
- } fn;
- void *param;
-};
-
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1710,40 +1224,6 @@ enum rte_eth_dev_state {
RTE_ETH_DEV_DEFERRED,
};
-/**
- * @internal
- * The generic data structure associated with each ethernet device.
- *
- * Pointers to burst-oriented packet receive and transmit functions are
- * located at the beginning of the structure, along with the pointer to
- * where all the data elements for the particular device are stored in shared
- * memory. This split allows the function pointer and driver data to be per-
- * process, while the actual configuration data for the device is shared.
- */
-struct rte_eth_dev {
- eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
- eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
- eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
- struct rte_eth_dev_data *data; /**< Pointer to device data */
- const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
- struct rte_device *device; /**< Backing device */
- struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
- /** User application callbacks for NIC interrupts */
- struct rte_eth_dev_cb_list link_intr_cbs;
- /**
- * User-supplied functions called from rx_burst to post-process
- * received packets before passing them to the user
- */
- struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- /**
- * User-supplied functions called from tx_burst to pre-process
- * received packets before passing them to the driver for transmission.
- */
- struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- enum rte_eth_dev_state state; /**< Flag indicating the port state */
- void *security_ctx; /**< Context for security ops */
-} __rte_cache_aligned;
-
void *
rte_eth_dev_get_sec_ctx(uint16_t port_id);
@@ -1757,57 +1237,7 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-/**
- * @internal
- * The data part, with no function pointers, associated with each ethernet device.
- *
- * This structure is safe to place in shared memory to be common among different
- * processes in a multi-process configuration.
- */
-struct rte_eth_dev_data {
- char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
-
- void **rx_queues; /**< Array of pointers to RX queues. */
- void **tx_queues; /**< Array of pointers to TX queues. */
- uint16_t nb_rx_queues; /**< Number of RX queues. */
- uint16_t nb_tx_queues; /**< Number of TX queues. */
-
- struct rte_eth_dev_sriov sriov; /**< SRIOV data */
-
- void *dev_private; /**< PMD-specific private data */
-
- struct rte_eth_link dev_link;
- /**< Link-level information & status */
-
- struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
- uint16_t mtu; /**< Maximum Transmission Unit. */
-
- uint32_t min_rx_buf_size;
- /**< Common rx buffer size handled by all queues */
-
- uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
- struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
- uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
- /** bitmap array of associating Ethernet MAC addresses to pools */
- struct ether_addr* hash_mac_addrs;
- /** Device Ethernet MAC addresses of hash filtering. */
- uint16_t port_id; /**< Device [external] port identifier. */
- __extension__
- uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
- scattered_rx : 1, /**< RX of scattered packets 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). */
- lro : 1; /**< RX LRO is ON(1) / OFF(0) */
- uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint32_t dev_flags; /**< Capabilities */
- enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
- int numa_node; /**< NUMA node connection */
- struct rte_vlan_filter_conf vlan_filter_conf;
- /**< VLAN filter configuration. */
-};
+#include <rte_ethdev_core.h>
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
@@ -1816,13 +1246,6 @@ struct rte_eth_dev_data {
/** Device supports device removal interrupt */
#define RTE_ETH_DEV_INTR_RMV 0x0008
-/**
- * @internal
- * The pool of *rte_eth_dev* structures. The size of the pool
- * is configured at compile-time in the <rte_ethdev.c> file.
- */
-extern struct rte_eth_dev rte_eth_devices[];
-
/**
* Iterates over valid ethdev ports.
*
diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h
new file mode 100644
index 000000000..79610c368
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_core.h
@@ -0,0 +1,619 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2017 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTE_ETHDEV_COMMON_H_
+#define _RTE_ETHDEV_COMMON_H_
+/*
+ * Definitions of all functions exported by an Ethernet driver through the
+ * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
+ * structure associated with an Ethernet device.
+ */
+
+struct rte_eth_dev;
+
+typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
+/**< @internal Ethernet device configuration. */
+
+typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to start a configured Ethernet device. */
+
+typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to stop a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link up a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link down a configured Ethernet device. */
+
+typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to close a configured Ethernet device. */
+
+typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
+/** <@internal Function used to reset a configured Ethernet device. */
+
+typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
+
+typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
+
+typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
+ int wait_to_complete);
+/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
+
+typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_stats *igb_stats);
+/**< @internal Get global I/O statistics of an Ethernet device. */
+
+typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
+
+typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat *stats, unsigned n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
+ const uint64_t *ids,
+ uint64_t *values,
+ unsigned int n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, unsigned size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+ unsigned int size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id,
+ uint8_t stat_idx,
+ uint8_t is_rx);
+/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
+
+typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_dev_info *dev_info);
+/**< @internal Get specific informations of an Ethernet device. */
+
+typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
+/**< @internal Get supported ptypes of an Ethernet device. */
+
+typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Start rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Stop rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ uint16_t nb_rx_desc,
+ unsigned int socket_id,
+ const struct rte_eth_rxconf *rx_conf,
+ struct rte_mempool *mb_pool);
+/**< @internal Set up a receive queue of an Ethernet device. */
+
+typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t tx_queue_id,
+ uint16_t nb_tx_desc,
+ unsigned int socket_id,
+ 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. */
+
+typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id);
+/**< @internal Get number of used descriptors on a receive queue. */
+
+typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
+/**< @internal Check DD bit of specific RX descriptor */
+
+typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
+/**< @internal Check the status of a Rx descriptor */
+
+typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
+/**< @internal Check the status of a Tx descriptor */
+
+typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size);
+/**< @internal Get firmware information of an Ethernet device. */
+
+typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
+/**< @internal Force mbufs to be from TX ring. */
+
+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. */
+
+typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
+
+typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
+ enum rte_vlan_type type, uint16_t tpid);
+/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
+
+typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
+/**< @internal set VLAN offload function by an Ethernet device. */
+
+typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal set port based TX VLAN insertion by an Ethernet device. */
+
+typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ int on);
+/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
+
+typedef uint16_t (*eth_rx_burst_t)(void *rxq,
+ struct rte_mbuf **rx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_burst_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Send output packets on a transmit queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_prep_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Prepare output packets on a transmit queue of 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 */
+
+typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_fc_conf *fc_conf);
+/**< @internal Setup flow control parameter on an Ethernet device */
+
+typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_pfc_conf *pfc_conf);
+/**< @internal Setup priority flow control parameter on an Ethernet device */
+
+typedef int (*reta_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Update RSS redirection table on an Ethernet device */
+
+typedef int (*reta_query_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Query RSS redirection table on an Ethernet device */
+
+typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Update RSS hash configuration of an Ethernet device */
+
+typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Get current RSS hash configuration of an Ethernet device */
+
+typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
+/**< @internal Turn on SW controllable LED on an Ethernet device */
+
+typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
+/**< @internal Turn off SW controllable LED on an Ethernet device */
+
+typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
+/**< @internal Remove MAC address from receive address register */
+
+typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint32_t index,
+ uint32_t vmdq);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint8_t on);
+/**< @internal Set a Unicast Hash bitmap */
+
+typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
+ uint8_t on);
+/**< @internal Set all Unicast Hash bitmap */
+
+typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
+ uint16_t queue_idx,
+ uint16_t tx_rate);
+/**< @internal Set queue TX rate */
+
+typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
+/**< @internal Add a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
+ uint8_t rule_id);
+/**< @internal Remove a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Add tunneling UDP port */
+
+typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Delete tunneling UDP port */
+
+typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
+/**< @internal set the list of multicast addresses on an Ethernet device */
+
+typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
+ struct timespec *timestamp,
+ uint32_t flags);
+/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
+
+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_t)(struct rte_eth_dev *dev,
+ struct rte_dev_reg_info *info);
+/**< @internal Retrieve registers */
+
+typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
+/**< @internal Retrieve eeprom size */
+
+typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Retrieve eeprom data */
+
+typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Program eeprom data */
+
+typedef int (*eth_l2_tunnel_eth_type_conf_t)
+ (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
+/**< @internal config l2 tunnel ether type */
+
+typedef int (*eth_l2_tunnel_offload_set_t)
+ (struct rte_eth_dev *dev,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
+/**< @internal enable/disable the l2 tunnel offload functions */
+
+
+typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
+ enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op,
+ void *arg);
+/**< @internal Take operations to assigned filter type on an Ethernet device */
+
+typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
+
+typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Trafffic Metering and Policing (MTR) operations */
+
+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.
+ */
+struct eth_dev_ops {
+ eth_dev_configure_t dev_configure; /**< Configure device. */
+ eth_dev_start_t dev_start; /**< Start device. */
+ eth_dev_stop_t dev_stop; /**< Stop device. */
+ eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
+ eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
+ eth_dev_close_t dev_close; /**< Close device. */
+ eth_dev_reset_t dev_reset; /**< Reset device. */
+ eth_link_update_t link_update; /**< Get device link state. */
+
+ eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
+ eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
+ eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
+ eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
+ eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
+ eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
+ eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
+ eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
+ mtu_set_t mtu_set; /**< Set MTU. */
+
+ eth_stats_get_t stats_get; /**< Get generic device statistics. */
+ eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
+ eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
+ eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
+ eth_xstats_get_names_t xstats_get_names;
+ /**< Get names of extended statistics. */
+ eth_queue_stats_mapping_set_t queue_stats_mapping_set;
+ /**< Configure per queue stat counter mapping. */
+
+ eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
+ eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
+ eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
+ eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
+ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
+ /**< Get packet types supported and identified by device. */
+
+ vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
+ vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
+ vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
+ vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
+ vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
+
+ eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
+ eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
+ eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
+ eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
+ eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
+ eth_queue_release_t rx_queue_release; /**< Release RX queue. */
+ eth_rx_queue_count_t rx_queue_count;
+ /**< Get the number of used RX descriptors. */
+ eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
+ eth_rx_descriptor_status_t rx_descriptor_status;
+ /**< Check the status of a Rx descriptor. */
+ eth_tx_descriptor_status_t tx_descriptor_status;
+ /**< Check the status of a Tx descriptor. */
+ eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
+ eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
+ eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
+ eth_queue_release_t tx_queue_release; /**< Release TX queue. */
+ eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
+
+ eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
+ eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
+
+ flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
+ flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
+ priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
+
+ eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
+ eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
+
+ eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
+ eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
+
+ eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
+ eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
+ eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
+ /** Config ether type of l2 tunnel. */
+ eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
+ /** Enable/disable l2 tunnel offload functions. */
+
+ eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
+
+ rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
+ rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
+ reta_update_t reta_update; /** Update redirection table. */
+ reta_query_t reta_query; /** Query redirection table. */
+
+ eth_get_reg_t get_reg; /**< Get registers. */
+ eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
+ eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
+ eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
+
+
+ eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
+
+ eth_get_dcb_info get_dcb_info; /** Get DCB information. */
+
+ eth_timesync_enable_t timesync_enable;
+ /** Turn IEEE1588/802.1AS timestamping on. */
+ eth_timesync_disable_t timesync_disable;
+ /** Turn IEEE1588/802.1AS timestamping off. */
+ eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
+ /** Read the IEEE1588/802.1AS RX timestamp. */
+ eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
+ /** Read the IEEE1588/802.1AS TX timestamp. */
+ eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
+ eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
+ eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
+
+ eth_xstats_get_by_id_t xstats_get_by_id;
+ /**< Get extended device statistic values by ID. */
+ eth_xstats_get_names_by_id_t xstats_get_names_by_id;
+ /**< Get name of extended device statistics by ID. */
+
+ eth_tm_ops_get_t tm_ops_get;
+ /**< Get Traffic Management (TM) operations. */
+
+ eth_mtr_ops_get_t mtr_ops_get;
+ /**< Get Traffic Metering and Policing (MTR) operations. */
+
+ eth_pool_ops_supported_t pool_ops_supported;
+ /**< Test if a port supports specific mempool ops */
+};
+
+/**
+ * @internal
+ * Structure used to hold information about the callbacks to be called for a
+ * queue on RX and TX.
+ */
+struct rte_eth_rxtx_callback {
+ struct rte_eth_rxtx_callback *next;
+ union{
+ rte_rx_callback_fn rx;
+ rte_tx_callback_fn tx;
+ } fn;
+ void *param;
+};
+
+/**
+ * @internal
+ * The generic data structure associated with each ethernet device.
+ *
+ * Pointers to burst-oriented packet receive and transmit functions are
+ * located at the beginning of the structure, along with the pointer to
+ * where all the data elements for the particular device are stored in shared
+ * memory. This split allows the function pointer and driver data to be per-
+ * process, while the actual configuration data for the device is shared.
+ */
+struct rte_eth_dev {
+ eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
+ eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
+ eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
+ struct rte_eth_dev_data *data; /**< Pointer to device data */
+ const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
+ struct rte_device *device; /**< Backing device */
+ struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
+ /** User application callbacks for NIC interrupts */
+ struct rte_eth_dev_cb_list link_intr_cbs;
+ /**
+ * User-supplied functions called from rx_burst to post-process
+ * received packets before passing them to the user
+ */
+ struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ /**
+ * User-supplied functions called from tx_burst to pre-process
+ * received packets before passing them to the driver for transmission.
+ */
+ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ enum rte_eth_dev_state state; /**< Flag indicating the port state */
+ void *security_ctx; /**< Context for security ops */
+} __rte_cache_aligned;
+
+struct rte_eth_dev_sriov;
+
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each ethernet device.
+ *
+ * This structure is safe to place in shared memory to be common among different
+ * processes in a multi-process configuration.
+ */
+struct rte_eth_dev_data {
+ char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
+
+ void **rx_queues; /**< Array of pointers to RX queues. */
+ void **tx_queues; /**< Array of pointers to TX queues. */
+ uint16_t nb_rx_queues; /**< Number of RX queues. */
+ uint16_t nb_tx_queues; /**< Number of TX queues. */
+
+ struct rte_eth_dev_sriov sriov; /**< SRIOV data */
+
+ void *dev_private; /**< PMD-specific private data */
+
+ struct rte_eth_link dev_link;
+ /**< Link-level information & status */
+
+ struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
+ uint16_t mtu; /**< Maximum Transmission Unit. */
+
+ uint32_t min_rx_buf_size;
+ /**< Common rx buffer size handled by all queues */
+
+ uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
+ struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
+ uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
+ /** bitmap array of associating Ethernet MAC addresses to pools */
+ struct ether_addr* hash_mac_addrs;
+ /** Device Ethernet MAC addresses of hash filtering. */
+ uint16_t port_id; /**< Device [external] port identifier. */
+ __extension__
+ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
+ scattered_rx : 1, /**< RX of scattered packets 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). */
+ lro : 1; /**< RX LRO is ON(1) / OFF(0) */
+ uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint32_t dev_flags; /**< Capabilities */
+ enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
+ int numa_node; /**< NUMA node connection */
+ struct rte_vlan_filter_conf vlan_filter_conf;
+ /**< VLAN filter configuration. */
+};
+
+/**
+ * @internal
+ * The pool of *rte_eth_dev* structures. The size of the pool
+ * is configured at compile-time in the <rte_ethdev.c> file.
+ */
+extern struct rte_eth_dev rte_eth_devices[];
+
+#endif /* _RTE_ETHDEV_COMMON_H_ */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH 5/7] ethdev: reorder inline functions
2017-12-01 2:29 [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
` (2 preceding siblings ...)
2017-12-01 2:29 ` [dpdk-dev] [PATCH 4/7] ethdev: separate internal structures into own header Ferruh Yigit
@ 2017-12-01 2:29 ` Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 6/7] ethdev: rename function parameter for consistency Ferruh Yigit
` (3 subsequent siblings)
7 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 2:29 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
Move all inline function to the end of the ethdev.h header file and move
the ethdev_core.h just before inline functions.
Since inline functions need data structures in ethdev_core.h, this
reorder is to group them and make it clear where put further inline
functions.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 2688 +++++++++++++++++++++--------------------
1 file changed, 1345 insertions(+), 1343 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index e75e815e9..ce3b13107 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1215,6 +1215,8 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
+struct rte_eth_rxtx_callback;
+
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1237,8 +1239,6 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-#include <rte_ethdev_core.h>
-
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
/** Device is a bonded slave */
@@ -2157,1768 +2157,1770 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id);
*/
int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
+typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
+ void *userdata);
+
/**
+ * Structure used to buffer packets for future TX
+ * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ */
+struct rte_eth_dev_tx_buffer {
+ buffer_tx_error_fn error_callback;
+ void *error_userdata;
+ uint16_t size; /**< Size of buffer for buffered tx */
+ uint16_t length; /**< Number of packets in the array */
+ struct rte_mbuf *pkts[];
+ /**< Pending packets to be sent on explicit flush or when full */
+};
+
+/**
+ * Calculate the size of the tx buffer.
*
- * Retrieve a burst of input packets from a receive queue of an Ethernet
- * device. The retrieved packets are stored in *rte_mbuf* structures whose
- * pointers are supplied in the *rx_pkts* array.
- *
- * The rte_eth_rx_burst() function loops, parsing the RX ring of the
- * receive queue, up to *nb_pkts* packets, and for each completed RX
- * descriptor in the ring, it performs the following operations:
+ * @param sz
+ * Number of stored packets.
+ */
+#define RTE_ETH_TX_BUFFER_SIZE(sz) \
+ (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+
+/**
+ * Initialize default values for buffered transmitting
*
- * - Initialize the *rte_mbuf* data structure associated with the
- * RX descriptor according to the information provided by the NIC into
- * that RX descriptor.
+ * @param buffer
+ * Tx buffer to be initialized.
+ * @param size
+ * Buffer size
+ * @return
+ * 0 if no error
+ */
+int
+rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+
+/**
+ * Configure a callback for buffered packets which cannot be sent
*
- * - Store the *rte_mbuf* data structure into the next entry of the
- * *rx_pkts* array.
+ * Register a specific callback to be called when an attempt is made to send
+ * all packets buffered on an ethernet port, but not all packets can
+ * successfully be sent. The callback registered here will be called only
+ * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
+ * The default callback configured for each queue by default just frees the
+ * packets back to the calling mempool. If additional behaviour is required,
+ * for example, to count dropped packets, or to retry transmission of packets
+ * which cannot be sent, this function should be used to register a suitable
+ * callback function to implement the desired behaviour.
+ * The example callback "rte_eth_count_unsent_packet_callback()" is also
+ * provided as reference.
*
- * - Replenish the RX descriptor with a new *rte_mbuf* buffer
- * allocated from the memory pool associated with the receive queue at
- * initialization time.
+ * @param buffer
+ * The port identifier of the Ethernet device.
+ * @param callback
+ * The function to be used as the callback.
+ * @param userdata
+ * Arbitrary parameter to be passed to the callback function
+ * @return
+ * 0 on success, or -1 on error with rte_errno set appropriately
+ */
+int
+rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
+ buffer_tx_error_fn callback, void *userdata);
+
+/**
+ * Callback function for silently dropping unsent buffered packets.
*
- * When retrieving an input packet that was scattered by the controller
- * into multiple receive descriptors, the rte_eth_rx_burst() function
- * appends the associated *rte_mbuf* buffers to the first buffer of the
- * packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets silently and is used by tx buffered
+ * operations as default behavior.
*
- * The rte_eth_rx_burst() function returns the number of packets
- * actually retrieved, which is the number of *rte_mbuf* data structures
- * effectively supplied into the *rx_pkts* array.
- * A return value equal to *nb_pkts* indicates that the RX queue contained
- * at least *rx_pkts* packets, and this is likely to signify that other
- * received packets remain in the input queue. Applications implementing
- * a "retrieve as much received packets as possible" policy can check this
- * specific case and keep invoking the rte_eth_rx_burst() function until
- * a value less than *nb_pkts* is returned.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * This receive method has the following advantages:
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * - It allows a run-to-completion network stack engine to retrieve and
- * to immediately process received packets in a fast burst-oriented
- * approach, avoiding the overhead of unnecessary intermediate packet
- * queue/dequeue operations.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Not used
+ */
+void
+rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Callback function for tracking unsent buffered packets.
*
- * - Conversely, it also allows an asynchronous-oriented processing
- * method to retrieve bursts of received packets and to immediately
- * queue them for further parallel processing by another logical core,
- * for instance. However, instead of having received packets being
- * individually queued by the driver, this approach allows the caller
- * of the rte_eth_rx_burst() function to queue a burst of retrieved
- * packets at a time and therefore dramatically reduce the cost of
- * enqueue/dequeue operations per packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets, but also updates a user-supplied counter
+ * to track the overall number of packets dropped. The counter should be an
+ * uint64_t variable.
*
- * - It allows the rte_eth_rx_burst() function of the driver to take
- * advantage of burst-oriented hardware features (CPU cache,
- * prefetch instructions, and so on) to minimize the number of CPU
- * cycles per packet.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * To summarize, the proposed receive API enables many
- * burst-oriented optimizations in both synchronous and asynchronous
- * packet processing environments with no overhead in both cases.
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * The rte_eth_rx_burst() function does not provide any error
- * notification to avoid the corresponding overhead. As a hint, the
- * upper-level application might check the status of the device link once
- * being systematically returned a 0 value for a given number of tries.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Pointer to an uint64_t value, which will be incremented by unsent
+ */
+void
+rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Request the driver to free mbufs currently cached by the driver. The
+ * driver will only free the mbuf if it is no longer in use. It is the
+ * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
+ * called if needed.
*
* @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
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
* to rte_eth_dev_configure().
- * @param rx_pkts
- * The address of an array of pointers to *rte_mbuf* structures that
- * must be large enough to store *nb_pkts* pointers in it.
- * @param nb_pkts
- * The maximum number of packets to retrieve.
+ * @param free_cnt
+ * Maximum number of packets to free. Use 0 to indicate all possible packets
+ * should be freed. Note that a packet may be using multiple mbufs.
* @return
- * The number of packets actually retrieved, which is the number
- * of pointers to *rte_mbuf* structures effectively supplied to the
- * *rx_pkts* array.
+ * Failure: < 0
+ * -ENODEV: Invalid interface
+ * -ENOTSUP: Driver does not support function
+ * Success: >= 0
+ * 0-n: Number of packets freed. More packets may still remain in ring that
+ * are in use.
*/
-static inline uint16_t
-rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+int
+rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
- if (queue_id >= dev->data->nb_rx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
- int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
- rx_pkts, nb_pkts);
+/**
+ * The eth device event type for interrupt, and maybe others in the future.
+ */
+enum rte_eth_event_type {
+ RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
+ RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
+ RTE_ETH_EVENT_QUEUE_STATE,
+ /**< queue state event (enabled/disabled) */
+ RTE_ETH_EVENT_INTR_RESET,
+ /**< reset interrupt event, sent to VF on PF reset */
+ RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
+ RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
+ RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
+ RTE_ETH_EVENT_MAX /**< max value of this enum */
+};
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
+ enum rte_eth_event_type event, void *cb_arg, void *ret_param);
+/**< user application callback to be registered for interrupts */
- if (unlikely(cb != NULL)) {
- do {
- nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
- nb_pkts, cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
- return nb_rx;
-}
/**
- * Get the number of used descriptors of a rx queue
+ * Register a callback function for specific port id.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
+ * Port id.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback.
+ *
* @return
- * The number of used descriptors in the specific queue, or:
- * (-EINVAL) if *port_id* or *queue_id* is invalid
- * (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
- dev = &rte_eth_devices[port_id];
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
- if (queue_id >= dev->data->nb_rx_queues)
- return -EINVAL;
-
- return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
-}
+int rte_eth_dev_callback_register(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check if the DD bit of the specific RX descriptor in the queue has been set
+ * Unregister a callback function for specific port id.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
- * @param offset
- * The offset of the descriptor ID from tail.
+ * Port id.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback. -1 means to
+ * remove all for the same callback address and same event.
+ *
* @return
- * - (1) if the specific DD bit is set.
- * - (0) if the specific DD bit is not set.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
- return (*dev->dev_ops->rx_descriptor_done)( \
- dev->data->rx_queues[queue_id], offset);
-}
-
-#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
-#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
-#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_callback_unregister(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check the status of a Rx descriptor in the queue
- *
- * It should be called in a similar context than the Rx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * 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 packet arrives.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_enable() function enables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Rx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the next
- * packet to be received by the driver).
- *
+ * 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
- * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
- * receive a packet.
- * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
- * not yet processed by the driver (i.e. in the receive queue).
- * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
- * the driver and not yet returned to hw, or reserved by the hw.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-static inline int
-rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
- uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *rxq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_rx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
- rxq = dev->data->rx_queues[queue_id];
-
- return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
-}
-
-#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
-#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
-#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
/**
- * Check the status of a Tx descriptor in the queue.
- *
- * It should be called in a similar context than the Tx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * When lcore wakes up from rx interrupt indicating packet coming, disable rx
+ * interrupt and returns to polling mode.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_disable() function disables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Tx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the place where
- * the next packet will be send).
- *
+ * 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
- * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
- * in the transmit queue.
- * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
- * be reused by the driver.
- * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
- * driver or the hardware.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
- uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *txq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
- txq = dev->data->tx_queues[queue_id];
-
- return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
-}
+int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
/**
- * Send a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_burst() function is invoked to transmit output packets
- * on the output queue *queue_id* of the Ethernet device designated by its
- * *port_id*.
- * The *nb_pkts* parameter is the number of packets to send which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
- * up to the number of transmit descriptors available in the TX ring of the
- * transmit queue.
- * For each packet to send, the rte_eth_tx_burst() function performs
- * the following operations:
- *
- * - Pick up the next available descriptor in the transmit ring.
- *
- * - Free the network buffer previously sent with that descriptor, if any.
- *
- * - Initialize the transmit descriptor with the information provided
- * in the *rte_mbuf data structure.
- *
- * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
- * the rte_eth_tx_burst() function uses several transmit descriptors
- * of the ring.
- *
- * The rte_eth_tx_burst() function returns the number of packets it
- * actually sent. A return value equal to *nb_pkts* means that all packets
- * have been sent, and this is likely to signify that other output packets
- * could be immediately transmitted again. Applications that implement a
- * "send as many packets to transmit as possible" policy can check this
- * specific case and keep invoking the rte_eth_tx_burst() function until
- * a value less than *nb_pkts* is returned.
- *
- * It is the responsibility of the rte_eth_tx_burst() function to
- * transparently free the memory buffers of packets previously sent.
- * This feature is driven by the *tx_free_thresh* value supplied to the
- * rte_eth_dev_configure() function at device configuration time.
- * When the number of free TX descriptors drops below this threshold, the
- * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
- * of those packets whose transmission was effectively completed.
+ * RX Interrupt control per port.
*
- * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
- * invoke this function concurrently on the same tx queue without SW lock.
- * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
+ * @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(uint16_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 transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * 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 tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to transmit.
+ * @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
- * The number of output packets actually stored in transmit descriptors of
- * the transmit ring. The return value can be less than the value of the
- * *tx_pkts* parameter when the transmit ring is full or has been filled up.
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline uint16_t
-rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
-
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
-
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
-
- if (unlikely(cb != NULL)) {
- do {
- nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
- cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
-
- return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
-}
+int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
+ int epfd, int op, void *data);
/**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
- * Process a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
- * transmitted on the output queue *queue_id* of the Ethernet device designated
- * by its *port_id*.
- * The *nb_pkts* parameter is the number of packets to be prepared which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * For each packet to send, the rte_eth_tx_prepare() function performs
- * the following operations:
- *
- * - Check if packet meets devices requirements for tx offloads.
- *
- * - Check limitations about number of segments.
- *
- * - Check additional requirements when debug is enabled.
- *
- * - Update and/or reset required checksums when tx offload is set for packet.
- *
- * Since this function can modify packet data, provided mbufs must be safely
- * writable (e.g. modified data cannot be in shared segment).
- *
- * The rte_eth_tx_prepare() function returns the number of packets ready to be
- * sent. A return value equal to *nb_pkts* means that all packets are valid and
- * ready to be sent, otherwise stops processing on the first invalid packet and
- * leaves the rest packets untouched.
- *
- * When this functionality is not implemented in the driver, all packets are
- * are returned untouched.
+ * Turn on the LED on the Ethernet device.
+ * This function turns on the LED on the Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * The value must be a valid port id.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to process.
* @return
- * The number of packets correct and ready to be sent. The return value can be
- * less than the value of the *tx_pkts* parameter when some packet doesn't
- * meet devices requirements with rte_errno set appropriately:
- * - -EINVAL: offload flags are not correctly set
- * - -ENOTSUP: the offload feature is not supported by the hardware
- *
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
+int rte_eth_led_on(uint16_t port_id);
-#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
-
-static inline uint16_t
-rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (!rte_eth_dev_is_valid_port(port_id)) {
- RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- if (!dev->tx_pkt_prepare)
- return nb_pkts;
-
- return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
- tx_pkts, nb_pkts);
-}
-
-#else
-
-/*
- * Native NOOP operation for compilation targets which doesn't require any
- * preparations steps, and functional NOOP may introduce unnecessary performance
- * drop.
+/**
+ * Turn off the LED on the Ethernet device.
+ * This function turns off the LED on the Ethernet device.
*
- * Generally this is not a good idea to turn it on globally and didn't should
- * be used if behavior of tx_preparation can change.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-
-static inline uint16_t
-rte_eth_tx_prepare(__rte_unused uint16_t port_id,
- __rte_unused uint16_t queue_id,
- __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- return nb_pkts;
-}
-
-#endif
-
-typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
- void *userdata);
+int rte_eth_led_off(uint16_t port_id);
/**
- * Structure used to buffer packets for future TX
- * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ * Get current status of the Ethernet link flow control for Ethernet device
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure where to store the flow control parameters.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control.
+ * - (-ENODEV) if *port_id* invalid.
*/
-struct rte_eth_dev_tx_buffer {
- buffer_tx_error_fn error_callback;
- void *error_userdata;
- uint16_t size; /**< Size of buffer for buffered tx */
- uint16_t length; /**< Number of packets in the array */
- struct rte_mbuf *pkts[];
- /**< Pending packets to be sent on explicit flush or when full */
-};
+int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Calculate the size of the tx buffer.
+ * Configure the Ethernet link flow control for Ethernet device
*
- * @param sz
- * Number of stored packets.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure of the flow control parameters.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure
*/
-#define RTE_ETH_TX_BUFFER_SIZE(sz) \
- (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Initialize default values for buffered transmitting
+ * Configure the Ethernet priority flow control under DCB environment
+ * for Ethernet device.
*
- * @param buffer
- * Tx buffer to be initialized.
- * @param size
- * Buffer size
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param pfc_conf
+ * The pointer to the structure of the priority flow control parameters.
* @return
- * 0 if no error
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure
*/
-int
-rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_pfc_conf *pfc_conf);
/**
- * Send any packets queued up for transmission on a port and HW queue
- *
- * This causes an explicit flush of packets previously buffered via the
- * rte_eth_tx_buffer() function. It returns the number of packets successfully
- * sent to the NIC, and calls the error callback for any unsent packets. Unless
- * explicitly set up otherwise, the default callback simply frees the unsent
- * packets back to the owning mempool.
+ * Add a MAC address to an internal array of addresses used to enable whitelist
+ * filtering to accept packets only if the destination MAC address matches.
*
- * @param port_id
+ * @param port
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer of packets to be transmit.
+ * @param mac_addr
+ * The MAC address to add.
+ * @param pool
+ * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
+ * not enabled, this should be set to 0.
* @return
- * The number of packets successfully sent to the Ethernet device. The error
- * callback is called for any packets which could not be sent.
+ * - (0) if successfully added or *mac_addr" was already added.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port* is invalid.
+ * - (-ENOSPC) if no more MAC addresses can be added.
+ * - (-EINVAL) if MAC address is invalid.
*/
-static inline uint16_t
-rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer)
-{
- uint16_t sent;
- uint16_t to_send = buffer->length;
-
- if (to_send == 0)
- return 0;
-
- sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
-
- buffer->length = 0;
-
- /* All packets sent, or to be dealt with by callback below */
- if (unlikely(sent != to_send))
- buffer->error_callback(&buffer->pkts[sent], to_send - sent,
- buffer->error_userdata);
-
- return sent;
-}
+int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+ uint32_t pool);
/**
- * Buffer a single packet for future transmission on a port and queue
- *
- * This function takes a single mbuf/packet and buffers it for later
- * transmission on the particular port and queue specified. Once the buffer is
- * full of packets, an attempt will be made to transmit all the buffered
- * packets. In case of error, where not all packets can be transmitted, a
- * callback is called with the unsent packets as a parameter. If no callback
- * is explicitly set up, the unsent packets are just freed back to the owning
- * mempool. The function returns the number of packets actually sent i.e.
- * 0 if no buffer flush occurred, otherwise the number of packets successfully
- * flushed
+ * Remove a MAC address from the internal array of addresses.
*
- * @param port_id
+ * @param port
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer used to collect packets to be sent.
- * @param tx_pkt
- * Pointer to the packet mbuf to be sent.
+ * @param mac_addr
+ * MAC address to remove.
* @return
- * 0 = packet has been buffered for later transmission
- * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
- * causing N packets to be sent, and the error callback to be called for
- * the rest.
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-static __rte_always_inline uint16_t
-rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
-{
- buffer->pkts[buffer->length++] = tx_pkt;
- if (buffer->length < buffer->size)
- return 0;
-
- return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
-}
+int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
/**
- * Configure a callback for buffered packets which cannot be sent
- *
- * Register a specific callback to be called when an attempt is made to send
- * all packets buffered on an ethernet port, but not all packets can
- * successfully be sent. The callback registered here will be called only
- * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
- * The default callback configured for each queue by default just frees the
- * packets back to the calling mempool. If additional behaviour is required,
- * for example, to count dropped packets, or to retry transmission of packets
- * which cannot be sent, this function should be used to register a suitable
- * callback function to implement the desired behaviour.
- * The example callback "rte_eth_count_unsent_packet_callback()" is also
- * provided as reference.
+ * Set the default MAC address.
*
- * @param buffer
+ * @param port
* The port identifier of the Ethernet device.
- * @param callback
- * The function to be used as the callback.
- * @param userdata
- * Arbitrary parameter to be passed to the callback function
+ * @param mac_addr
+ * New default MAC address.
* @return
- * 0 on success, or -1 on error with rte_errno set appropriately
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EINVAL) if MAC address is invalid.
*/
-int
-rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
- buffer_tx_error_fn callback, void *userdata);
+int rte_eth_dev_default_mac_addr_set(uint16_t port,
+ struct ether_addr *mac_addr);
/**
- * Callback function for silently dropping unsent buffered packets.
+ * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets silently and is used by tx buffered
- * operations as default behavior.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to update.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_eth_dev_rss_reta_update(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+
+ /**
+ * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to query.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_eth_dev_rss_reta_query(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+
+ /**
+ * Updates unicast hash table for receiving packet with the given destination
+ * MAC address, and the packet is routed to all VFs for which the RX mode is
+ * accept packets that match the unicast hash table.
*
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param addr
+ * Unicast MAC address.
+ * @param on
+ * 1 - Set an unicast hash bit for receiving packets with the MAC address.
+ * 0 - Clear an unicast hash bit.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+ uint8_t on);
+
+ /**
+ * Updates all unicast hash bitmaps for receiving packet with any Unicast
+ * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
+ * mode is accept packets that match the unicast hash table.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Not used
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param on
+ * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
+ * MAC addresses
+ * 0 - Clear all unicast hash bitmaps
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-void
-rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
/**
- * Callback function for tracking unsent buffered packets.
- *
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets, but also updates a user-supplied counter
- * to track the overall number of packets dropped. The counter should be an
- * uint64_t variable.
- *
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
+ * Set a traffic mirroring rule on an Ethernet device
*
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param mirror_conf
+ * The pointer to the traffic mirroring structure describing the mirroring rule.
+ * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
+ * destination pool and the value of rule if enable vlan or pool mirroring.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Pointer to an uint64_t value, which will be incremented by unsent
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
+ * @param on
+ * 1 - Enable a mirroring rule.
+ * 0 - Disable a mirroring rule.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if the mr_conf information is not correct.
*/
-void
-rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_mirror_rule_set(uint16_t port_id,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
/**
- * Request the driver to free mbufs currently cached by the driver. The
- * driver will only free the mbuf if it is no longer in use. It is the
- * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
- * called if needed.
+ * Reset a traffic mirroring rule on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param free_cnt
- * Maximum number of packets to free. Use 0 to indicate all possible packets
- * should be freed. Note that a packet may be using multiple mbufs.
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
* @return
- * Failure: < 0
- * -ENODEV: Invalid interface
- * -ENOTSUP: Driver does not support function
- * Success: >= 0
- * 0-n: Number of packets freed. More packets may still remain in ring that
- * are in use.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int
-rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
+int rte_eth_mirror_rule_reset(uint16_t port_id,
+ uint8_t rule_id);
/**
- * The eth device event type for interrupt, and maybe others in the future.
- */
-enum rte_eth_event_type {
- RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
- RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
- RTE_ETH_EVENT_QUEUE_STATE,
- /**< queue state event (enabled/disabled) */
- RTE_ETH_EVENT_INTR_RESET,
- /**< reset interrupt event, sent to VF on PF reset */
- RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
- RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
- RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
- RTE_ETH_EVENT_MAX /**< max value of this enum */
-};
-
-typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
- enum rte_eth_event_type event, void *cb_arg, void *ret_param);
-/**< user application callback to be registered for interrupts */
-
-
-
-/**
- * Register a callback function for specific port id.
- *
- * @param port_id
- * Port id.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback.
- *
- * @return
- * - On success, zero.
- * - On failure, a negative value.
- */
-int rte_eth_dev_callback_register(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
-
-/**
- * Unregister a callback function for specific port id.
+ * Set the rate limitation for a queue on an Ethernet device.
*
* @param port_id
- * Port id.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback. -1 means to
- * remove all for the same callback address and same event.
- *
+ * The port identifier of the Ethernet device.
+ * @param queue_idx
+ * The queue id.
+ * @param tx_rate
+ * The tx rate in Mbps. Allocated from the total port link speed.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_unregister(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
+ uint16_t tx_rate);
-/**
- * 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 packet arrives.
- *
- * The rte_eth_dev_rx_intr_enable() function enables rx queue
- * interrupt on specific rx queue of a port.
+ /**
+ * Configuration of Receive Side Scaling hash computation of Ethernet device.
*
* @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 rss_conf
+ * The new configuration to use for RSS hash computation on the port.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
+int rte_eth_dev_rss_hash_update(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * 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.
+ /**
+ * Retrieve current configuration of Receive Side Scaling hash computation
+ * of Ethernet device.
*
* @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 rss_conf
+ * Where to store the current RSS hash configuration of the Ethernet device.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support RSS.
*/
-int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
+int
+rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * RX Interrupt control per port.
+ /**
+ * Add UDP tunneling port for a specific type of tunnel.
+ * The packets with this UDP port will be identified as this type of tunnel.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to change or add more UDP port for the tunnel. So the offloading function
+ * can take effect on the packets with the specific UDP 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.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
+int
+rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
-/**
- * RX Interrupt control per queue.
+ /**
+ * Delete UDP tunneling port a specific type of tunnel.
+ * The packets with this UDP port will not be identified as this type of tunnel
+ * any more.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to delete a UDP port for the tunnel. So the offloading function will not take
+ * effect on the packets with the specific UDP 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().
- * @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.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
- int epfd, int op, void *data);
+int
+rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
/**
- * Turn on the LED on the Ethernet device.
- * This function turns on the LED on the Ethernet device.
+ * Check whether the filter type is supported on an Ethernet device.
+ * All the supported filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support this filter type.
* - (-ENODEV) if *port_id* invalid.
*/
-int rte_eth_led_on(uint16_t port_id);
+int rte_eth_dev_filter_supported(uint16_t port_id,
+ enum rte_filter_type filter_type);
/**
- * Turn off the LED on the Ethernet device.
- * This function turns off the LED on the Ethernet device.
+ * Take operations to assigned filter type on an Ethernet device.
+ * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
+ * @param filter_op
+ * Type of operation.
+ * @param arg
+ * A pointer to arguments defined specifically for the operation.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_led_off(uint16_t port_id);
+int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op, void *arg);
/**
- * Get current status of the Ethernet link flow control for Ethernet device
+ * Get DCB information on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure where to store the flow control parameters.
+ * @param dcb_info
+ * dcb information.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support.
*/
-int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+int rte_eth_dev_get_dcb_info(uint16_t port_id,
+ struct rte_eth_dcb_info *dcb_info);
/**
- * Configure the Ethernet link flow control for Ethernet device
+ * Add a callback to be called on packet RX on a given port and queue.
+ *
+ * This API configures a function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure of the flow control parameters.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Configure the Ethernet priority flow control under DCB environment
- * for Ethernet device.
+ * Add a callback that must be called first on packet RX on a given port
+ * and queue.
+ *
+ * This API configures a first function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param pfc_conf
- * The pointer to the structure of the priority flow control parameters.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_pfc_conf *pfc_conf);
+void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Add a MAC address to an internal array of addresses used to enable whitelist
- * filtering to accept packets only if the destination MAC address matches.
+ * Add a callback to be called on packet TX on a given port and queue.
*
- * @param port
+ * This API configures a function to be called for each burst of
+ * packets sent on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_tx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * The MAC address to add.
- * @param pool
- * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
- * not enabled, this should be set to 0.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successfully added or *mac_addr" was already added.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port* is invalid.
- * - (-ENOSPC) if no more MAC addresses can be added.
- * - (-EINVAL) if MAC address is invalid.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
- uint32_t pool);
+void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_tx_callback_fn fn, void *user_param);
/**
- * Remove a MAC address from the internal array of addresses.
+ * Remove an RX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_rx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * MAC address to remove.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_rx_callback().
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EADDRINUSE) if attempting to remove the default MAC address
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Set the default MAC address.
+ * Remove a TX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_tx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * New default MAC address.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_tx_callback().
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EINVAL) if MAC address is invalid.
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
- struct ether_addr *mac_addr);
+int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+ * Retrieve information about given port's RX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to update.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - 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_dev_rss_reta_update(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
- /**
- * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+/**
+ * Retrieve information about given port's TX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to query.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - 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_dev_rss_reta_query(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
- /**
- * Updates unicast hash table for receiving packet with the given destination
- * MAC address, and the packet is routed to all VFs for which the RX mode is
- * accept packets that match the unicast hash table.
+/**
+ * Retrieve device registers and register attributes (number of registers and
+ * register size)
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param addr
- * Unicast MAC address.
- * @param on
- * 1 - Set an unicast hash bit for receiving packets with the MAC address.
- * 0 - Clear an unicast hash bit.
+ * @param info
+ * Pointer to rte_dev_reg_info structure to fill in. If info->data is
+ * NULL the function fills in the width and length fields. If non-NULL
+ * the registers are put into the buffer pointed at by the data field.
* @return
* - (0) if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
- uint8_t on);
+int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
- /**
- * Updates all unicast hash bitmaps for receiving packet with any Unicast
- * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
- * mode is accept packets that match the unicast hash table.
+/**
+ * Retrieve size of device EEPROM
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param on
- * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
- * MAC addresses
- * 0 - Clear all unicast hash bitmaps
* @return
- * - (0) if successful.
+ * - (>=0) EEPROM size if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_get_eeprom_length(uint16_t port_id);
/**
- * Set a traffic mirroring rule on an Ethernet device
+ * Retrieve EEPROM and EEPROM attribute
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param mirror_conf
- * The pointer to the traffic mirroring structure describing the mirroring rule.
- * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
- * destination pool and the value of rule if enable vlan or pool mirroring.
- *
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
- * @param on
- * 1 - Enable a mirroring rule.
- * 0 - Disable a mirroring rule.
+ * @param info
+ * The template includes buffer for return EEPROM data and
+ * EEPROM attributes to be filled.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if the mr_conf information is not correct.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_set(uint16_t port_id,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
+int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
- * Reset a traffic mirroring rule on an Ethernet device.
+ * Program EEPROM with provided data
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
+ * @param info
+ * The template includes EEPROM data for programming and
+ * EEPROM attributes to be filled
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_reset(uint16_t port_id,
- uint8_t rule_id);
+int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
- * Set the rate limitation for a queue on an Ethernet device.
+ * Set the list of multicast addresses to filter on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_idx
- * The queue id.
- * @param tx_rate
- * The tx rate in Mbps. Allocated from the total port link speed.
+ * @param mc_addr_set
+ * The array of multicast addresses to set. Equal to NULL when the function
+ * is invoked to flush the set of filtered addresses.
+ * @param nb_mc_addr
+ * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
+ * when the function is invoked to flush the set of filtered addresses.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
+ * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
*/
-int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
- uint16_t tx_rate);
+int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
- /**
- * Configuration of Receive Side Scaling hash computation of Ethernet device.
+/**
+ * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * The new configuration to use for RSS hash computation on the port.
- * @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
- */
-int rte_eth_dev_rss_hash_update(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
-
- /**
- * Retrieve current configuration of Receive Side Scaling hash computation
- * of Ethernet device.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param rss_conf
- * Where to store the current RSS hash configuration of the Ethernet device.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support RSS.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_timesync_enable(uint16_t port_id);
- /**
- * Add UDP tunneling port for a specific type of tunnel.
- * The packets with this UDP port will be identified as this type of tunnel.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to change or add more UDP port for the tunnel. So the offloading function
- * can take effect on the packets with the specific UDP port.
+/**
+ * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_disable(uint16_t port_id);
- /**
- * Delete UDP tunneling port a specific type of tunnel.
- * The packets with this UDP port will not be identified as this type of tunnel
- * any more.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to delete a UDP port for the tunnel. So the offloading function will not take
- * effect on the packets with the specific UDP port.
+/**
+ * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ * @param flags
+ * Device specific flags. Used to pass the RX timesync register index to
+ * i40e. Unused in igb/ixgbe, pass 0 instead.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
+ struct timespec *timestamp, uint32_t flags);
/**
- * Check whether the filter type is supported on an Ethernet device.
- * All the supported filter types are defined in 'rte_eth_ctrl.h'.
+ * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param filter_type
- * Filter type.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this filter type.
- * - (-ENODEV) if *port_id* invalid.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_supported(uint16_t port_id,
- enum rte_filter_type filter_type);
+int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
+ struct timespec *timestamp);
/**
- * Take operations to assigned filter type on an Ethernet device.
- * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
+ * 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 filter_type
- * Filter type.
- * @param filter_op
- * Type of operation.
- * @param arg
- * A pointer to arguments defined specifically for the operation.
+ * @param delta
+ * The adjustment in nanoseconds.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
- enum rte_filter_op filter_op, void *arg);
+int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
/**
- * Get DCB information on an Ethernet device.
+ * 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 dcb_info
- * dcb information.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support.
+ * - 0: Success.
*/
-int rte_eth_dev_get_dcb_info(uint16_t port_id,
- struct rte_eth_dcb_info *dcb_info);
+int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
/**
- * Add a callback to be called on packet RX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
+ * Set the time of the timesync clock on an Ethernet device.
*
- * Multiple functions are called in the order that they are added.
+ * 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 queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
/**
- * Add a callback that must be called first on packet RX on a given port
- * and queue.
- *
- * This API configures a first function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Config l2 tunnel ether type of an Ethernet device for filtering specific
+ * tunnel packets by ether type.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param l2_tunnel
+ * l2 tunnel configuration.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int
+rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel);
/**
- * Add a callback to be called on packet TX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets sent on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_tx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Enable/disable l2 tunnel offload functions. Include,
+ * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
+ * Filtering, forwarding and offloading this type of tunnel packets depend on
+ * this ability.
+ * 2, Stripping the l2 tunnel tag.
+ * 3, Insertion of the l2 tunnel tag.
+ * 4, Forwarding the packets based on the l2 tunnel tag.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param l2_tunnel
+ * l2 tunnel parameters.
+ * @param mask
+ * Indicate the offload function.
+ * @param en
+ * Enable or disable this function.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
- rte_tx_callback_fn fn, void *user_param);
+int
+rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
/**
- * Remove an RX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_rx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
+* Get the port id from pci address or device name
+* Ex: 0000:2:00.0 or vdev name net_pcap0
+*
+* @param name
+* pci address or name of the device
+* @param port_id
+* pointer to port identifier of the device
+* @return
+* - (0) if successful and port_id is filled.
+* - (-ENODEV or -EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
+
+/**
+* Get the device name from port id
+*
+* @param port_id
+* pointer to port identifier of the device
+* @param name
+* pci address or name of the device
+* @return
+* - (0) if successful.
+* - (-EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+
+/**
+ * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
+ * the ethernet device information, otherwise adjust them to boundaries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_rx_callback().
+ * @param nb_rx_desc
+ * A pointer to a uint16_t where the number of receive
+ * descriptors stored.
+ * @param nb_tx_desc
+ * A pointer to a uint16_t where the number of transmit
+ * descriptors stored.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
+ */
+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: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
+ * - 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_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int
+rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
+
+#include <rte_ethdev_core.h>
/**
- * Remove a TX packet callback from a given port and queue.
*
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_tx_callback().
+ * Retrieve a burst of input packets from a receive queue of an Ethernet
+ * device. The retrieved packets are stored in *rte_mbuf* structures whose
+ * pointers are supplied in the *rx_pkts* array.
*
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
+ * The rte_eth_rx_burst() function loops, parsing the RX ring of the
+ * receive queue, up to *nb_pkts* packets, and for each completed RX
+ * descriptor in the ring, it performs the following operations:
*
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
+ * - Initialize the *rte_mbuf* data structure associated with the
+ * RX descriptor according to the information provided by the NIC into
+ * that RX descriptor.
*
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
+ * - Store the *rte_mbuf* data structure into the next entry of the
+ * *rx_pkts* array.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_tx_callback().
+ * - Replenish the RX descriptor with a new *rte_mbuf* buffer
+ * allocated from the memory pool associated with the receive queue at
+ * initialization time.
*
- * @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
- */
-int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
-
-/**
- * Retrieve information about given port's RX queue.
+ * When retrieving an input packet that was scattered by the controller
+ * into multiple receive descriptors, the rte_eth_rx_burst() function
+ * appends the associated *rte_mbuf* buffers to the first buffer of the
+ * packet.
+ *
+ * The rte_eth_rx_burst() function returns the number of packets
+ * actually retrieved, which is the number of *rte_mbuf* data structures
+ * effectively supplied into the *rx_pkts* array.
+ * A return value equal to *nb_pkts* indicates that the RX queue contained
+ * at least *rx_pkts* packets, and this is likely to signify that other
+ * received packets remain in the input queue. Applications implementing
+ * a "retrieve as much received packets as possible" policy can check this
+ * specific case and keep invoking the rte_eth_rx_burst() function until
+ * a value less than *nb_pkts* is returned.
+ *
+ * This receive method has the following advantages:
+ *
+ * - It allows a run-to-completion network stack engine to retrieve and
+ * to immediately process received packets in a fast burst-oriented
+ * approach, avoiding the overhead of unnecessary intermediate packet
+ * queue/dequeue operations.
+ *
+ * - Conversely, it also allows an asynchronous-oriented processing
+ * method to retrieve bursts of received packets and to immediately
+ * queue them for further parallel processing by another logical core,
+ * for instance. However, instead of having received packets being
+ * individually queued by the driver, this approach allows the caller
+ * of the rte_eth_rx_burst() function to queue a burst of retrieved
+ * packets at a time and therefore dramatically reduce the cost of
+ * enqueue/dequeue operations per packet.
+ *
+ * - It allows the rte_eth_rx_burst() function of the driver to take
+ * advantage of burst-oriented hardware features (CPU cache,
+ * prefetch instructions, and so on) to minimize the number of CPU
+ * cycles per packet.
+ *
+ * To summarize, the proposed receive API enables many
+ * burst-oriented optimizations in both synchronous and asynchronous
+ * packet processing environments with no overhead in both cases.
+ *
+ * The rte_eth_rx_burst() function does not provide any error
+ * notification to avoid the corresponding overhead. As a hint, the
+ * upper-level application might check the status of the device link once
+ * being systematically returned a 0 value for a given number of tries.
*
* @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.
- *
+ * 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 rx_pkts
+ * The address of an array of pointers to *rte_mbuf* structures that
+ * must be large enough to store *nb_pkts* pointers in it.
+ * @param nb_pkts
+ * The maximum number of packets to retrieve.
* @return
- * - 0: Success
- * - -ENOTSUP: routine is not supported by the device PMD.
- * - -EINVAL: The port_id or the queue_id is out of range.
+ * The number of packets actually retrieved, which is the number
+ * of pointers to *rte_mbuf* structures effectively supplied to the
+ * *rx_pkts* array.
*/
-int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxq_info *qinfo);
+static inline uint16_t
+rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_rx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+ int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
+ rx_pkts, nb_pkts);
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
+ nb_pkts, cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return nb_rx;
+}
/**
- * Retrieve information about given port's TX queue.
+ * Get the number of used descriptors of a rx queue
*
* @param port_id
- * The port identifier of the Ethernet device.
+ * 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.
- *
+ * The queue id on the specific port.
* @return
- * - 0: Success
- * - -ENOTSUP: routine is not supported by the device PMD.
- * - -EINVAL: The port_id or the queue_id is out of range.
+ * The number of used descriptors in the specific queue, or:
+ * (-EINVAL) if *port_id* or *queue_id* is invalid
+ * (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_txq_info *qinfo);
+static inline int
+rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
+{
+ struct rte_eth_dev *dev;
-/**
- * Retrieve device registers and register attributes (number of registers and
- * register size)
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * Pointer to rte_dev_reg_info structure to fill in. If info->data is
- * NULL the function fills in the width and length fields. If non-NULL
- * the registers are put into the buffer pointed at by the data field.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
+ dev = &rte_eth_devices[port_id];
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -EINVAL;
-/**
- * Retrieve size of device EEPROM
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @return
- * - (>=0) EEPROM size if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_eeprom_length(uint16_t port_id);
+ return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
+}
/**
- * Retrieve EEPROM and EEPROM attribute
+ * Check if the DD bit of the specific RX descriptor in the queue has been set
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes buffer for return EEPROM data and
- * EEPROM attributes to be filled.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
+ * @param offset
+ * The offset of the descriptor ID from tail.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - (1) if the specific DD bit is set.
+ * - (0) if the specific DD bit is not set.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+static inline int
+rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
+ return (*dev->dev_ops->rx_descriptor_done)( \
+ dev->data->rx_queues[queue_id], offset);
+}
-/**
- * Program EEPROM with provided data
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes EEPROM data for programming and
- * EEPROM attributes to be filled
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
+#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
+#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * Set the list of multicast addresses to filter on an Ethernet device.
+ * Check the status of a Rx descriptor in the queue
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param mc_addr_set
- * The array of multicast addresses to set. Equal to NULL when the function
- * is invoked to flush the set of filtered addresses.
- * @param nb_mc_addr
- * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
- * when the function is invoked to flush the set of filtered addresses.
- * @return
- * - (0) if successful.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
- * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
- */
-int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-
-/**
- * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * It should be called in a similar context than the Rx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
*
- * @param port_id
- * The port identifier of the Ethernet device.
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_enable(uint16_t port_id);
-
-/**
- * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Rx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the next
+ * packet to be received by the driver).
*
* @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
+ * receive a packet.
+ * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
+ * not yet processed by the driver (i.e. in the receive queue).
+ * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
+ * the driver and not yet returned to hw, or reserved by the hw.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int rte_eth_timesync_disable(uint16_t port_id);
+static inline int
+rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
+ uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *rxq;
-/**
- * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
- * @param flags
- * Device specific flags. Used to pass the RX timesync register index to
- * i40e. Unused in igb/ixgbe, pass 0 instead.
- *
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
- struct timespec *timestamp, uint32_t flags);
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
+ rxq = dev->data->rx_queues[queue_id];
-/**
- * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
- *
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
- struct timespec *timestamp);
+ return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
+}
+
+#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
+#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
+#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * 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.
+ * Check the status of a Tx descriptor in the queue.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param delta
- * The adjustment in nanoseconds.
+ * It should be called in a similar context than the Tx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
-
-/**
- * Read the time from the timesync clock on an Ethernet device.
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Tx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the place where
+ * the next packet will be send).
*
* @return
- * - 0: Success.
+ * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
+ * in the transmit queue.
+ * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
+ * be reused by the driver.
+ * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
+ * driver or the hardware.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
+static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
+ uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *txq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
+ txq = dev->data->tx_queues[queue_id];
+
+ return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
+}
/**
- * Set the time of the timesync clock on an Ethernet device.
+ * Send a burst of output packets on a transmit queue of 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.
+ * The rte_eth_tx_burst() function is invoked to transmit output packets
+ * on the output queue *queue_id* of the Ethernet device designated by its
+ * *port_id*.
+ * The *nb_pkts* parameter is the number of packets to send which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
+ * up to the number of transmit descriptors available in the TX ring of the
+ * transmit queue.
+ * For each packet to send, the rte_eth_tx_burst() function performs
+ * the following operations:
+ *
+ * - Pick up the next available descriptor in the transmit ring.
+ *
+ * - Free the network buffer previously sent with that descriptor, if any.
+ *
+ * - Initialize the transmit descriptor with the information provided
+ * in the *rte_mbuf data structure.
+ *
+ * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
+ * the rte_eth_tx_burst() function uses several transmit descriptors
+ * of the ring.
+ *
+ * The rte_eth_tx_burst() function returns the number of packets it
+ * actually sent. A return value equal to *nb_pkts* means that all packets
+ * have been sent, and this is likely to signify that other output packets
+ * could be immediately transmitted again. Applications that implement a
+ * "send as many packets to transmit as possible" policy can check this
+ * specific case and keep invoking the rte_eth_tx_burst() function until
+ * a value less than *nb_pkts* is returned.
+ *
+ * It is the responsibility of the rte_eth_tx_burst() function to
+ * transparently free the memory buffers of packets previously sent.
+ * This feature is driven by the *tx_free_thresh* value supplied to the
+ * rte_eth_dev_configure() function at device configuration time.
+ * When the number of free TX descriptors drops below this threshold, the
+ * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
+ * of those packets whose transmission was effectively completed.
+ *
+ * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
+ * invoke this function concurrently on the same tx queue without SW lock.
+ * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
- *
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to transmit.
* @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * The number of output packets actually stored in transmit descriptors of
+ * the transmit ring. The return value can be less than the value of the
+ * *tx_pkts* parameter when the transmit ring is full or has been filled up.
*/
-int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
+static inline uint16_t
+rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
+ cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
+}
/**
- * Config l2 tunnel ether type of an Ethernet device for filtering specific
- * tunnel packets by ether type.
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Process a burst of output packets on a transmit queue of an Ethernet device.
+ *
+ * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
+ * transmitted on the output queue *queue_id* of the Ethernet device designated
+ * by its *port_id*.
+ * The *nb_pkts* parameter is the number of packets to be prepared which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * For each packet to send, the rte_eth_tx_prepare() function performs
+ * the following operations:
+ *
+ * - Check if packet meets devices requirements for tx offloads.
+ *
+ * - Check limitations about number of segments.
+ *
+ * - Check additional requirements when debug is enabled.
+ *
+ * - Update and/or reset required checksums when tx offload is set for packet.
+ *
+ * Since this function can modify packet data, provided mbufs must be safely
+ * writable (e.g. modified data cannot be in shared segment).
+ *
+ * The rte_eth_tx_prepare() function returns the number of packets ready to be
+ * sent. A return value equal to *nb_pkts* means that all packets are valid and
+ * ready to be sent, otherwise stops processing on the first invalid packet and
+ * leaves the rest packets untouched.
+ *
+ * When this functionality is not implemented in the driver, all packets are
+ * are returned untouched.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel configuration.
- *
+ * The value must be a valid port id.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to process.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * The number of packets correct and ready to be sent. The return value can be
+ * less than the value of the *tx_pkts* parameter when some packet doesn't
+ * meet devices requirements with rte_errno set appropriately:
+ * - -EINVAL: offload flags are not correctly set
+ * - -ENOTSUP: the offload feature is not supported by the hardware
+ *
*/
-int
-rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel);
-/**
- * Enable/disable l2 tunnel offload functions. Include,
- * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
- * Filtering, forwarding and offloading this type of tunnel packets depend on
- * this ability.
- * 2, Stripping the l2 tunnel tag.
- * 3, Insertion of the l2 tunnel tag.
- * 4, Forwarding the packets based on the l2 tunnel tag.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel parameters.
- * @param mask
- * Indicate the offload function.
- * @param en
- * Enable or disable this function.
+#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
+
+static inline uint16_t
+rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ if (!dev->tx_pkt_prepare)
+ return nb_pkts;
+
+ return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
+ tx_pkts, nb_pkts);
+}
+
+#else
+
+/*
+ * Native NOOP operation for compilation targets which doesn't require any
+ * preparations steps, and functional NOOP may introduce unnecessary performance
+ * drop.
*
- * @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * Generally this is not a good idea to turn it on globally and didn't should
+ * be used if behavior of tx_preparation can change.
*/
-int
-rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**
-* Get the port id from pci address or device name
-* Ex: 0000:2:00.0 or vdev name net_pcap0
-*
-* @param name
-* pci address or name of the device
-* @param port_id
-* pointer to port identifier of the device
-* @return
-* - (0) if successful and port_id is filled.
-* - (-ENODEV or -EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
+static inline uint16_t
+rte_eth_tx_prepare(__rte_unused uint16_t port_id,
+ __rte_unused uint16_t queue_id,
+ __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ return nb_pkts;
+}
-/**
-* Get the device name from port id
-*
-* @param port_id
-* pointer to port identifier of the device
-* @param name
-* pci address or name of the device
-* @return
-* - (0) if successful.
-* - (-EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+#endif
/**
- * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
- * the ethernet device information, otherwise adjust them to boundaries.
+ * Send any packets queued up for transmission on a port and HW queue
+ *
+ * This causes an explicit flush of packets previously buffered via the
+ * rte_eth_tx_buffer() function. It returns the number of packets successfully
+ * sent to the NIC, and calls the error callback for any unsent packets. Unless
+ * explicitly set up otherwise, the default callback simply frees the unsent
+ * packets back to the owning mempool.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param nb_rx_desc
- * A pointer to a uint16_t where the number of receive
- * descriptors stored.
- * @param nb_tx_desc
- * A pointer to a uint16_t where the number of transmit
- * descriptors stored.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer of packets to be transmit.
* @return
- * - (0) if successful.
- * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
+ * The number of packets successfully sent to the Ethernet device. The error
+ * callback is called for any packets which could not be sent.
*/
-int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
- uint16_t *nb_rx_desc,
- uint16_t *nb_tx_desc);
+static inline uint16_t
+rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer)
+{
+ uint16_t sent;
+ uint16_t to_send = buffer->length;
+
+ if (to_send == 0)
+ return 0;
+
+ sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
+
+ buffer->length = 0;
+ /* All packets sent, or to be dealt with by callback below */
+ if (unlikely(sent != to_send))
+ buffer->error_callback(&buffer->pkts[sent], to_send - sent,
+ buffer->error_userdata);
+
+ return sent;
+}
/**
- * Test if a port supports specific mempool ops.
+ * Buffer a single packet for future transmission on a port and queue
+ *
+ * This function takes a single mbuf/packet and buffers it for later
+ * transmission on the particular port and queue specified. Once the buffer is
+ * full of packets, an attempt will be made to transmit all the buffered
+ * packets. In case of error, where not all packets can be transmitted, a
+ * callback is called with the unsent packets as a parameter. If no callback
+ * is explicitly set up, the unsent packets are just freed back to the owning
+ * mempool. The function returns the number of packets actually sent i.e.
+ * 0 if no buffer flush occurred, otherwise the number of packets successfully
+ * flushed
*
* @param port_id
- * Port identifier of the Ethernet device.
- * @param [in] pool
- * The name of the pool operations to test.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer used to collect packets to be sent.
+ * @param tx_pkt
+ * Pointer to the packet mbuf to be sent.
* @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.
+ * 0 = packet has been buffered for later transmission
+ * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
+ * causing N packets to be sent, and the error callback to be called for
+ * the rest.
*/
-int
-rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
+static __rte_always_inline uint16_t
+rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
+{
+ buffer->pkts[buffer->length++] = tx_pkt;
+ if (buffer->length < buffer->size)
+ return 0;
+
+ return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
+}
#ifdef __cplusplus
}
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH 6/7] ethdev: rename function parameter for consistency
2017-12-01 2:29 [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
` (3 preceding siblings ...)
2017-12-01 2:29 ` [dpdk-dev] [PATCH 5/7] ethdev: reorder inline functions Ferruh Yigit
@ 2017-12-01 2:29 ` Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object Ferruh Yigit
` (2 subsequent siblings)
7 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 2:29 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
Update "port" function argument variable to "port_id" in public
header to be consistent in all APIs.
No functional change.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index ce3b13107..12b85a263 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1172,7 +1172,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* The callback function is called on RX with a burst of packets that have
* been received on the given port and queue.
*
- * @param port
+ * @param port_id
* The Ethernet port on which RX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to receive the packets.
@@ -1188,7 +1188,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* @return
* The number of packets returned to the user.
*/
-typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
void *user_param);
@@ -1198,7 +1198,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* The callback function is called on TX with a burst of packets immediately
* before the packets are put onto the hardware queue for transmission.
*
- * @param port
+ * @param port_id
* The Ethernet port on which TX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to transmit the packets.
@@ -1212,7 +1212,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* @return
* The number of packets to be written to the NIC.
*/
-typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
struct rte_eth_rxtx_callback;
@@ -2534,7 +2534,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* Add a MAC address to an internal array of addresses used to enable whitelist
* filtering to accept packets only if the destination MAC address matches.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* The MAC address to add.
@@ -2542,19 +2542,19 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
* not enabled, this should be set to 0.
* @return
- * - (0) if successfully added or *mac_addr" was already added.
+ * - (0) if successfully added or *mac_addr* was already added.
* - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port* is invalid.
* - (-ENOSPC) if no more MAC addresses can be added.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr,
uint32_t pool);
/**
* Remove a MAC address from the internal array of addresses.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* MAC address to remove.
@@ -2564,12 +2564,12 @@ int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
* - (-ENODEV) if *port* invalid.
* - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr);
/**
* Set the default MAC address.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* New default MAC address.
@@ -2579,13 +2579,13 @@ int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
+int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
struct ether_addr *mac_addr);
/**
* Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to update.
@@ -2597,14 +2597,14 @@ int rte_eth_dev_default_mac_addr_set(uint16_t port,
* - (-ENOTSUP) if hardware doesn't support.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rss_reta_update(uint16_t port,
+int rte_eth_dev_rss_reta_update(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
/**
* Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to query.
@@ -2616,7 +2616,7 @@ int rte_eth_dev_rss_reta_update(uint16_t port,
* - (-ENOTSUP) if hardware doesn't support.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rss_reta_query(uint16_t port,
+int rte_eth_dev_rss_reta_query(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
@@ -2625,7 +2625,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* MAC address, and the packet is routed to all VFs for which the RX mode is
* accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param addr
* Unicast MAC address.
@@ -2638,7 +2638,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr,
uint8_t on);
/**
@@ -2646,7 +2646,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* Ethernet MAC addresses,the packet is routed to all VFs for which the RX
* mode is accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param on
* 1 - Set all unicast hash bitmaps for receiving all the Ethernet
@@ -2658,7 +2658,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on);
/**
* Set a traffic mirroring rule on an Ethernet device
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
2017-12-01 2:29 [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
` (4 preceding siblings ...)
2017-12-01 2:29 ` [dpdk-dev] [PATCH 6/7] ethdev: rename function parameter for consistency Ferruh Yigit
@ 2017-12-01 2:29 ` Ferruh Yigit
2017-12-01 10:33 ` Bruce Richardson
[not found] ` <49eb13f1-e12f-071a-b58b-1cd4852b7c8b@scylladb.com>
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
7 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 2:29 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
"struct rte_eth_rxtx_callback" is defined as internal data structure but
used in public APIs.
Checking the API documentation shows that intention was using this
object as opaque object. Data structure only used in delete APIs which
doesn't require to know the internals of the data structure.
Converting callback parameter in API to void pointer should not require
any modification in user application because this data structure was
already marked as internal and only should be used as pointer in
application.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.c | 10 ++++++----
lib/librte_ether/rte_ethdev.h | 10 ++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 5558db7c4..fca4895a5 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3206,12 +3206,13 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
}
int
-rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb)
+rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, void *_user_cb)
{
#ifndef RTE_ETHDEV_RXTX_CALLBACKS
return -ENOTSUP;
#endif
+ struct rte_eth_rxtx_callback *user_cb = _user_cb;
+
/* Check input parameters. */
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
if (user_cb == NULL ||
@@ -3240,12 +3241,13 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
}
int
-rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb)
+rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, void *_user_cb)
{
#ifndef RTE_ETHDEV_RXTX_CALLBACKS
return -ENOTSUP;
#endif
+ struct rte_eth_rxtx_callback *user_cb = _user_cb;
+
/* Check input parameters. */
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
if (user_cb == NULL ||
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 12b85a263..b94abef5f 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1215,8 +1215,6 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
-struct rte_eth_rxtx_callback;
-
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -2960,8 +2958,8 @@ void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
* - -EINVAL: The port_id or the queue_id is out of range, or the callback
* is NULL or not found for the port/queue.
*/
-int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int
+rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, void *user_cb);
/**
* Remove a TX packet callback from a given port and queue.
@@ -2993,8 +2991,8 @@ int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
* - -EINVAL: The port_id or the queue_id is out of range, or the callback
* is NULL or not found for the port/queue.
*/
-int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int
+rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, void *user_cb);
/**
* Retrieve information about given port's RX queue.
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 4/7] ethdev: separate internal structures into own header
2017-12-01 2:29 ` [dpdk-dev] [PATCH 4/7] ethdev: separate internal structures into own header Ferruh Yigit
@ 2017-12-01 5:44 ` Hemant Agrawal
0 siblings, 0 replies; 76+ messages in thread
From: Hemant Agrawal @ 2017-12-01 5:44 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
Hi Ferruh,
This patch is not getting applied without PATCH 3/7, which is missing.
I could not locate that in Patchwork also.
Regards,
Hemant
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs
2017-12-01 2:29 ` [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs Ferruh Yigit
@ 2017-12-01 6:24 ` Shreyansh Jain
2017-12-01 8:59 ` Hemant Agrawal
1 sibling, 0 replies; 76+ messages in thread
From: Shreyansh Jain @ 2017-12-01 6:24 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
Hello Ferruh,
(Somehow it seems that patch was not delivered to dev@dpdk ML).
One comment below:
<Snip>
[]
>
> There is no update in header content and since ethdev.h included by
> ethdev_driver.h, nothing changed from driver point of view, only
> logically grouping of APIs. From applications point of view they can't
> access to driver specific APIs anymore and they shouldn't.
>
> More PMD specific data structures still remain in ethdev.h because of
> inline functions in header use them. Those will be handled separately.
+1
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
[...]
> diff --git a/drivers/bus/dpaa/include/fman.h
> b/drivers/bus/dpaa/include/fman.h
> index 9890e09ce..fec154545 100644
> --- a/drivers/bus/dpaa/include/fman.h
> +++ b/drivers/bus/dpaa/include/fman.h
> @@ -44,7 +44,7 @@
> #include <stdbool.h>
> #include <net/if.h>
>
> -#include <rte_ethdev.h>
> +#include <rte_ethdev_driver.h>
> #include <rte_ether.h>
>
> #include <compat.h>
> diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
> index 480857e57..8f4993f3a 100644
> --- a/drivers/bus/fslmc/fslmc_bus.c
> +++ b/drivers/bus/fslmc/fslmc_bus.c
> @@ -40,7 +40,7 @@
> #include <rte_malloc.h>
> #include <rte_devargs.h>
> #include <rte_memcpy.h>
> -#include <rte_ethdev.h>
> +#include <rte_ethdev_driver.h>
>
> #include <rte_fslmc.h>
> #include <fslmc_vfio.h>
> diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
> index 7831201ad..eec5cdd94 100644
> --- a/drivers/bus/fslmc/fslmc_vfio.c
> +++ b/drivers/bus/fslmc/fslmc_vfio.c
> @@ -48,7 +48,7 @@
>
> #include <eal_filesystem.h>
> #include <rte_mbuf.h>
> -#include <rte_ethdev.h>
> +#include <rte_ethdev_driver.h>
> #include <rte_malloc.h>
> #include <rte_memcpy.h>
> #include <rte_string_fns.h>
> diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
> b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
> index 334e1f5ad..55c38fd8d 100644
> --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
> +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
> @@ -45,7 +45,7 @@
> #include <rte_cycles.h>
> #include <rte_kvargs.h>
> #include <rte_dev.h>
> -#include <rte_ethdev.h>
> +#include <rte_ethdev_driver.h>
>
> #include <fslmc_logs.h>
> #include <rte_fslmc.h>
> diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
> b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
> index ae189c72a..7a86d047a 100644
> --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
> +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
> @@ -44,7 +44,7 @@
> #include <rte_cycles.h>
> #include <rte_kvargs.h>
> #include <rte_dev.h>
> -#include <rte_ethdev.h>
> +#include <rte_ethdev_driver.h>
>
> #include <fslmc_logs.h>
> #include <rte_fslmc.h>
> diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
> b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
> index f00070f3f..6a6c8c3b6 100644
> --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
> +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
> @@ -50,7 +50,7 @@
> #include<sys/eventfd.h>
>
> #include <rte_mbuf.h>
> -#include <rte_ethdev.h>
> +#include <rte_ethdev_driver.h>
> #include <rte_malloc.h>
> #include <rte_memcpy.h>
> #include <rte_string_fns.h>
> diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c
> b/drivers/event/dpaa2/dpaa2_eventdev.c
> index eeeb23127..a20a556d4 100644
> --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> @@ -52,7 +52,7 @@
> #include <rte_memory.h>
> #include <rte_pci.h>
> #include <rte_bus_vdev.h>
> -#include <rte_ethdev.h>
> +#include <rte_ethdev_driver.h>
> #include <rte_event_eth_rx_adapter.h>
>
> #include <fslmc_vfio.h>
> diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
> b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
> index 005e6234d..a8da9803b 100644
> --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
> +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
> @@ -44,7 +44,7 @@
> #include <rte_cycles.h>
> #include <rte_kvargs.h>
> #include <rte_dev.h>
> -#include <rte_ethdev.h>
> +#include <rte_ethdev_driver.h>
>
> #include <rte_fslmc.h>
> #include <mc/fsl_dpcon.h>
With respect to DPAA and DPAA2 and overall aim of patch:
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
[...]
> diff --git a/lib/librte_ether/rte_ethdev_driver.h
> b/lib/librte_ether/rte_ethdev_driver.h
> new file mode 100644
> index 000000000..3e77d1439
> --- /dev/null
> +++ b/lib/librte_ether/rte_ethdev_driver.h
> @@ -0,0 +1,163 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2017 Intel Corporation. All rights reserved.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in
> + * the documentation and/or other materials provided with the
> + * distribution.
> + * * Neither the name of Intel Corporation nor the names of its
> + * contributors may be used to endorse or promote products derived
> + * from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#ifndef _RTE_ETHDEV_DRIVER_H_
> +#define _RTE_ETHDEV_DRIVER_H_
Now that it is almost agreed to move towards SPDX based licensing text [1][2], and this new file is being introduced - do you think it makes sense to do it for this file?
[1] http://dpdk.org/ml/archives/dev/2017-November/082382.html
[2] http://dpdk.org/ml/archives/dev/2017-November/082639.html
[...]
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs
2017-12-01 2:29 ` [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs Ferruh Yigit
2017-12-01 6:24 ` Shreyansh Jain
@ 2017-12-01 8:59 ` Hemant Agrawal
2017-12-01 23:51 ` Ferruh Yigit
1 sibling, 1 reply; 76+ messages in thread
From: Hemant Agrawal @ 2017-12-01 8:59 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon, Shreyansh Jain, Nipun Gupta,
Jerin Jacob, Santosh Shukla, John W. Linville, Shepard Siegel,
Ed Czeck, John Miller, Allain Legacy, Matt Peters, Harish Patil,
Rasesh Mody, Stephen Hurd, Ajit Khaparde, Declan Doherty,
Rahul Lakkireddy, Wenzhuo Lu, Marcin Wojtas
Cc: dev, vladz
On 12/1/2017 7:59 AM, Ferruh Yigit wrote:
<snip>...
> diff --git a/lib/librte_ether/rte_ethdev_driver.h b/lib/librte_ether/rte_ethdev_driver.h
> new file mode 100644
> index 000000000..3e77d1439
> --- /dev/null
> +++ b/lib/librte_ether/rte_ethdev_driver.h
> @@ -0,0 +1,163 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2017 Intel Corporation. All rights reserved.
> + * All rights reserved.
You can remove one of the all rights reserved.
This is also an issue in your next patch for rte_ethdev_core.h
Also, as Shreyansh mentioned, Why not start with SPDX tags instead of
full license text?
<snip>...
> +/**
> + * @internal Executes all the user application registered callbacks for
> + * the specific device. It is for DPDK internal user only. User
> + * application should not call it directly.
> + *
> + * @param dev
> + * Pointer to struct rte_eth_dev.
> + * @param event
> + * Eth device interrupt event type.
> + * @param cb_arg
> + * callback parameter.
> + * @param ret_param
> + * To pass data back to user application.
> + * This allows the user application to decide if a particular function
> + * is permitted or not.
> + *
> + * @return
> + * int
> + */
> +int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
> + enum rte_eth_event_type event, void *cb_arg, void *ret_param);
> +
> +/**
> + * Create memzone for HW rings.
Like all other functions, you can also add "@internal" for this as well.
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage
2017-12-01 2:29 ` [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage Ferruh Yigit
@ 2017-12-01 9:01 ` Hemant Agrawal
2017-12-01 23:52 ` Ferruh Yigit
1 sibling, 0 replies; 76+ messages in thread
From: Hemant Agrawal @ 2017-12-01 9:01 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon
Cc: dev, vladz, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
On 12/1/2017 7:59 AM, Ferruh Yigit wrote:
> port_id is now 16bits, update function parameter according.
>
> Fixes: 4c270218aa26 ("ethdev: support security APIs")
> Cc: stable@dpdk.org
> Cc: declan.doherty@intel.com
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: Boris Pismenny <borisp@mellanox.com>
> Cc: Aviad Yehezkel <aviadye@mellanox.com>
> Cc: Radu Nicolau <radu.nicolau@intel.com>
> Cc: Declan Doherty <declan.doherty@intel.com>
> ---
> lib/librte_ether/rte_ethdev.c | 2 +-
> lib/librte_ether/rte_ethdev.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 318af2869..eed3d3005 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -301,7 +301,7 @@ rte_eth_dev_socket_id(uint16_t port_id)
> }
>
> void *
> -rte_eth_dev_get_sec_ctx(uint8_t port_id)
> +rte_eth_dev_get_sec_ctx(uint16_t port_id)
> {
> RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL);
> return rte_eth_devices[port_id].security_ctx;
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index e620c3706..59189096e 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -1745,7 +1745,7 @@ struct rte_eth_dev {
> } __rte_cache_aligned;
>
> void *
> -rte_eth_dev_get_sec_ctx(uint8_t port_id);
> +rte_eth_dev_get_sec_ctx(uint16_t port_id);
>
> struct rte_eth_dev_sriov {
> uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
2017-12-01 2:29 ` [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object Ferruh Yigit
@ 2017-12-01 10:33 ` Bruce Richardson
2017-12-01 11:22 ` Ananyev, Konstantin
0 siblings, 1 reply; 76+ messages in thread
From: Bruce Richardson @ 2017-12-01 10:33 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Thomas Monjalon, dev, vladz
On Fri, Dec 01, 2017 at 02:29:57AM +0000, Ferruh Yigit wrote:
> "struct rte_eth_rxtx_callback" is defined as internal data structure but
> used in public APIs.
>
> Checking the API documentation shows that intention was using this
> object as opaque object. Data structure only used in delete APIs which
> doesn't require to know the internals of the data structure.
>
> Converting callback parameter in API to void pointer should not require
> any modification in user application because this data structure was
> already marked as internal and only should be used as pointer in
> application.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
I disagree on this patch. The structure itself is not exposed, only the
name, since it is only passed around as a pointer, so there is no need
to change the parameters to void pointer. It's a named opaque type.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
2017-12-01 10:33 ` Bruce Richardson
@ 2017-12-01 11:22 ` Ananyev, Konstantin
2017-12-01 13:17 ` Bruce Richardson
0 siblings, 1 reply; 76+ messages in thread
From: Ananyev, Konstantin @ 2017-12-01 11:22 UTC (permalink / raw)
To: Richardson, Bruce, Yigit, Ferruh; +Cc: Thomas Monjalon, dev, vladz
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, December 1, 2017 10:33 AM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org; vladz@cloudius-systems.com
> Subject: Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
>
> On Fri, Dec 01, 2017 at 02:29:57AM +0000, Ferruh Yigit wrote:
> > "struct rte_eth_rxtx_callback" is defined as internal data structure but
> > used in public APIs.
> >
> > Checking the API documentation shows that intention was using this
> > object as opaque object. Data structure only used in delete APIs which
> > doesn't require to know the internals of the data structure.
> >
> > Converting callback parameter in API to void pointer should not require
> > any modification in user application because this data structure was
> > already marked as internal and only should be used as pointer in
> > application.
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
>
> I disagree on this patch. The structure itself is not exposed, only the
> name, since it is only passed around as a pointer, so there is no need
> to change the parameters to void pointer. It's a named opaque type.
Personally I think it would be better to do visa-versa:
make rte_eth_add_(rx|tx)_callback() to return struct rte_eth_rxtx_callback *
instead of void *.
Konstantin
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
2017-12-01 11:22 ` Ananyev, Konstantin
@ 2017-12-01 13:17 ` Bruce Richardson
2017-12-01 23:51 ` Ferruh Yigit
0 siblings, 1 reply; 76+ messages in thread
From: Bruce Richardson @ 2017-12-01 13:17 UTC (permalink / raw)
To: Ananyev, Konstantin; +Cc: Yigit, Ferruh, Thomas Monjalon, dev, vladz
On Fri, Dec 01, 2017 at 11:22:12AM +0000, Ananyev, Konstantin wrote:
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> > Sent: Friday, December 1, 2017 10:33 AM
> > To: Yigit, Ferruh <ferruh.yigit@intel.com>
> > Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org; vladz@cloudius-systems.com
> > Subject: Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
> >
> > On Fri, Dec 01, 2017 at 02:29:57AM +0000, Ferruh Yigit wrote:
> > > "struct rte_eth_rxtx_callback" is defined as internal data structure but
> > > used in public APIs.
> > >
> > > Checking the API documentation shows that intention was using this
> > > object as opaque object. Data structure only used in delete APIs which
> > > doesn't require to know the internals of the data structure.
> > >
> > > Converting callback parameter in API to void pointer should not require
> > > any modification in user application because this data structure was
> > > already marked as internal and only should be used as pointer in
> > > application.
> > >
> > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > ---
> >
> > I disagree on this patch. The structure itself is not exposed, only the
> > name, since it is only passed around as a pointer, so there is no need
> > to change the parameters to void pointer. It's a named opaque type.
>
> Personally I think it would be better to do visa-versa:
> make rte_eth_add_(rx|tx)_callback() to return struct rte_eth_rxtx_callback *
> instead of void *.
> Konstantin
>
I didn't realise that it did, so definite +1 to that suggestion.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header
[not found] ` <49eb13f1-e12f-071a-b58b-1cd4852b7c8b@scylladb.com>
@ 2017-12-01 22:30 ` Vlad Zolotarov
2017-12-01 23:51 ` Ferruh Yigit
1 sibling, 0 replies; 76+ messages in thread
From: Vlad Zolotarov @ 2017-12-01 22:30 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
resending after registering with the new email domain ;)
Please, see my comments below.
On 12/01/2017 05:17 PM, Vlad Zolotarov wrote:
>
>
> On 11/30/2017 09:29 PM, Ferruh Yigit wrote:
>> remove RTE_ETHDEV_HAS_LRO_SUPPORT flag from header.
>>
>> Flag seems added with the patch that adds LRO support, and intention
>> looks like giving a pointer to application that library supports LRO.
>
> Exactly. Removing this flag may make the existing application "think"
> that LRO is not supported.
> Why do you want to remove it to begin with?
>
>> Fixes: 8eecb3295aed ("ixgbe: add LRO support")
>> Cc:vladz@cloudius-systems.com
>>
>> Signed-off-by: Ferruh Yigit<ferruh.yigit@intel.com>
>> ---
>> lib/librte_ether/rte_ethdev.h | 3 ---
>> 1 file changed, 3 deletions(-)
>>
>> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
>> index 341c2d624..e620c3706 100644
>> --- a/lib/librte_ether/rte_ethdev.h
>> +++ b/lib/librte_ether/rte_ethdev.h
>> @@ -172,9 +172,6 @@ extern "C" {
>>
>> #include <stdint.h>
>>
>> -/* Use this macro to check if LRO API is supported */
>> -#define RTE_ETHDEV_HAS_LRO_SUPPORT
>> -
>> #include <rte_log.h>
>> #include <rte_interrupts.h>
>> #include <rte_dev.h>
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header
[not found] ` <49eb13f1-e12f-071a-b58b-1cd4852b7c8b@scylladb.com>
2017-12-01 22:30 ` [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Vlad Zolotarov
@ 2017-12-01 23:51 ` Ferruh Yigit
2017-12-02 2:22 ` Vlad Zolotarov
1 sibling, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 23:51 UTC (permalink / raw)
To: Vlad Zolotarov, Thomas Monjalon; +Cc: dev, vladz
On 12/1/2017 2:17 PM, Vlad Zolotarov wrote:
>
>
> On 11/30/2017 09:29 PM, Ferruh Yigit wrote:
>> remove RTE_ETHDEV_HAS_LRO_SUPPORT flag from header.
>>
>> Flag seems added with the patch that adds LRO support, and intention
>> looks like giving a pointer to application that library supports LRO.
>
> Exactly. Removing this flag may make the existing application "think" that LRO
> is not supported.
> Why do you want to remove it to begin with?
I agree that this is a little controversial, and I don't have a strong opinion
about it, I thought twice before sending or not sending the patch :)
This flag can be useful for the applications that use different versions of the
DPDK library (with the ones does and doesn't support LRO), so that application
can be more portable.
I would understand a dynamic approach, which would be useful for distributed
applications that you don't know and can't control what version of the DPDK
library used.
But here to benefit from this flag you need to compile your application against
DPDK library, and if you are compiling it you already know if your DPDK supports
LRO or not. And this is not something keeps changing platform to platform etc,
after a specific release LRO is always supported.
And this is the only capability support flag in the ethdev, there are many new
features introduced in each release but they are not advertised by a capability
flag. Only having LRO flag can be confusing.
_Perhaps_ DPDK should have a way to expose the supported features, and a dynamic
runtime way can be better option than compile time macros, but it should be
generic nothing specific to LRO support.
>
>>
>> Fixes: 8eecb3295aed ("ixgbe: add LRO support")
>> Cc: vladz@cloudius-systems.com
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> lib/librte_ether/rte_ethdev.h | 3 ---
>> 1 file changed, 3 deletions(-)
>>
>> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
>> index 341c2d624..e620c3706 100644
>> --- a/lib/librte_ether/rte_ethdev.h
>> +++ b/lib/librte_ether/rte_ethdev.h
>> @@ -172,9 +172,6 @@ extern "C" {
>>
>> #include <stdint.h>
>>
>> -/* Use this macro to check if LRO API is supported */
>> -#define RTE_ETHDEV_HAS_LRO_SUPPORT
>> -
>> #include <rte_log.h>
>> #include <rte_interrupts.h>
>> #include <rte_dev.h>
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs
2017-12-01 8:59 ` Hemant Agrawal
@ 2017-12-01 23:51 ` Ferruh Yigit
0 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 23:51 UTC (permalink / raw)
To: Hemant Agrawal, Thomas Monjalon, Shreyansh Jain, Nipun Gupta,
Jerin Jacob, Santosh Shukla, John W. Linville, Shepard Siegel,
Ed Czeck, John Miller, Allain Legacy, Matt Peters, Harish Patil,
Rasesh Mody, Stephen Hurd, Ajit Khaparde, Declan Doherty,
Rahul Lakkireddy, Wenzhuo Lu, Marcin Wojtas
Cc: dev, vladz
On 12/1/2017 12:59 AM, Hemant Agrawal wrote:
> On 12/1/2017 7:59 AM, Ferruh Yigit wrote:
>
> <snip>...
>> diff --git a/lib/librte_ether/rte_ethdev_driver.h b/lib/librte_ether/rte_ethdev_driver.h
>> new file mode 100644
>> index 000000000..3e77d1439
>> --- /dev/null
>> +++ b/lib/librte_ether/rte_ethdev_driver.h
>> @@ -0,0 +1,163 @@
>> +/*-
>> + * BSD LICENSE
>> + *
>> + * Copyright(c) 2017 Intel Corporation. All rights reserved.
>> + * All rights reserved.
>
> You can remove one of the all rights reserved.
> This is also an issue in your next patch for rte_ethdev_core.h
>
> Also, as Shreyansh mentioned, Why not start with SPDX tags instead of
> full license text?
Good idea, I will update in next version.
>
> <snip>...
>> +/**
>> + * @internal Executes all the user application registered callbacks for
>> + * the specific device. It is for DPDK internal user only. User
>> + * application should not call it directly.
>> + *
>> + * @param dev
>> + * Pointer to struct rte_eth_dev.
>> + * @param event
>> + * Eth device interrupt event type.
>> + * @param cb_arg
>> + * callback parameter.
>> + * @param ret_param
>> + * To pass data back to user application.
>> + * This allows the user application to decide if a particular function
>> + * is permitted or not.
>> + *
>> + * @return
>> + * int
>> + */
>> +int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
>> + enum rte_eth_event_type event, void *cb_arg, void *ret_param);
>> +
>> +/**
>> + * Create memzone for HW rings.
>
> Like all other functions, you can also add "@internal" for this as well.
OK.
>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
2017-12-01 13:17 ` Bruce Richardson
@ 2017-12-01 23:51 ` Ferruh Yigit
2017-12-04 10:31 ` Bruce Richardson
0 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 23:51 UTC (permalink / raw)
To: Bruce Richardson, Ananyev, Konstantin; +Cc: Thomas Monjalon, dev, vladz
On 12/1/2017 5:17 AM, Bruce Richardson wrote:
> On Fri, Dec 01, 2017 at 11:22:12AM +0000, Ananyev, Konstantin wrote:
>>
>>
>>> -----Original Message-----
>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
>>> Sent: Friday, December 1, 2017 10:33 AM
>>> To: Yigit, Ferruh <ferruh.yigit@intel.com>
>>> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org; vladz@cloudius-systems.com
>>> Subject: Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
>>>
>>> On Fri, Dec 01, 2017 at 02:29:57AM +0000, Ferruh Yigit wrote:
>>>> "struct rte_eth_rxtx_callback" is defined as internal data structure but
>>>> used in public APIs.
>>>>
>>>> Checking the API documentation shows that intention was using this
>>>> object as opaque object. Data structure only used in delete APIs which
>>>> doesn't require to know the internals of the data structure.
>>>>
>>>> Converting callback parameter in API to void pointer should not require
>>>> any modification in user application because this data structure was
>>>> already marked as internal and only should be used as pointer in
>>>> application.
>>>>
>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>> ---
>>>
>>> I disagree on this patch. The structure itself is not exposed, only the
>>> name, since it is only passed around as a pointer, so there is no need
>>> to change the parameters to void pointer. It's a named opaque type.
>>
>> Personally I think it would be better to do visa-versa:
>> make rte_eth_add_(rx|tx)_callback() to return struct rte_eth_rxtx_callback *
>> instead of void *.
>> Konstantin
>>
> I didn't realise that it did, so definite +1 to that suggestion.
No issue on having a named opaque type, but unfortunately struct is exposed
because of inline functions again.
It has been moved into rte_ethdev_core.h but accessible by applications.
And since intention is an opaque type, because of "void *" return types, I
thought it is better to hide type completely so that application can't access
details.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage
2017-12-01 2:29 ` [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage Ferruh Yigit
2017-12-01 9:01 ` Hemant Agrawal
@ 2017-12-01 23:52 ` Ferruh Yigit
1 sibling, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-01 23:52 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, vladz, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
On 11/30/2017 6:29 PM, Ferruh Yigit wrote:
> port_id is now 16bits, update function parameter according.
>
> Fixes: 4c270218aa26 ("ethdev: support security APIs")
> Cc: stable@dpdk.org
> Cc: declan.doherty@intel.com
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: Boris Pismenny <borisp@mellanox.com>
> Cc: Aviad Yehezkel <aviadye@mellanox.com>
> Cc: Radu Nicolau <radu.nicolau@intel.com>
> Cc: Declan Doherty <declan.doherty@intel.com>
> ---
<...>
>
> void *
> -rte_eth_dev_get_sec_ctx(uint8_t port_id);
> +rte_eth_dev_get_sec_ctx(uint16_t port_id);
Hi Declan,
Since this is a public API, it needs API documentation. Can you please send a
patch to add doxygen comments the the API?
Thanks,
ferruh
>
> struct rte_eth_dev_sriov {
> uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header
2017-12-01 23:51 ` Ferruh Yigit
@ 2017-12-02 2:22 ` Vlad Zolotarov
2017-12-04 17:54 ` Ferruh Yigit
0 siblings, 1 reply; 76+ messages in thread
From: Vlad Zolotarov @ 2017-12-02 2:22 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
On 12/01/2017 06:51 PM, Ferruh Yigit wrote:
> On 12/1/2017 2:17 PM, Vlad Zolotarov wrote:
>>
>> On 11/30/2017 09:29 PM, Ferruh Yigit wrote:
>>> remove RTE_ETHDEV_HAS_LRO_SUPPORT flag from header.
>>>
>>> Flag seems added with the patch that adds LRO support, and intention
>>> looks like giving a pointer to application that library supports LRO.
>> Exactly. Removing this flag may make the existing application "think" that LRO
>> is not supported.
>> Why do you want to remove it to begin with?
> I agree that this is a little controversial, and I don't have a strong opinion
> about it, I thought twice before sending or not sending the patch :)
>
> This flag can be useful for the applications that use different versions of the
> DPDK library (with the ones does and doesn't support LRO), so that application
> can be more portable.
> I would understand a dynamic approach, which would be useful for distributed
> applications that you don't know and can't control what version of the DPDK
> library used.
> But here to benefit from this flag you need to compile your application against
> DPDK library, and if you are compiling it you already know if your DPDK supports
> LRO or not. And this is not something keeps changing platform to platform etc,
> after a specific release LRO is always supported.
True but DPDK is usually not a part of your source tree - it (should)
come as a library and currently there isn't any proper way to query
feature set.
This flag was also added after a lot of consideration as a rather ugly
compromise since there wasn't (and there isn't) a proper way to do that
at that (this) time. See more on that below.
>
> And this is the only capability support flag in the ethdev, there are many new
> features introduced in each release but they are not advertised by a capability
> flag. Only having LRO flag can be confusing.
>
> _Perhaps_ DPDK should have a way to expose the supported features, and a dynamic
> runtime way can be better option than compile time macros, but it should be
> generic nothing specific to LRO support.
IMO it's not "perhaps" it's a "must" _however_ you can't remove this
flag without giving some other tool to do the same.
Querying a DPDK version would be a wrong direction because some Linux
distributions (yes, I'm talking about you, Ubuntu) tend to have it's own
trees with their own backports and these trees may be light years ahead
in their patch level compared to vanilla trees with the same version.
>
>>> Fixes: 8eecb3295aed ("ixgbe: add LRO support")
>>> Cc: vladz@cloudius-systems.com
>>>
>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>> ---
>>> lib/librte_ether/rte_ethdev.h | 3 ---
>>> 1 file changed, 3 deletions(-)
>>>
>>> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
>>> index 341c2d624..e620c3706 100644
>>> --- a/lib/librte_ether/rte_ethdev.h
>>> +++ b/lib/librte_ether/rte_ethdev.h
>>> @@ -172,9 +172,6 @@ extern "C" {
>>>
>>> #include <stdint.h>
>>>
>>> -/* Use this macro to check if LRO API is supported */
>>> -#define RTE_ETHDEV_HAS_LRO_SUPPORT
>>> -
>>> #include <rte_log.h>
>>> #include <rte_interrupts.h>
>>> #include <rte_dev.h>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
2017-12-01 23:51 ` Ferruh Yigit
@ 2017-12-04 10:31 ` Bruce Richardson
2017-12-04 17:49 ` Ferruh Yigit
0 siblings, 1 reply; 76+ messages in thread
From: Bruce Richardson @ 2017-12-04 10:31 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Ananyev, Konstantin, Thomas Monjalon, dev, vladz
On Fri, Dec 01, 2017 at 03:51:52PM -0800, Ferruh Yigit wrote:
> On 12/1/2017 5:17 AM, Bruce Richardson wrote:
> > On Fri, Dec 01, 2017 at 11:22:12AM +0000, Ananyev, Konstantin wrote:
> >>
> >>
> >>> -----Original Message-----
> >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> >>> Sent: Friday, December 1, 2017 10:33 AM
> >>> To: Yigit, Ferruh <ferruh.yigit@intel.com>
> >>> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org; vladz@cloudius-systems.com
> >>> Subject: Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
> >>>
> >>> On Fri, Dec 01, 2017 at 02:29:57AM +0000, Ferruh Yigit wrote:
> >>>> "struct rte_eth_rxtx_callback" is defined as internal data structure but
> >>>> used in public APIs.
> >>>>
> >>>> Checking the API documentation shows that intention was using this
> >>>> object as opaque object. Data structure only used in delete APIs which
> >>>> doesn't require to know the internals of the data structure.
> >>>>
> >>>> Converting callback parameter in API to void pointer should not require
> >>>> any modification in user application because this data structure was
> >>>> already marked as internal and only should be used as pointer in
> >>>> application.
> >>>>
> >>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >>>> ---
> >>>
> >>> I disagree on this patch. The structure itself is not exposed, only the
> >>> name, since it is only passed around as a pointer, so there is no need
> >>> to change the parameters to void pointer. It's a named opaque type.
> >>
> >> Personally I think it would be better to do visa-versa:
> >> make rte_eth_add_(rx|tx)_callback() to return struct rte_eth_rxtx_callback *
> >> instead of void *.
> >> Konstantin
> >>
> > I didn't realise that it did, so definite +1 to that suggestion.
>
> No issue on having a named opaque type, but unfortunately struct is exposed
> because of inline functions again.
> It has been moved into rte_ethdev_core.h but accessible by applications.
>
> And since intention is an opaque type, because of "void *" return types, I
> thought it is better to hide type completely so that application can't access
> details.
I wouldn't be worried about applications being able to get into the
structure. The only compelling reason for me to make the type opaque
would be for ABI compatibility, and since that is not a factor here, I
don't see the point in changing it to a void *.
/Bruce
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
2017-12-04 10:31 ` Bruce Richardson
@ 2017-12-04 17:49 ` Ferruh Yigit
0 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-04 17:49 UTC (permalink / raw)
To: Bruce Richardson; +Cc: Ananyev, Konstantin, Thomas Monjalon, dev, vladz
On 12/4/2017 2:31 AM, Bruce Richardson wrote:
> On Fri, Dec 01, 2017 at 03:51:52PM -0800, Ferruh Yigit wrote:
>> On 12/1/2017 5:17 AM, Bruce Richardson wrote:
>>> On Fri, Dec 01, 2017 at 11:22:12AM +0000, Ananyev, Konstantin wrote:
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
>>>>> Sent: Friday, December 1, 2017 10:33 AM
>>>>> To: Yigit, Ferruh <ferruh.yigit@intel.com>
>>>>> Cc: Thomas Monjalon <thomas@monjalon.net>; dev@dpdk.org; vladz@cloudius-systems.com
>>>>> Subject: Re: [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object
>>>>>
>>>>> On Fri, Dec 01, 2017 at 02:29:57AM +0000, Ferruh Yigit wrote:
>>>>>> "struct rte_eth_rxtx_callback" is defined as internal data structure but
>>>>>> used in public APIs.
>>>>>>
>>>>>> Checking the API documentation shows that intention was using this
>>>>>> object as opaque object. Data structure only used in delete APIs which
>>>>>> doesn't require to know the internals of the data structure.
>>>>>>
>>>>>> Converting callback parameter in API to void pointer should not require
>>>>>> any modification in user application because this data structure was
>>>>>> already marked as internal and only should be used as pointer in
>>>>>> application.
>>>>>>
>>>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>>>> ---
>>>>>
>>>>> I disagree on this patch. The structure itself is not exposed, only the
>>>>> name, since it is only passed around as a pointer, so there is no need
>>>>> to change the parameters to void pointer. It's a named opaque type.
>>>>
>>>> Personally I think it would be better to do visa-versa:
>>>> make rte_eth_add_(rx|tx)_callback() to return struct rte_eth_rxtx_callback *
>>>> instead of void *.
>>>> Konstantin
>>>>
>>> I didn't realise that it did, so definite +1 to that suggestion.
>>
>> No issue on having a named opaque type, but unfortunately struct is exposed
>> because of inline functions again.
>> It has been moved into rte_ethdev_core.h but accessible by applications.
>>
>> And since intention is an opaque type, because of "void *" return types, I
>> thought it is better to hide type completely so that application can't access
>> details.
>
> I wouldn't be worried about applications being able to get into the
> structure. The only compelling reason for me to make the type opaque
> would be for ABI compatibility, and since that is not a factor here, I
> don't see the point in changing it to a void *.
OK, I will update as suggested.
>
> /Bruce
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header
2017-12-02 2:22 ` Vlad Zolotarov
@ 2017-12-04 17:54 ` Ferruh Yigit
2017-12-04 19:37 ` Vlad Zolotarov
0 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2017-12-04 17:54 UTC (permalink / raw)
To: Vlad Zolotarov, Thomas Monjalon; +Cc: dev, vladz
On 12/1/2017 6:22 PM, Vlad Zolotarov wrote:
>
>
> On 12/01/2017 06:51 PM, Ferruh Yigit wrote:
>> On 12/1/2017 2:17 PM, Vlad Zolotarov wrote:
>>>
>>> On 11/30/2017 09:29 PM, Ferruh Yigit wrote:
>>>> remove RTE_ETHDEV_HAS_LRO_SUPPORT flag from header.
>>>>
>>>> Flag seems added with the patch that adds LRO support, and intention
>>>> looks like giving a pointer to application that library supports LRO.
>>> Exactly. Removing this flag may make the existing application "think" that LRO
>>> is not supported.
>>> Why do you want to remove it to begin with?
>> I agree that this is a little controversial, and I don't have a strong opinion
>> about it, I thought twice before sending or not sending the patch :)
>>
>> This flag can be useful for the applications that use different versions of the
>> DPDK library (with the ones does and doesn't support LRO), so that application
>> can be more portable.
>> I would understand a dynamic approach, which would be useful for distributed
>> applications that you don't know and can't control what version of the DPDK
>> library used.
>> But here to benefit from this flag you need to compile your application against
>> DPDK library, and if you are compiling it you already know if your DPDK supports
>> LRO or not. And this is not something keeps changing platform to platform etc,
>> after a specific release LRO is always supported.
>
> True but DPDK is usually not a part of your source tree - it (should) come as a
> library and currently there isn't any proper way to query feature set.
> This flag was also added after a lot of consideration as a rather ugly
> compromise since there wasn't (and there isn't) a proper way to do that at that
> (this) time. See more on that below.
>
>>
>> And this is the only capability support flag in the ethdev, there are many new
>> features introduced in each release but they are not advertised by a capability
>> flag. Only having LRO flag can be confusing.
>>
>> _Perhaps_ DPDK should have a way to expose the supported features, and a dynamic
>> runtime way can be better option than compile time macros, but it should be
>> generic nothing specific to LRO support.
>
> IMO it's not "perhaps" it's a "must" _however_
This is even wider than ethdev, more like in DPDK scope, we need someone to
attack this issue.
> you can't remove this flag without giving some other tool to do the same.
Fair enough, I will drop the patch.
> Querying a DPDK version would be a wrong direction because some Linux
> distributions (yes, I'm talking about you, Ubuntu) tend to have it's own trees
> with their own backports and these trees may be light years ahead in their patch
> level compared to vanilla trees with the same version.
+1 to have better way than version check.
>
>>
>>>> Fixes: 8eecb3295aed ("ixgbe: add LRO support")
>>>> Cc: vladz@cloudius-systems.com
>>>>
>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>> ---
>>>> lib/librte_ether/rte_ethdev.h | 3 ---
>>>> 1 file changed, 3 deletions(-)
>>>>
>>>> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
>>>> index 341c2d624..e620c3706 100644
>>>> --- a/lib/librte_ether/rte_ethdev.h
>>>> +++ b/lib/librte_ether/rte_ethdev.h
>>>> @@ -172,9 +172,6 @@ extern "C" {
>>>>
>>>> #include <stdint.h>
>>>>
>>>> -/* Use this macro to check if LRO API is supported */
>>>> -#define RTE_ETHDEV_HAS_LRO_SUPPORT
>>>> -
>>>> #include <rte_log.h>
>>>> #include <rte_interrupts.h>
>>>> #include <rte_dev.h>
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header
2017-12-04 17:54 ` Ferruh Yigit
@ 2017-12-04 19:37 ` Vlad Zolotarov
0 siblings, 0 replies; 76+ messages in thread
From: Vlad Zolotarov @ 2017-12-04 19:37 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon; +Cc: dev, vladz
On 12/04/2017 12:54 PM, Ferruh Yigit wrote:
> On 12/1/2017 6:22 PM, Vlad Zolotarov wrote:
>>
>> On 12/01/2017 06:51 PM, Ferruh Yigit wrote:
>>> On 12/1/2017 2:17 PM, Vlad Zolotarov wrote:
>>>> On 11/30/2017 09:29 PM, Ferruh Yigit wrote:
>>>>> remove RTE_ETHDEV_HAS_LRO_SUPPORT flag from header.
>>>>>
>>>>> Flag seems added with the patch that adds LRO support, and intention
>>>>> looks like giving a pointer to application that library supports LRO.
>>>> Exactly. Removing this flag may make the existing application "think" that LRO
>>>> is not supported.
>>>> Why do you want to remove it to begin with?
>>> I agree that this is a little controversial, and I don't have a strong opinion
>>> about it, I thought twice before sending or not sending the patch :)
>>>
>>> This flag can be useful for the applications that use different versions of the
>>> DPDK library (with the ones does and doesn't support LRO), so that application
>>> can be more portable.
>>> I would understand a dynamic approach, which would be useful for distributed
>>> applications that you don't know and can't control what version of the DPDK
>>> library used.
>>> But here to benefit from this flag you need to compile your application against
>>> DPDK library, and if you are compiling it you already know if your DPDK supports
>>> LRO or not. And this is not something keeps changing platform to platform etc,
>>> after a specific release LRO is always supported.
>> True but DPDK is usually not a part of your source tree - it (should) come as a
>> library and currently there isn't any proper way to query feature set.
>> This flag was also added after a lot of consideration as a rather ugly
>> compromise since there wasn't (and there isn't) a proper way to do that at that
>> (this) time. See more on that below.
>>
>>> And this is the only capability support flag in the ethdev, there are many new
>>> features introduced in each release but they are not advertised by a capability
>>> flag. Only having LRO flag can be confusing.
>>>
>>> _Perhaps_ DPDK should have a way to expose the supported features, and a dynamic
>>> runtime way can be better option than compile time macros, but it should be
>>> generic nothing specific to LRO support.
>> IMO it's not "perhaps" it's a "must" _however_
> This is even wider than ethdev, more like in DPDK scope, we need someone to
> attack this issue.
absolutely!
>
>> you can't remove this flag without giving some other tool to do the same.
> Fair enough, I will drop the patch.
>
>> Querying a DPDK version would be a wrong direction because some Linux
>> distributions (yes, I'm talking about you, Ubuntu) tend to have it's own trees
>> with their own backports and these trees may be light years ahead in their patch
>> level compared to vanilla trees with the same version.
> +1 to have better way than version check.
>
>>>>> Fixes: 8eecb3295aed ("ixgbe: add LRO support")
>>>>> Cc: vladz@cloudius-systems.com
>>>>>
>>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>>> ---
>>>>> lib/librte_ether/rte_ethdev.h | 3 ---
>>>>> 1 file changed, 3 deletions(-)
>>>>>
>>>>> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
>>>>> index 341c2d624..e620c3706 100644
>>>>> --- a/lib/librte_ether/rte_ethdev.h
>>>>> +++ b/lib/librte_ether/rte_ethdev.h
>>>>> @@ -172,9 +172,6 @@ extern "C" {
>>>>>
>>>>> #include <stdint.h>
>>>>>
>>>>> -/* Use this macro to check if LRO API is supported */
>>>>> -#define RTE_ETHDEV_HAS_LRO_SUPPORT
>>>>> -
>>>>> #include <rte_log.h>
>>>>> #include <rte_interrupts.h>
>>>>> #include <rte_dev.h>
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage
2017-12-01 2:29 [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
` (6 preceding siblings ...)
[not found] ` <49eb13f1-e12f-071a-b58b-1cd4852b7c8b@scylladb.com>
@ 2018-01-09 16:23 ` Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 2/6] ethdev: separate driver APIs Ferruh Yigit
` (5 more replies)
7 siblings, 6 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-09 16:23 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
port_id is now 16bits, update function parameter according.
Fixes: 4c270218aa26 ("ethdev: support security APIs")
Cc: stable@dpdk.org
Cc: declan.doherty@intel.com
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
Cc: Boris Pismenny <borisp@mellanox.com>
Cc: Aviad Yehezkel <aviadye@mellanox.com>
Cc: Radu Nicolau <radu.nicolau@intel.com>
Cc: Declan Doherty <declan.doherty@intel.com>
---
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 394aa26a5..a8c484468 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -273,7 +273,7 @@ rte_eth_dev_socket_id(uint16_t port_id)
}
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id)
+rte_eth_dev_get_sec_ctx(uint16_t port_id)
{
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL);
return rte_eth_devices[port_id].security_ctx;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 77fb69167..cce1a47d2 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1719,7 +1719,7 @@ struct rte_eth_dev {
} __rte_cache_aligned;
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
+rte_eth_dev_get_sec_ctx(uint16_t port_id);
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v2 2/6] ethdev: separate driver APIs
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
@ 2018-01-09 16:23 ` Ferruh Yigit
2018-01-09 19:19 ` Andrew Rybchenko
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 3/6] ethdev: separate internal structures into own header Ferruh Yigit
` (4 subsequent siblings)
5 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-09 16:23 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon, Hemant Agrawal, Shreyansh Jain,
Nipun Gupta, Jerin Jacob, Santosh Shukla, John W. Linville,
Shepard Siegel, Ed Czeck, John Miller, Allain Legacy,
Matt Peters, Harish Patil, Rasesh Mody, Ajit Khaparde,
Somnath Kotur, Declan Doherty, Rahul Lakkireddy, Wenzhuo Lu,
Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
John Daley, Nelson Escobar, Gaetan Rivet, Qi Zhang, Xiao Wang,
Beilei Xing, Chao Zhu, Jianbo Liu, Konstantin Ananyev,
Shijith Thotton, Srisivasubramanian Srinivasan, Adrien Mazarguil,
Nelio Laranjeiro, Yongseok Koh, Jacek Siuda, Tomasz Duszynski,
Dmitri Epshtein, Natalie Samsonov, Alejandro Lucero,
Tetsuya Mukawa, Shahed Shaikh, Bruce Richardson,
Andrew Rybchenko, Jasvinder Singh, Cristian Dumitrescu,
Matej Vido, Pascal Mazon, Maciej Czekaj, Yuanhan Liu,
Maxime Coquelin, Tiwei Bie, Shrikrishna Khare
Cc: dev, stable, Boris Pismenny, Aviad Yehezkel, Radu Nicolau
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.
There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.
More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
v2:
* use SPDX header
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
drivers/net/bonding/rte_eth_bond_private.h | 2 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 2 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 2 +-
drivers/net/e1000/igb_flow.c | 2 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 2 +-
drivers/net/enic/enic_clsf.c | 2 +-
drivers/net/enic/enic_ethdev.c | 2 +-
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/failsafe/failsafe.c | 2 +-
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 2 +-
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/rte_pmd_i40e.h | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 2 +-
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +-
drivers/net/kni/rte_eth_kni.c | 2 +-
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 2 +-
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/mlx5.c | 2 +-
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
| 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mrvl/mrvl_ethdev.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/null/rte_eth_null.c | 2 +-
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 2 +-
drivers/net/qede/qede_ethdev.h | 2 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 2 +-
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 2 +-
drivers/net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 2 +-
drivers/net/tap/rte_eth_tap.c | 2 +-
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.c | 1 +
lib/librte_ether/rte_ethdev.h | 114 +-------------------
lib/librte_ether/rte_ethdev_driver.h | 134 ++++++++++++++++++++++++
lib/librte_ether/rte_ethdev_pci.h | 2 +-
lib/librte_ether/rte_ethdev_vdev.h | 2 +-
149 files changed, 285 insertions(+), 255 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_driver.h
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 79f485859..3db4f55da 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_bus.h>
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index da3749044..15bf73a40 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -11,7 +11,7 @@
#include <stdbool.h>
#include <net/if.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <compat.h>
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index f0d3a6e5c..ff9f1501c 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -14,7 +14,7 @@
#include <rte_malloc.h>
#include <rte_devargs.h>
#include <rte_memcpy.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <fslmc_vfio.h>
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 79ce9be32..855734254 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -22,7 +22,7 @@
#include <eal_filesystem.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index ffad0f536..139249c07 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -19,7 +19,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
index f0edaf414..fb28e4970 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 6e349a715..af3df11bf 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -24,7 +24,7 @@
#include<sys/eventfd.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index ba7e5145e..42115a09d 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -26,7 +26,7 @@
#include <rte_memory.h>
#include <rte_pci.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fslmc_vfio.h>
diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
index cdb3f86eb..0caab5cf9 100644
--- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
+++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <mc/fsl_dpcon.h>
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index fc9a40426..b9b3844f2 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -36,7 +36,7 @@
#include <rte_debug.h>
#include <rte_dev.h>
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <rte_lcore.h>
#include <rte_log.h>
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 51770d412..afda2c290 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -14,7 +14,7 @@
#include <errno.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index fa84eb9c2..0cddfacdf 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -37,7 +37,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index 3a54a4c91..146787112 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -38,7 +38,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
int eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
diff --git a/drivers/net/ark/ark_ethdev_tx.h b/drivers/net/ark/ark_ethdev_tx.h
index 8aaafc22e..657f895a4 100644
--- a/drivers/net/ark/ark_ethdev_tx.h
+++ b/drivers/net/ark/ark_ethdev_tx.h
@@ -36,7 +36,7 @@
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
uint16_t eth_ark_xmit_pkts_noop(void *vtxq,
diff --git a/drivers/net/ark/ark_ext.h b/drivers/net/ark/ark_ext.h
index d26c8198b..031cfddc3 100644
--- a/drivers/net/ark/ark_ext.h
+++ b/drivers/net/ark/ark_ext.h
@@ -34,7 +34,7 @@
#ifndef _ARK_EXT_H_
#define _ARK_EXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* This is the template file for users who which to define a dynamic
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index aef2cf73b..41eb260e6 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -38,7 +38,7 @@
#include <assert.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 202a1d9be..2cadaab80 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -36,7 +36,7 @@
#include <locale.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktchkr.h"
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index 018f37b69..d3c3dee1e 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -38,7 +38,7 @@
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktgen.h"
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index deb6f355d..e4ad7b00a 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -36,7 +36,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h
index 967d6dc50..37cac1589 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.h
+++ b/drivers/net/bnx2x/bnx2x_ethdev.h
@@ -33,7 +33,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_eal.h>
#include <rte_mempool.h>
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index e46759f25..9738a0f9e 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -40,7 +40,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
#include <rte_lcore.h>
#include <rte_spinlock.h>
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 6f8a6335b..de0aa6319 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
diff --git a/drivers/net/bnxt/bnxt_stats.h b/drivers/net/bnxt/bnxt_stats.h
index 51d16f5d3..c1c83d57b 100644
--- a/drivers/net/bnxt/bnxt_stats.h
+++ b/drivers/net/bnxt/bnxt_stats.h
@@ -34,7 +34,7 @@
#ifndef _BNXT_STATS_H_
#define _BNXT_STATS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
void bnxt_free_stats(struct bnxt *bp);
int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index a31340742..f1972cfeb 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -36,7 +36,7 @@
#include <unistd.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h
index f881d30d6..cd7227ac2 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.h
+++ b/drivers/net/bnxt/rte_pmd_bnxt.h
@@ -34,7 +34,7 @@
#ifndef _PMD_BNXT_H_
#define _PMD_BNXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* Response sent back to the caller after callback
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 5777c1172..59e248551 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 0ce65d6f4..380fe4c08 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_tcp.h>
#include <rte_udp.h>
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index 3b323113a..85e1490e1 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -5,7 +5,7 @@
#ifndef _RTE_ETH_BOND_PRIVATE_H_
#define _RTE_ETH_BOND_PRIVATE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_bitmap.h>
diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 282e2e625..56f38c838 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -44,7 +44,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index dc153c731..5cd260f48 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 5b828c237..28db6c061 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -55,7 +55,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index fc10d9585..3d5aa596f 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 2eb00b5f1..d9f48b14d 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -28,7 +28,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index bd63ee033..eac295380 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -9,7 +9,7 @@
/* System headers */
#include <stdbool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fsl_usd.h>
#include <fsl_qman.h>
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 905ecc09f..369c677c9 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_ip.h>
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index f7a8d9f26..b93376de4 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 25f1a4545..5bcb3c9d0 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 53466c37d..11598ef34 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 4a77ec981..fdfa5893a 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index a010b3ab8..02fae100c 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 6c10705e3..25fd528fa 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index 70cafeaa0..787412e00 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 3258f3b5b..b9f2e5391 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -16,7 +16,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 19e5a807d..daa93fd97 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 3f379a9b2..656f3ca05 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -32,7 +32,7 @@
*/
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_tcp.h>
#include <rte_atomic.h>
diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index 9b461424b..ac1d6a4c4 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -34,7 +34,7 @@
#include <libgen.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_hash.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 669dbf336..02353abfd 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -38,7 +38,7 @@
#include <rte_dev.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index a728d0777..0fd7dda3e 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -31,7 +31,7 @@
#include <errno.h>
#include <rte_log.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow_driver.h>
#include <rte_ether.h>
#include <rte_ip.h>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 8af0ccd3c..baf8e5c20 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -45,7 +45,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "enic_compat.h"
#include "enic.h"
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index e4b80d49c..bddecdb68 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -33,7 +33,7 @@
*/
#include "enic_compat.h"
-#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "wq_enet_desc.h"
#include "rq_enet_desc.h"
#include "cq_enet_desc.h"
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index a3663d516..32c1f19b6 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -31,7 +31,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include "enic_compat.h"
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 6bc5abac8..7cc758d10 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -33,7 +33,7 @@
#include <rte_alarm.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_devargs.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index e16a59036..2a204948f 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -35,7 +35,7 @@
#include <rte_debug.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_flow.h>
#include <rte_cycles.h>
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index d81cc3ca6..479091f54 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -38,7 +38,7 @@
#include <rte_atomic.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_devargs.h>
#define FAILSAFE_DRIVER_NAME "Fail-safe PMD"
diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c
index 70157c829..b52a7c437 100644
--- a/drivers/net/failsafe/failsafe_rxtx.c
+++ b/drivers/net/failsafe/failsafe_rxtx.c
@@ -34,7 +34,7 @@
#include <rte_atomic.h>
#include <rte_debug.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "failsafe_private.h"
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 3db21adae..4c0a4d644 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2013-2016 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 65956db08..9320748c4 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_net.h>
#include "fm10k.h"
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index 630ca49b9..498a17815 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "fm10k.h"
#include "base/fm10k_type.h"
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 9ec02012a..adcaef6f6 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 31a8c778b..595e7281e 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_dev.h>
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index e471b5a51..e1cdda278 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index e522962c2..012b934ec 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_eth_ctrl.h>
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 1bca25019..7b4cb7dc0 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -14,7 +14,7 @@
#include <rte_string_fns.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index a35a9d3f3..102f8dff7 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index 5e4e472a3..f3fc82672 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index e3faaefd9..3ffedcb9e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _I40E_RXTX_VEC_COMMON_H_
#define _I40E_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "i40e_ethdev.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index b5685e2b9..e549d1e8c 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 1df306122..3b22588c5 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index 7ca37b197..7ce6f8ff9 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -14,7 +14,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Response sent back to i40e driver from user app after callback
diff --git a/drivers/net/ixgbe/ixgbe_bypass.c b/drivers/net/ixgbe/ixgbe_bypass.c
index 62a550653..ae38ce355 100644
--- a/drivers/net/ixgbe/ixgbe_bypass.c
+++ b/drivers/net/ixgbe/ixgbe_bypass.c
@@ -4,7 +4,7 @@
#include <time.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_bypass_api.h"
#include "rte_pmd_ixgbe.h"
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 2e8e6553b..1a2df458d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 551580c04..75f74ac07 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -13,7 +13,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_logs.h"
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index f31aebda7..ef382ed37 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index 85305c60a..d4e59179a 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ip.h>
#include <rte_jhash.h>
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 9b0bd755d..0e06fb3bf 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 9bc846245..4a30292cc 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -62,7 +62,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
index df580f39b..414840a2b 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _IXGBE_RXTX_VEC_COMMON_H_
#define _IXGBE_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_rxtx.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index b2a2774da..e0f9998f0 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 0131b06d2..c9ba48246 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index 001a8647e..d8ca8ca31 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "base/ixgbe_api.h"
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 463a78e50..11a9f334b 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -11,7 +11,7 @@
#ifndef _PMD_IXGBE_H_
#define _PMD_IXGBE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Notify VF when PF link status changes.
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index 43c63c77a..4fdc39953 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -6,7 +6,7 @@
#include <pthread.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kni.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 7f7e98d78..bd1e9d478 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -33,7 +33,7 @@
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/base/lio_mbox.c b/drivers/net/liquidio/base/lio_mbox.c
index b4abc6235..f10f1bb90 100644
--- a/drivers/net/liquidio/base/lio_mbox.c
+++ b/drivers/net/liquidio/base/lio_mbox.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include "lio_logs.h"
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index b90d0545b..378313ebd 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 759556c82..573670d55 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -31,7 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 4bc4a6ff5..448307bba 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -57,7 +57,7 @@
#include <rte_common.h>
#include <rte_dev.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 99dc3357a..638cb08b0 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_interrupts.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 2f69e7d4f..42ac2438b 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -63,7 +63,7 @@
#include <rte_bus_pci.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_pci.h>
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 69025da42..4308fa57c 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -57,7 +57,7 @@
#include <rte_byteorder.h>
#include <rte_errno.h>
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index b10c4f552..cd46f860d 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -47,7 +47,7 @@
#endif
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c
index 50d197698..c0a96f721 100644
--- a/drivers/net/mlx4/mlx4_intr.c
+++ b/drivers/net/mlx4/mlx4_intr.c
@@ -52,7 +52,7 @@
#include <rte_alarm.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_io.h>
#include <rte_interrupts.h>
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index 53313c56f..c4c66560a 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -55,7 +55,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h
index b93e2bcda..09aa3796f 100644
--- a/drivers/net/mlx4/mlx4_rxtx.h
+++ b/drivers/net/mlx4/mlx4_rxtx.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c
index d651e4980..0739eaaab 100644
--- a/drivers/net/mlx4/mlx4_txq.c
+++ b/drivers/net/mlx4/mlx4_txq.c
@@ -53,7 +53,7 @@
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index cd66fe162..20e10b1fe 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -51,7 +51,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index e6a69b823..00043ff4f 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -53,7 +53,7 @@
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_interrupts.h>
#include <rte_errno.h>
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 282ef241e..ad35d600f 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -55,7 +55,7 @@
#include <sys/un.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_bus_pci.h>
#include <rte_mbuf.h>
#include <rte_common.h>
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index e0775172c..4b3b93ac1 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -44,7 +44,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 9fb5ba5e7..a5e78ec8d 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -52,7 +52,7 @@
#endif
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5.h"
--git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index f47bda667..9e12b51fe 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -48,7 +48,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_defs.h"
diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c
index 6fb245ba1..897695855 100644
--- a/drivers/net/mlx5/mlx5_rxmode.c
+++ b/drivers/net/mlx5/mlx5_rxmode.c
@@ -45,7 +45,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_rxtx.h"
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index a4cdd374a..f230bdb11 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -52,7 +52,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_debug.h>
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 4cb6136fc..36234b870 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -34,7 +34,7 @@
#include <linux/sockios.h>
#include <linux/ethtool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 88f60a01d..02e46e6d7 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_interrupts.h>
#include <rte_alarm.h>
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 89b16fda2..12f7456d8 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -51,7 +51,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 198a69e3c..c42bef0cd 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -36,7 +36,7 @@
#include <assert.h>
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 127ce44a8..87abe2a7a 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -32,7 +32,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_log.h>
#include <rte_malloc.h>
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 4d7822f0b..c762dd840 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -43,7 +43,7 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_debug.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ether.h>
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 032c30e9d..80fe0e5ce 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -32,7 +32,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h
index d37bb8a23..05c674b37 100644
--- a/drivers/net/octeontx/octeontx_ethdev.h
+++ b/drivers/net/octeontx/octeontx_ethdev.h
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eventdev.h>
#include <rte_mempool.h>
#include <rte_memory.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c
index c97d5b351..30d908113 100644
--- a/drivers/net/octeontx/octeontx_rxtx.c
+++ b/drivers/net/octeontx/octeontx_rxtx.c
@@ -37,7 +37,7 @@
#include <rte_atomic.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index 382ff2b2f..7aa31c4f9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -33,7 +33,7 @@
#ifndef __OCTEONTX_RXTX_H__
#define __OCTEONTX_RXTX_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#ifndef __hot
#define __hot __attribute__((hot))
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 72fcd0916..584e2f6f5 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -11,7 +11,7 @@
#include <pcap.h>
#include <rte_cycles.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 7e55baff3..950ef8215 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -13,7 +13,7 @@
#include <sys/queue.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ip.h>
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index e72e499b9..1155f7b2d 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -4,7 +4,7 @@
#include "rte_eth_ring.h"
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index b72eba063..b138313e9 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -36,7 +36,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_spinlock.h>
diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index 3f6a604ba..ed369f570 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -33,7 +33,7 @@
#define _SFC_DP_RX_H
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h
index 94d1b1086..4eeeab2bb 100644
--- a/drivers/net/sfc/sfc_dp_tx.h
+++ b/drivers/net/sfc/sfc_dp_tx.h
@@ -32,7 +32,7 @@
#ifndef _SFC_DP_TX_H
#define _SFC_DP_TX_H
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index fabcc3293..9a8d216b3 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -30,7 +30,7 @@
*/
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index 065defe0a..43b760993 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -32,7 +32,7 @@
#ifndef _SFC_EV_H_
#define _SFC_EV_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index f2050f65e..bc9aa55c0 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -31,7 +31,7 @@
#include <rte_tailq.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eth_ctrl.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 9e6282ead..53cd8248e 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -34,7 +34,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_tx.h b/drivers/net/sfc/sfc_tx.h
index 0c1c7083b..79a04dbda 100644
--- a/drivers/net/sfc/sfc_tx.h
+++ b/drivers/net/sfc/sfc_tx.h
@@ -33,7 +33,7 @@
#define _SFC_TX_H
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index c21c29e79..cfa77f109 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index 3a1282347..050e3e7e1 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -9,7 +9,7 @@
#include <rte_mbuf.h>
#include <rte_sched.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tm_driver.h>
#include "rte_eth_softnic.h"
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index af0580a31..50f4f90d4 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -44,7 +44,7 @@
#include <libsze2.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 80fa0dcfd..f5c3323c2 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -7,7 +7,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index 829f32f3e..00d6ad8a0 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -41,7 +41,7 @@
#include <linux/if_tun.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#ifdef IFF_MULTI_QUEUE
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 9756b29d5..9d935dc8e 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -52,7 +52,7 @@
#include <rte_dev.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_interrupts.h>
#include <rte_log.h>
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index 71bc3cf2a..15c6af702 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -33,7 +33,7 @@
#ifndef __THUNDERX_NICVF_ETHDEV_H__
#define __THUNDERX_NICVF_ETHDEV_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define THUNDERX_NICVF_PMD_VERSION "2.0"
#define THUNDERX_REG_BYTES 8
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index 9d69cf4e2..b9088a447 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -41,7 +41,7 @@
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h
index a3ccce290..f638e2011 100644
--- a/drivers/net/thunderx/nicvf_rxtx.h
+++ b/drivers/net/thunderx/nicvf_rxtx.h
@@ -34,7 +34,7 @@
#define __THUNDERX_NICVF_RXTX_H__
#include <rte_byteorder.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define NICVF_TX_OFFLOAD_MASK (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 0f8208ef1..9b7483203 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -39,7 +39,7 @@
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
struct nicvf_rbdr {
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 2536ee4a2..4b71ac397 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index ee0cb3dd2..b262f58b1 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -8,7 +8,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index fb1f6a9ec..190755011 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -9,7 +9,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
struct virtqueue;
struct virtnet_ctl;
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 994458ced..98cc4f5e0 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index 8ef3c0c04..d026a7f02 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c
index db15c9f5d..0162621c4 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_neon.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c
@@ -40,7 +40,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c
index 6378b12af..d768d0757 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_sse.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c
@@ -14,7 +14,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 537e8ddd3..984db3757 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
#include <rte_malloc.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index f9416f348..b70e91756 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -32,7 +32,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index ea8cf941a..48d84f445 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -27,6 +27,7 @@ SRCS-y += ethdev_profile.c
# Export include files
#
SYMLINK-y-include += rte_ethdev.h
+SYMLINK-y-include += rte_ethdev_driver.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index a8c484468..b3918b77a 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -37,6 +37,7 @@
#include "rte_ether.h"
#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "ethdev_profile.h"
static const char *MZ_RTE_ETH_DEV_DATA = "rte_eth_dev_data";
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index cce1a47d2..38ec60b4b 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -17,10 +17,10 @@
* to get its MAC address, the speed and the status of its physical link,
* to receive and to transmit packets, and so on.
*
- * - The driver-oriented Ethernet API that exports a function allowing
- * an Ethernet Poll Mode Driver (PMD) to simultaneously register itself as
- * an Ethernet device driver and as a PCI driver for a set of matching PCI
- * [Ethernet] devices classes.
+ * - The driver-oriented Ethernet API that exports functions allowing
+ * an Ethernet Poll Mode Driver (PMD) to allocate an Ethernet device instance,
+ * create memzone for HW rings and process registered callbacks, and so on.
+ * PMDs should include rte_ethdev_driver.h instead of this header.
*
* By default, all the functions of the Ethernet Device API exported by a PMD
* are lock-free functions which assume to not be invoked in parallel on
@@ -1830,53 +1830,6 @@ uint16_t rte_eth_find_next(uint16_t port_id);
*/
uint16_t rte_eth_dev_count(void);
-/**
- * @internal
- * Returns a ethdev slot specified by the unique identifier name.
- *
- * @param name
- * The pointer to the Unique identifier name for each Ethernet device
- * @return
- * - The pointer to the ethdev slot, on success. NULL on error
- */
-struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
-
-/**
- * @internal
- * Allocates a new ethdev slot for an ethernet device and returns the pointer
- * to that slot for the driver to use.
- *
- * @param name Unique identifier name for each Ethernet device
- * @param type Device type of this Ethernet device
- * @return
- * - Slot in the rte_dev_devices array for a new device;
- */
-struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
-
-/**
- * @internal
- * Attach to the ethdev already initialized by the primary
- * process.
- *
- * @param name Ethernet device's name.
- * @return
- * - Success: Slot in the rte_dev_devices array for attached
- * device.
- * - Error: Null pointer.
- */
-struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
-
-/**
- * @internal
- * Release the specified ethdev port.
- *
- * @param eth_dev
- * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
- * @return
- * - 0 on success, negative on error
- */
-int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
-
/**
* Attach a new Ethernet device specified by arguments.
*
@@ -1954,19 +1907,6 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
-/**
- * @internal
- * Release device queues and clear its configuration to force the user
- * application to reconfigure it. It is for internal use only.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- *
- * @return
- * void
- */
-void _rte_eth_dev_reset(struct rte_eth_dev *dev);
-
/**
* Allocate and set up a receive queue for an Ethernet device.
*
@@ -3547,28 +3487,6 @@ int rte_eth_dev_callback_unregister(uint16_t port_id,
enum rte_eth_event_type event,
rte_eth_dev_cb_fn cb_fn, void *cb_arg);
-/**
- * @internal Executes all the user application registered callbacks for
- * the specific device. It is for DPDK internal user only. User
- * application should not call it directly.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- * @param event
- * Eth device interrupt event type.
- * @param cb_arg
- * callback parameter.
- * @param ret_param
- * To pass data back to user application.
- * This allows the user application to decide if a particular function
- * is permitted or not.
- *
- * @return
- * int
- */
-int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
- enum rte_eth_event_type event, void *cb_arg, void *ret_param);
-
/**
* 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
@@ -4439,30 +4357,6 @@ int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
*/
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
-/**
- * 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);
-
/**
* Config l2 tunnel ether type of an Ethernet device for filtering specific
* tunnel packets by ether type.
diff --git a/lib/librte_ether/rte_ethdev_driver.h b/lib/librte_ether/rte_ethdev_driver.h
new file mode 100644
index 000000000..e381858a6
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_driver.h
@@ -0,0 +1,134 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
+ */
+
+#ifndef _RTE_ETHDEV_DRIVER_H_
+#define _RTE_ETHDEV_DRIVER_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device PMD API
+ *
+ * These APIs for the use from Ethernet drivers, user applications shouldn't
+ * use them.
+ *
+ */
+
+#include <rte_ethdev.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @internal
+ * Returns a ethdev slot specified by the unique identifier name.
+ *
+ * @param name
+ * The pointer to the Unique identifier name for each Ethernet device
+ * @return
+ * - The pointer to the ethdev slot, on success. NULL on error
+ */
+struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+
+/**
+ * @internal
+ * Allocates a new ethdev slot for an ethernet device and returns the pointer
+ * to that slot for the driver to use.
+ *
+ * @param name Unique identifier name for each Ethernet device
+ * @param type Device type of this Ethernet device
+ * @return
+ * - Slot in the rte_dev_devices array for a new device;
+ */
+struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
+
+/**
+ * @internal
+ * Attach to the ethdev already initialized by the primary
+ * process.
+ *
+ * @param name Ethernet device's name.
+ * @return
+ * - Success: Slot in the rte_dev_devices array for attached
+ * device.
+ * - Error: Null pointer.
+ */
+struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
+
+/**
+ * @internal
+ * Release the specified ethdev port.
+ *
+ * @param eth_dev
+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
+ * @return
+ * - 0 on success, negative on error
+ */
+int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
+
+/**
+ * @internal
+ * Release device queues and clear its configuration to force the user
+ * application to reconfigure it. It is for internal use only.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ *
+ * @return
+ * void
+ */
+void _rte_eth_dev_reset(struct rte_eth_dev *dev);
+
+/**
+ * @internal Executes all the user application registered callbacks for
+ * the specific device. It is for DPDK internal user only. User
+ * application should not call it directly.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ * @param event
+ * Eth device interrupt event type.
+ * @param cb_arg
+ * callback parameter.
+ * @param ret_param
+ * To pass data back to user application.
+ * This allows the user application to decide if a particular function
+ * is permitted or not.
+ *
+ * @return
+ * int
+ */
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+ enum rte_eth_event_type event, void *cb_arg, void *ret_param);
+
+/**
+ * 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
+
+#endif /* _RTE_ETHDEV_DRIVER_H_ */
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index 722075e09..2af330a09 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -37,7 +37,7 @@
#include <rte_malloc.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Copy pci device info to the Ethernet device data.
diff --git a/lib/librte_ether/rte_ethdev_vdev.h b/lib/librte_ether/rte_ethdev_vdev.h
index ff92e6ed0..a753c379f 100644
--- a/lib/librte_ether/rte_ethdev_vdev.h
+++ b/lib/librte_ether/rte_ethdev_vdev.h
@@ -36,7 +36,7 @@
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @internal
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v2 3/6] ethdev: separate internal structures into own header
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 2/6] ethdev: separate driver APIs Ferruh Yigit
@ 2018-01-09 16:23 ` Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 4/6] ethdev: reorder inline functions Ferruh Yigit
` (3 subsequent siblings)
5 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-09 16:23 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
rte_ethdev_core.h created. Internal data structures are moved here.
These structures are mostly intended to be used by drivers, but they
need to be in the public header file because of the inline functions
in the ethdev.h header, and those inline functions are preferred to
kept because of the performance concerns.
The accessibility of the data structures are not changed, only logically
grouped to show that they are not intended to be used by applications.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.h | 579 +---------------------------------
lib/librte_ether/rte_ethdev_core.h | 619 +++++++++++++++++++++++++++++++++++++
3 files changed, 621 insertions(+), 578 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_core.h
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 48d84f445..34d014e71 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -28,6 +28,7 @@ SRCS-y += ethdev_profile.c
#
SYMLINK-y-include += rte_ethdev.h
SYMLINK-y-include += rte_ethdev_driver.h
+SYMLINK-y-include += rte_ethdev_core.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 38ec60b4b..7cf177fb2 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1140,478 +1140,6 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
/**< l2 tunnel forwarding mask */
#define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
-/*
- * Definitions of all functions exported by an Ethernet driver through the
- * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
- * structure associated with an Ethernet device.
- */
-
-typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
-/**< @internal Ethernet device configuration. */
-
-typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to start a configured Ethernet device. */
-
-typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to stop a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link up a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link down a configured Ethernet device. */
-
-typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to close a configured Ethernet device. */
-
-typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
-/** <@internal Function used to reset a configured Ethernet device. */
-
-typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
-
-typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
-
-typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
- int wait_to_complete);
-/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
-
-typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_stats *igb_stats);
-/**< @internal Get global I/O statistics of an Ethernet device. */
-
-typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
-
-typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat *stats, unsigned n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
- const uint64_t *ids,
- uint64_t *values,
- unsigned int n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, unsigned size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
- unsigned int size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
- uint16_t queue_id,
- uint8_t stat_idx,
- uint8_t is_rx);
-/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
-
-typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_dev_info *dev_info);
-/**< @internal Get specific informations of an Ethernet device. */
-
-typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
-/**< @internal Get supported ptypes of an Ethernet device. */
-
-typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Start rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Stop rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- uint16_t nb_rx_desc,
- unsigned int socket_id,
- const struct rte_eth_rxconf *rx_conf,
- struct rte_mempool *mb_pool);
-/**< @internal Set up a receive queue of an Ethernet device. */
-
-typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t tx_queue_id,
- uint16_t nb_tx_desc,
- unsigned int socket_id,
- 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. */
-
-typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id);
-/**< @internal Get number of used descriptors on a receive queue. */
-
-typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
-/**< @internal Check DD bit of specific RX descriptor */
-
-typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
-/**< @internal Check the status of a Rx descriptor */
-
-typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
-/**< @internal Check the status of a Tx descriptor */
-
-typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
- char *fw_version, size_t fw_size);
-/**< @internal Get firmware information of an Ethernet device. */
-
-typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
-/**< @internal Force mbufs to be from TX ring. */
-
-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. */
-
-typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
-
-typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
- enum rte_vlan_type type, uint16_t tpid);
-/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
-
-typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
-/**< @internal set VLAN offload function by an Ethernet device. */
-
-typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal set port based TX VLAN insertion by an Ethernet device. */
-
-typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- int on);
-/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
-
-typedef uint16_t (*eth_rx_burst_t)(void *rxq,
- struct rte_mbuf **rx_pkts,
- uint16_t nb_pkts);
-/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_burst_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Send output packets on a transmit queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_prep_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Prepare output packets on a transmit queue of 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 */
-
-typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_fc_conf *fc_conf);
-/**< @internal Setup flow control parameter on an Ethernet device */
-
-typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_pfc_conf *pfc_conf);
-/**< @internal Setup priority flow control parameter on an Ethernet device */
-
-typedef int (*reta_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Update RSS redirection table on an Ethernet device */
-
-typedef int (*reta_query_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Query RSS redirection table on an Ethernet device */
-
-typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Update RSS hash configuration of an Ethernet device */
-
-typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Get current RSS hash configuration of an Ethernet device */
-
-typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
-/**< @internal Turn on SW controllable LED on an Ethernet device */
-
-typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
-/**< @internal Turn off SW controllable LED on an Ethernet device */
-
-typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
-/**< @internal Remove MAC address from receive address register */
-
-typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint32_t index,
- uint32_t vmdq);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint8_t on);
-/**< @internal Set a Unicast Hash bitmap */
-
-typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
- uint8_t on);
-/**< @internal Set all Unicast Hash bitmap */
-
-typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
- uint16_t queue_idx,
- uint16_t tx_rate);
-/**< @internal Set queue TX rate */
-
-typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
-/**< @internal Add a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
- uint8_t rule_id);
-/**< @internal Remove a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Add tunneling UDP port */
-
-typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Delete tunneling UDP port */
-
-typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-/**< @internal set the list of multicast addresses on an Ethernet device */
-
-typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
- struct timespec *timestamp,
- uint32_t flags);
-/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
-
-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_t)(struct rte_eth_dev *dev,
- struct rte_dev_reg_info *info);
-/**< @internal Retrieve registers */
-
-typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
-/**< @internal Retrieve eeprom size */
-
-typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Retrieve eeprom data */
-
-typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Program eeprom data */
-
-typedef int (*eth_l2_tunnel_eth_type_conf_t)
- (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
-/**< @internal config l2 tunnel ether type */
-
-typedef int (*eth_l2_tunnel_offload_set_t)
- (struct rte_eth_dev *dev,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**< @internal enable/disable the l2 tunnel offload functions */
-
-
-typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
- enum rte_filter_type filter_type,
- enum rte_filter_op filter_op,
- void *arg);
-/**< @internal Take operations to assigned filter type on an Ethernet device */
-
-typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
-
-typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Trafffic Metering and Policing (MTR) operations */
-
-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.
- */
-struct eth_dev_ops {
- eth_dev_configure_t dev_configure; /**< Configure device. */
- eth_dev_start_t dev_start; /**< Start device. */
- eth_dev_stop_t dev_stop; /**< Stop device. */
- eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
- eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
- eth_dev_close_t dev_close; /**< Close device. */
- eth_dev_reset_t dev_reset; /**< Reset device. */
- eth_link_update_t link_update; /**< Get device link state. */
-
- eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
- eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
- eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
- eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
- eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
- eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
- eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
- eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
- mtu_set_t mtu_set; /**< Set MTU. */
-
- eth_stats_get_t stats_get; /**< Get generic device statistics. */
- eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
- eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
- eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
- eth_xstats_get_names_t xstats_get_names;
- /**< Get names of extended statistics. */
- eth_queue_stats_mapping_set_t queue_stats_mapping_set;
- /**< Configure per queue stat counter mapping. */
-
- eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
- eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
- eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
- eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
- eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
- /**< Get packet types supported and identified by device. */
-
- vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
- vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
- vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
- vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
- vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
-
- eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
- eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
- eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
- eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
- eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
- eth_queue_release_t rx_queue_release; /**< Release RX queue. */
- eth_rx_queue_count_t rx_queue_count;
- /**< Get the number of used RX descriptors. */
- eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
- eth_rx_descriptor_status_t rx_descriptor_status;
- /**< Check the status of a Rx descriptor. */
- eth_tx_descriptor_status_t tx_descriptor_status;
- /**< Check the status of a Tx descriptor. */
- eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
- eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
- eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
- eth_queue_release_t tx_queue_release; /**< Release TX queue. */
- eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
-
- eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
- eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
-
- flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
- flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
- priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
-
- eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
- eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
-
- eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
- eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
-
- eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
- eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
- eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
- /** Config ether type of l2 tunnel. */
- eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
- /** Enable/disable l2 tunnel offload functions. */
-
- eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
-
- rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
- rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
- reta_update_t reta_update; /** Update redirection table. */
- reta_query_t reta_query; /** Query redirection table. */
-
- eth_get_reg_t get_reg; /**< Get registers. */
- eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
- eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
- eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
-
-
- eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
-
- eth_get_dcb_info get_dcb_info; /** Get DCB information. */
-
- eth_timesync_enable_t timesync_enable;
- /** Turn IEEE1588/802.1AS timestamping on. */
- eth_timesync_disable_t timesync_disable;
- /** Turn IEEE1588/802.1AS timestamping off. */
- eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
- /** Read the IEEE1588/802.1AS RX timestamp. */
- eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
- /** Read the IEEE1588/802.1AS TX timestamp. */
- eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
- eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
- eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
-
- eth_xstats_get_by_id_t xstats_get_by_id;
- /**< Get extended device statistic values by ID. */
- eth_xstats_get_names_by_id_t xstats_get_names_by_id;
- /**< Get name of extended device statistics by ID. */
-
- eth_tm_ops_get_t tm_ops_get;
- /**< Get Traffic Management (TM) operations. */
-
- eth_mtr_ops_get_t mtr_ops_get;
- /**< Get Traffic Metering and Policing (MTR) operations. */
-
- eth_pool_ops_supported_t pool_ops_supported;
- /**< Test if a port supports specific mempool ops */
-};
-
/**
* Function type used for RX packet processing packet callbacks.
*
@@ -1661,20 +1189,6 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
-/**
- * @internal
- * Structure used to hold information about the callbacks to be called for a
- * queue on RX and TX.
- */
-struct rte_eth_rxtx_callback {
- struct rte_eth_rxtx_callback *next;
- union{
- rte_rx_callback_fn rx;
- rte_tx_callback_fn tx;
- } fn;
- void *param;
-};
-
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1684,40 +1198,6 @@ enum rte_eth_dev_state {
RTE_ETH_DEV_DEFERRED,
};
-/**
- * @internal
- * The generic data structure associated with each ethernet device.
- *
- * Pointers to burst-oriented packet receive and transmit functions are
- * located at the beginning of the structure, along with the pointer to
- * where all the data elements for the particular device are stored in shared
- * memory. This split allows the function pointer and driver data to be per-
- * process, while the actual configuration data for the device is shared.
- */
-struct rte_eth_dev {
- eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
- eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
- eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
- struct rte_eth_dev_data *data; /**< Pointer to device data */
- const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
- struct rte_device *device; /**< Backing device */
- struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
- /** User application callbacks for NIC interrupts */
- struct rte_eth_dev_cb_list link_intr_cbs;
- /**
- * User-supplied functions called from rx_burst to post-process
- * received packets before passing them to the user
- */
- struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- /**
- * User-supplied functions called from tx_burst to pre-process
- * received packets before passing them to the driver for transmission.
- */
- struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- enum rte_eth_dev_state state; /**< Flag indicating the port state */
- void *security_ctx; /**< Context for security ops */
-} __rte_cache_aligned;
-
void *
rte_eth_dev_get_sec_ctx(uint16_t port_id);
@@ -1731,57 +1211,7 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-/**
- * @internal
- * The data part, with no function pointers, associated with each ethernet device.
- *
- * This structure is safe to place in shared memory to be common among different
- * processes in a multi-process configuration.
- */
-struct rte_eth_dev_data {
- char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
-
- void **rx_queues; /**< Array of pointers to RX queues. */
- void **tx_queues; /**< Array of pointers to TX queues. */
- uint16_t nb_rx_queues; /**< Number of RX queues. */
- uint16_t nb_tx_queues; /**< Number of TX queues. */
-
- struct rte_eth_dev_sriov sriov; /**< SRIOV data */
-
- void *dev_private; /**< PMD-specific private data */
-
- struct rte_eth_link dev_link;
- /**< Link-level information & status */
-
- struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
- uint16_t mtu; /**< Maximum Transmission Unit. */
-
- uint32_t min_rx_buf_size;
- /**< Common rx buffer size handled by all queues */
-
- uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
- struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
- uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
- /** bitmap array of associating Ethernet MAC addresses to pools */
- struct ether_addr* hash_mac_addrs;
- /** Device Ethernet MAC addresses of hash filtering. */
- uint16_t port_id; /**< Device [external] port identifier. */
- __extension__
- uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
- scattered_rx : 1, /**< RX of scattered packets 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). */
- lro : 1; /**< RX LRO is ON(1) / OFF(0) */
- uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint32_t dev_flags; /**< Capabilities */
- enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
- int numa_node; /**< NUMA node connection */
- struct rte_vlan_filter_conf vlan_filter_conf;
- /**< VLAN filter configuration. */
-};
+#include <rte_ethdev_core.h>
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
@@ -1790,13 +1220,6 @@ struct rte_eth_dev_data {
/** Device supports device removal interrupt */
#define RTE_ETH_DEV_INTR_RMV 0x0008
-/**
- * @internal
- * The pool of *rte_eth_dev* structures. The size of the pool
- * is configured at compile-time in the <rte_ethdev.c> file.
- */
-extern struct rte_eth_dev rte_eth_devices[];
-
/**
* Iterates over valid ethdev ports.
*
diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h
new file mode 100644
index 000000000..79610c368
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_core.h
@@ -0,0 +1,619 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2017 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTE_ETHDEV_COMMON_H_
+#define _RTE_ETHDEV_COMMON_H_
+/*
+ * Definitions of all functions exported by an Ethernet driver through the
+ * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
+ * structure associated with an Ethernet device.
+ */
+
+struct rte_eth_dev;
+
+typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
+/**< @internal Ethernet device configuration. */
+
+typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to start a configured Ethernet device. */
+
+typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to stop a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link up a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link down a configured Ethernet device. */
+
+typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to close a configured Ethernet device. */
+
+typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
+/** <@internal Function used to reset a configured Ethernet device. */
+
+typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
+
+typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
+
+typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
+ int wait_to_complete);
+/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
+
+typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_stats *igb_stats);
+/**< @internal Get global I/O statistics of an Ethernet device. */
+
+typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
+
+typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat *stats, unsigned n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
+ const uint64_t *ids,
+ uint64_t *values,
+ unsigned int n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, unsigned size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+ unsigned int size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id,
+ uint8_t stat_idx,
+ uint8_t is_rx);
+/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
+
+typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_dev_info *dev_info);
+/**< @internal Get specific informations of an Ethernet device. */
+
+typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
+/**< @internal Get supported ptypes of an Ethernet device. */
+
+typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Start rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Stop rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ uint16_t nb_rx_desc,
+ unsigned int socket_id,
+ const struct rte_eth_rxconf *rx_conf,
+ struct rte_mempool *mb_pool);
+/**< @internal Set up a receive queue of an Ethernet device. */
+
+typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t tx_queue_id,
+ uint16_t nb_tx_desc,
+ unsigned int socket_id,
+ 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. */
+
+typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id);
+/**< @internal Get number of used descriptors on a receive queue. */
+
+typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
+/**< @internal Check DD bit of specific RX descriptor */
+
+typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
+/**< @internal Check the status of a Rx descriptor */
+
+typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
+/**< @internal Check the status of a Tx descriptor */
+
+typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size);
+/**< @internal Get firmware information of an Ethernet device. */
+
+typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
+/**< @internal Force mbufs to be from TX ring. */
+
+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. */
+
+typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
+
+typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
+ enum rte_vlan_type type, uint16_t tpid);
+/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
+
+typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
+/**< @internal set VLAN offload function by an Ethernet device. */
+
+typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal set port based TX VLAN insertion by an Ethernet device. */
+
+typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ int on);
+/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
+
+typedef uint16_t (*eth_rx_burst_t)(void *rxq,
+ struct rte_mbuf **rx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_burst_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Send output packets on a transmit queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_prep_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Prepare output packets on a transmit queue of 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 */
+
+typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_fc_conf *fc_conf);
+/**< @internal Setup flow control parameter on an Ethernet device */
+
+typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_pfc_conf *pfc_conf);
+/**< @internal Setup priority flow control parameter on an Ethernet device */
+
+typedef int (*reta_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Update RSS redirection table on an Ethernet device */
+
+typedef int (*reta_query_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Query RSS redirection table on an Ethernet device */
+
+typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Update RSS hash configuration of an Ethernet device */
+
+typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Get current RSS hash configuration of an Ethernet device */
+
+typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
+/**< @internal Turn on SW controllable LED on an Ethernet device */
+
+typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
+/**< @internal Turn off SW controllable LED on an Ethernet device */
+
+typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
+/**< @internal Remove MAC address from receive address register */
+
+typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint32_t index,
+ uint32_t vmdq);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint8_t on);
+/**< @internal Set a Unicast Hash bitmap */
+
+typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
+ uint8_t on);
+/**< @internal Set all Unicast Hash bitmap */
+
+typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
+ uint16_t queue_idx,
+ uint16_t tx_rate);
+/**< @internal Set queue TX rate */
+
+typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
+/**< @internal Add a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
+ uint8_t rule_id);
+/**< @internal Remove a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Add tunneling UDP port */
+
+typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Delete tunneling UDP port */
+
+typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
+/**< @internal set the list of multicast addresses on an Ethernet device */
+
+typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
+ struct timespec *timestamp,
+ uint32_t flags);
+/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
+
+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_t)(struct rte_eth_dev *dev,
+ struct rte_dev_reg_info *info);
+/**< @internal Retrieve registers */
+
+typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
+/**< @internal Retrieve eeprom size */
+
+typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Retrieve eeprom data */
+
+typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Program eeprom data */
+
+typedef int (*eth_l2_tunnel_eth_type_conf_t)
+ (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
+/**< @internal config l2 tunnel ether type */
+
+typedef int (*eth_l2_tunnel_offload_set_t)
+ (struct rte_eth_dev *dev,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
+/**< @internal enable/disable the l2 tunnel offload functions */
+
+
+typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
+ enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op,
+ void *arg);
+/**< @internal Take operations to assigned filter type on an Ethernet device */
+
+typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
+
+typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Trafffic Metering and Policing (MTR) operations */
+
+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.
+ */
+struct eth_dev_ops {
+ eth_dev_configure_t dev_configure; /**< Configure device. */
+ eth_dev_start_t dev_start; /**< Start device. */
+ eth_dev_stop_t dev_stop; /**< Stop device. */
+ eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
+ eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
+ eth_dev_close_t dev_close; /**< Close device. */
+ eth_dev_reset_t dev_reset; /**< Reset device. */
+ eth_link_update_t link_update; /**< Get device link state. */
+
+ eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
+ eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
+ eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
+ eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
+ eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
+ eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
+ eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
+ eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
+ mtu_set_t mtu_set; /**< Set MTU. */
+
+ eth_stats_get_t stats_get; /**< Get generic device statistics. */
+ eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
+ eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
+ eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
+ eth_xstats_get_names_t xstats_get_names;
+ /**< Get names of extended statistics. */
+ eth_queue_stats_mapping_set_t queue_stats_mapping_set;
+ /**< Configure per queue stat counter mapping. */
+
+ eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
+ eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
+ eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
+ eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
+ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
+ /**< Get packet types supported and identified by device. */
+
+ vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
+ vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
+ vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
+ vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
+ vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
+
+ eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
+ eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
+ eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
+ eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
+ eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
+ eth_queue_release_t rx_queue_release; /**< Release RX queue. */
+ eth_rx_queue_count_t rx_queue_count;
+ /**< Get the number of used RX descriptors. */
+ eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
+ eth_rx_descriptor_status_t rx_descriptor_status;
+ /**< Check the status of a Rx descriptor. */
+ eth_tx_descriptor_status_t tx_descriptor_status;
+ /**< Check the status of a Tx descriptor. */
+ eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
+ eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
+ eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
+ eth_queue_release_t tx_queue_release; /**< Release TX queue. */
+ eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
+
+ eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
+ eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
+
+ flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
+ flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
+ priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
+
+ eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
+ eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
+
+ eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
+ eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
+
+ eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
+ eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
+ eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
+ /** Config ether type of l2 tunnel. */
+ eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
+ /** Enable/disable l2 tunnel offload functions. */
+
+ eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
+
+ rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
+ rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
+ reta_update_t reta_update; /** Update redirection table. */
+ reta_query_t reta_query; /** Query redirection table. */
+
+ eth_get_reg_t get_reg; /**< Get registers. */
+ eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
+ eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
+ eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
+
+
+ eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
+
+ eth_get_dcb_info get_dcb_info; /** Get DCB information. */
+
+ eth_timesync_enable_t timesync_enable;
+ /** Turn IEEE1588/802.1AS timestamping on. */
+ eth_timesync_disable_t timesync_disable;
+ /** Turn IEEE1588/802.1AS timestamping off. */
+ eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
+ /** Read the IEEE1588/802.1AS RX timestamp. */
+ eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
+ /** Read the IEEE1588/802.1AS TX timestamp. */
+ eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
+ eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
+ eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
+
+ eth_xstats_get_by_id_t xstats_get_by_id;
+ /**< Get extended device statistic values by ID. */
+ eth_xstats_get_names_by_id_t xstats_get_names_by_id;
+ /**< Get name of extended device statistics by ID. */
+
+ eth_tm_ops_get_t tm_ops_get;
+ /**< Get Traffic Management (TM) operations. */
+
+ eth_mtr_ops_get_t mtr_ops_get;
+ /**< Get Traffic Metering and Policing (MTR) operations. */
+
+ eth_pool_ops_supported_t pool_ops_supported;
+ /**< Test if a port supports specific mempool ops */
+};
+
+/**
+ * @internal
+ * Structure used to hold information about the callbacks to be called for a
+ * queue on RX and TX.
+ */
+struct rte_eth_rxtx_callback {
+ struct rte_eth_rxtx_callback *next;
+ union{
+ rte_rx_callback_fn rx;
+ rte_tx_callback_fn tx;
+ } fn;
+ void *param;
+};
+
+/**
+ * @internal
+ * The generic data structure associated with each ethernet device.
+ *
+ * Pointers to burst-oriented packet receive and transmit functions are
+ * located at the beginning of the structure, along with the pointer to
+ * where all the data elements for the particular device are stored in shared
+ * memory. This split allows the function pointer and driver data to be per-
+ * process, while the actual configuration data for the device is shared.
+ */
+struct rte_eth_dev {
+ eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
+ eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
+ eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
+ struct rte_eth_dev_data *data; /**< Pointer to device data */
+ const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
+ struct rte_device *device; /**< Backing device */
+ struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
+ /** User application callbacks for NIC interrupts */
+ struct rte_eth_dev_cb_list link_intr_cbs;
+ /**
+ * User-supplied functions called from rx_burst to post-process
+ * received packets before passing them to the user
+ */
+ struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ /**
+ * User-supplied functions called from tx_burst to pre-process
+ * received packets before passing them to the driver for transmission.
+ */
+ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ enum rte_eth_dev_state state; /**< Flag indicating the port state */
+ void *security_ctx; /**< Context for security ops */
+} __rte_cache_aligned;
+
+struct rte_eth_dev_sriov;
+
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each ethernet device.
+ *
+ * This structure is safe to place in shared memory to be common among different
+ * processes in a multi-process configuration.
+ */
+struct rte_eth_dev_data {
+ char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
+
+ void **rx_queues; /**< Array of pointers to RX queues. */
+ void **tx_queues; /**< Array of pointers to TX queues. */
+ uint16_t nb_rx_queues; /**< Number of RX queues. */
+ uint16_t nb_tx_queues; /**< Number of TX queues. */
+
+ struct rte_eth_dev_sriov sriov; /**< SRIOV data */
+
+ void *dev_private; /**< PMD-specific private data */
+
+ struct rte_eth_link dev_link;
+ /**< Link-level information & status */
+
+ struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
+ uint16_t mtu; /**< Maximum Transmission Unit. */
+
+ uint32_t min_rx_buf_size;
+ /**< Common rx buffer size handled by all queues */
+
+ uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
+ struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
+ uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
+ /** bitmap array of associating Ethernet MAC addresses to pools */
+ struct ether_addr* hash_mac_addrs;
+ /** Device Ethernet MAC addresses of hash filtering. */
+ uint16_t port_id; /**< Device [external] port identifier. */
+ __extension__
+ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
+ scattered_rx : 1, /**< RX of scattered packets 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). */
+ lro : 1; /**< RX LRO is ON(1) / OFF(0) */
+ uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint32_t dev_flags; /**< Capabilities */
+ enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
+ int numa_node; /**< NUMA node connection */
+ struct rte_vlan_filter_conf vlan_filter_conf;
+ /**< VLAN filter configuration. */
+};
+
+/**
+ * @internal
+ * The pool of *rte_eth_dev* structures. The size of the pool
+ * is configured at compile-time in the <rte_ethdev.c> file.
+ */
+extern struct rte_eth_dev rte_eth_devices[];
+
+#endif /* _RTE_ETHDEV_COMMON_H_ */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v2 4/6] ethdev: reorder inline functions
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 2/6] ethdev: separate driver APIs Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 3/6] ethdev: separate internal structures into own header Ferruh Yigit
@ 2018-01-09 16:23 ` Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 5/6] ethdev: rename function parameter for consistency Ferruh Yigit
` (2 subsequent siblings)
5 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-09 16:23 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
Move all inline function to the end of the ethdev.h header file and move
the ethdev_core.h just before inline functions.
Since inline functions need data structures in ethdev_core.h, this
reorder is to group them and make it clear where put further inline
functions.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 2688 +++++++++++++++++++++--------------------
1 file changed, 1345 insertions(+), 1343 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 7cf177fb2..fc7ce29bf 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1189,6 +1189,8 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
+struct rte_eth_rxtx_callback;
+
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1211,8 +1213,6 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-#include <rte_ethdev_core.h>
-
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
/** Device is a bonded slave */
@@ -2131,1768 +2131,1770 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id);
*/
int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
+typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
+ void *userdata);
+
/**
+ * Structure used to buffer packets for future TX
+ * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ */
+struct rte_eth_dev_tx_buffer {
+ buffer_tx_error_fn error_callback;
+ void *error_userdata;
+ uint16_t size; /**< Size of buffer for buffered tx */
+ uint16_t length; /**< Number of packets in the array */
+ struct rte_mbuf *pkts[];
+ /**< Pending packets to be sent on explicit flush or when full */
+};
+
+/**
+ * Calculate the size of the tx buffer.
*
- * Retrieve a burst of input packets from a receive queue of an Ethernet
- * device. The retrieved packets are stored in *rte_mbuf* structures whose
- * pointers are supplied in the *rx_pkts* array.
- *
- * The rte_eth_rx_burst() function loops, parsing the RX ring of the
- * receive queue, up to *nb_pkts* packets, and for each completed RX
- * descriptor in the ring, it performs the following operations:
+ * @param sz
+ * Number of stored packets.
+ */
+#define RTE_ETH_TX_BUFFER_SIZE(sz) \
+ (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+
+/**
+ * Initialize default values for buffered transmitting
*
- * - Initialize the *rte_mbuf* data structure associated with the
- * RX descriptor according to the information provided by the NIC into
- * that RX descriptor.
+ * @param buffer
+ * Tx buffer to be initialized.
+ * @param size
+ * Buffer size
+ * @return
+ * 0 if no error
+ */
+int
+rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+
+/**
+ * Configure a callback for buffered packets which cannot be sent
*
- * - Store the *rte_mbuf* data structure into the next entry of the
- * *rx_pkts* array.
+ * Register a specific callback to be called when an attempt is made to send
+ * all packets buffered on an ethernet port, but not all packets can
+ * successfully be sent. The callback registered here will be called only
+ * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
+ * The default callback configured for each queue by default just frees the
+ * packets back to the calling mempool. If additional behaviour is required,
+ * for example, to count dropped packets, or to retry transmission of packets
+ * which cannot be sent, this function should be used to register a suitable
+ * callback function to implement the desired behaviour.
+ * The example callback "rte_eth_count_unsent_packet_callback()" is also
+ * provided as reference.
*
- * - Replenish the RX descriptor with a new *rte_mbuf* buffer
- * allocated from the memory pool associated with the receive queue at
- * initialization time.
+ * @param buffer
+ * The port identifier of the Ethernet device.
+ * @param callback
+ * The function to be used as the callback.
+ * @param userdata
+ * Arbitrary parameter to be passed to the callback function
+ * @return
+ * 0 on success, or -1 on error with rte_errno set appropriately
+ */
+int
+rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
+ buffer_tx_error_fn callback, void *userdata);
+
+/**
+ * Callback function for silently dropping unsent buffered packets.
*
- * When retrieving an input packet that was scattered by the controller
- * into multiple receive descriptors, the rte_eth_rx_burst() function
- * appends the associated *rte_mbuf* buffers to the first buffer of the
- * packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets silently and is used by tx buffered
+ * operations as default behavior.
*
- * The rte_eth_rx_burst() function returns the number of packets
- * actually retrieved, which is the number of *rte_mbuf* data structures
- * effectively supplied into the *rx_pkts* array.
- * A return value equal to *nb_pkts* indicates that the RX queue contained
- * at least *rx_pkts* packets, and this is likely to signify that other
- * received packets remain in the input queue. Applications implementing
- * a "retrieve as much received packets as possible" policy can check this
- * specific case and keep invoking the rte_eth_rx_burst() function until
- * a value less than *nb_pkts* is returned.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * This receive method has the following advantages:
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * - It allows a run-to-completion network stack engine to retrieve and
- * to immediately process received packets in a fast burst-oriented
- * approach, avoiding the overhead of unnecessary intermediate packet
- * queue/dequeue operations.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Not used
+ */
+void
+rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Callback function for tracking unsent buffered packets.
*
- * - Conversely, it also allows an asynchronous-oriented processing
- * method to retrieve bursts of received packets and to immediately
- * queue them for further parallel processing by another logical core,
- * for instance. However, instead of having received packets being
- * individually queued by the driver, this approach allows the caller
- * of the rte_eth_rx_burst() function to queue a burst of retrieved
- * packets at a time and therefore dramatically reduce the cost of
- * enqueue/dequeue operations per packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets, but also updates a user-supplied counter
+ * to track the overall number of packets dropped. The counter should be an
+ * uint64_t variable.
*
- * - It allows the rte_eth_rx_burst() function of the driver to take
- * advantage of burst-oriented hardware features (CPU cache,
- * prefetch instructions, and so on) to minimize the number of CPU
- * cycles per packet.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * To summarize, the proposed receive API enables many
- * burst-oriented optimizations in both synchronous and asynchronous
- * packet processing environments with no overhead in both cases.
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * The rte_eth_rx_burst() function does not provide any error
- * notification to avoid the corresponding overhead. As a hint, the
- * upper-level application might check the status of the device link once
- * being systematically returned a 0 value for a given number of tries.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Pointer to an uint64_t value, which will be incremented by unsent
+ */
+void
+rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Request the driver to free mbufs currently cached by the driver. The
+ * driver will only free the mbuf if it is no longer in use. It is the
+ * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
+ * called if needed.
*
* @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
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
* to rte_eth_dev_configure().
- * @param rx_pkts
- * The address of an array of pointers to *rte_mbuf* structures that
- * must be large enough to store *nb_pkts* pointers in it.
- * @param nb_pkts
- * The maximum number of packets to retrieve.
+ * @param free_cnt
+ * Maximum number of packets to free. Use 0 to indicate all possible packets
+ * should be freed. Note that a packet may be using multiple mbufs.
* @return
- * The number of packets actually retrieved, which is the number
- * of pointers to *rte_mbuf* structures effectively supplied to the
- * *rx_pkts* array.
+ * Failure: < 0
+ * -ENODEV: Invalid interface
+ * -ENOTSUP: Driver does not support function
+ * Success: >= 0
+ * 0-n: Number of packets freed. More packets may still remain in ring that
+ * are in use.
*/
-static inline uint16_t
-rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+int
+rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
- if (queue_id >= dev->data->nb_rx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
- int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
- rx_pkts, nb_pkts);
+/**
+ * The eth device event type for interrupt, and maybe others in the future.
+ */
+enum rte_eth_event_type {
+ RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
+ RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
+ RTE_ETH_EVENT_QUEUE_STATE,
+ /**< queue state event (enabled/disabled) */
+ RTE_ETH_EVENT_INTR_RESET,
+ /**< reset interrupt event, sent to VF on PF reset */
+ RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
+ RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
+ RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
+ RTE_ETH_EVENT_MAX /**< max value of this enum */
+};
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
+ enum rte_eth_event_type event, void *cb_arg, void *ret_param);
+/**< user application callback to be registered for interrupts */
- if (unlikely(cb != NULL)) {
- do {
- nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
- nb_pkts, cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
- return nb_rx;
-}
/**
- * Get the number of used descriptors of a rx queue
+ * Register a callback function for specific port id.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
+ * Port id.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback.
+ *
* @return
- * The number of used descriptors in the specific queue, or:
- * (-EINVAL) if *port_id* or *queue_id* is invalid
- * (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
- dev = &rte_eth_devices[port_id];
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
- if (queue_id >= dev->data->nb_rx_queues)
- return -EINVAL;
-
- return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
-}
+int rte_eth_dev_callback_register(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check if the DD bit of the specific RX descriptor in the queue has been set
+ * Unregister a callback function for specific port id.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
- * @param offset
- * The offset of the descriptor ID from tail.
+ * Port id.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback. -1 means to
+ * remove all for the same callback address and same event.
+ *
* @return
- * - (1) if the specific DD bit is set.
- * - (0) if the specific DD bit is not set.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
- return (*dev->dev_ops->rx_descriptor_done)( \
- dev->data->rx_queues[queue_id], offset);
-}
-
-#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
-#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
-#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_callback_unregister(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check the status of a Rx descriptor in the queue
- *
- * It should be called in a similar context than the Rx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * 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 packet arrives.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_enable() function enables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Rx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the next
- * packet to be received by the driver).
- *
+ * 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
- * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
- * receive a packet.
- * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
- * not yet processed by the driver (i.e. in the receive queue).
- * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
- * the driver and not yet returned to hw, or reserved by the hw.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-static inline int
-rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
- uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *rxq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_rx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
- rxq = dev->data->rx_queues[queue_id];
-
- return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
-}
-
-#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
-#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
-#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
/**
- * Check the status of a Tx descriptor in the queue.
- *
- * It should be called in a similar context than the Tx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * When lcore wakes up from rx interrupt indicating packet coming, disable rx
+ * interrupt and returns to polling mode.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_disable() function disables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Tx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the place where
- * the next packet will be send).
- *
+ * 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
- * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
- * in the transmit queue.
- * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
- * be reused by the driver.
- * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
- * driver or the hardware.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
- uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *txq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
- txq = dev->data->tx_queues[queue_id];
-
- return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
-}
+int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
/**
- * Send a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_burst() function is invoked to transmit output packets
- * on the output queue *queue_id* of the Ethernet device designated by its
- * *port_id*.
- * The *nb_pkts* parameter is the number of packets to send which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
- * up to the number of transmit descriptors available in the TX ring of the
- * transmit queue.
- * For each packet to send, the rte_eth_tx_burst() function performs
- * the following operations:
- *
- * - Pick up the next available descriptor in the transmit ring.
- *
- * - Free the network buffer previously sent with that descriptor, if any.
- *
- * - Initialize the transmit descriptor with the information provided
- * in the *rte_mbuf data structure.
- *
- * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
- * the rte_eth_tx_burst() function uses several transmit descriptors
- * of the ring.
- *
- * The rte_eth_tx_burst() function returns the number of packets it
- * actually sent. A return value equal to *nb_pkts* means that all packets
- * have been sent, and this is likely to signify that other output packets
- * could be immediately transmitted again. Applications that implement a
- * "send as many packets to transmit as possible" policy can check this
- * specific case and keep invoking the rte_eth_tx_burst() function until
- * a value less than *nb_pkts* is returned.
- *
- * It is the responsibility of the rte_eth_tx_burst() function to
- * transparently free the memory buffers of packets previously sent.
- * This feature is driven by the *tx_free_thresh* value supplied to the
- * rte_eth_dev_configure() function at device configuration time.
- * When the number of free TX descriptors drops below this threshold, the
- * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
- * of those packets whose transmission was effectively completed.
+ * RX Interrupt control per port.
*
- * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
- * invoke this function concurrently on the same tx queue without SW lock.
- * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
+ * @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(uint16_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 transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * 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 tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to transmit.
+ * @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
- * The number of output packets actually stored in transmit descriptors of
- * the transmit ring. The return value can be less than the value of the
- * *tx_pkts* parameter when the transmit ring is full or has been filled up.
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline uint16_t
-rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
-
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
-
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
-
- if (unlikely(cb != NULL)) {
- do {
- nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
- cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
-
- return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
-}
+int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
+ int epfd, int op, void *data);
/**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
- * Process a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
- * transmitted on the output queue *queue_id* of the Ethernet device designated
- * by its *port_id*.
- * The *nb_pkts* parameter is the number of packets to be prepared which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * For each packet to send, the rte_eth_tx_prepare() function performs
- * the following operations:
- *
- * - Check if packet meets devices requirements for tx offloads.
- *
- * - Check limitations about number of segments.
- *
- * - Check additional requirements when debug is enabled.
- *
- * - Update and/or reset required checksums when tx offload is set for packet.
- *
- * Since this function can modify packet data, provided mbufs must be safely
- * writable (e.g. modified data cannot be in shared segment).
- *
- * The rte_eth_tx_prepare() function returns the number of packets ready to be
- * sent. A return value equal to *nb_pkts* means that all packets are valid and
- * ready to be sent, otherwise stops processing on the first invalid packet and
- * leaves the rest packets untouched.
- *
- * When this functionality is not implemented in the driver, all packets are
- * are returned untouched.
+ * Turn on the LED on the Ethernet device.
+ * This function turns on the LED on the Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * The value must be a valid port id.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to process.
* @return
- * The number of packets correct and ready to be sent. The return value can be
- * less than the value of the *tx_pkts* parameter when some packet doesn't
- * meet devices requirements with rte_errno set appropriately:
- * - -EINVAL: offload flags are not correctly set
- * - -ENOTSUP: the offload feature is not supported by the hardware
- *
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
+int rte_eth_led_on(uint16_t port_id);
-#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
-
-static inline uint16_t
-rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (!rte_eth_dev_is_valid_port(port_id)) {
- RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- if (!dev->tx_pkt_prepare)
- return nb_pkts;
-
- return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
- tx_pkts, nb_pkts);
-}
-
-#else
-
-/*
- * Native NOOP operation for compilation targets which doesn't require any
- * preparations steps, and functional NOOP may introduce unnecessary performance
- * drop.
+/**
+ * Turn off the LED on the Ethernet device.
+ * This function turns off the LED on the Ethernet device.
*
- * Generally this is not a good idea to turn it on globally and didn't should
- * be used if behavior of tx_preparation can change.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-
-static inline uint16_t
-rte_eth_tx_prepare(__rte_unused uint16_t port_id,
- __rte_unused uint16_t queue_id,
- __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- return nb_pkts;
-}
-
-#endif
-
-typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
- void *userdata);
+int rte_eth_led_off(uint16_t port_id);
/**
- * Structure used to buffer packets for future TX
- * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ * Get current status of the Ethernet link flow control for Ethernet device
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure where to store the flow control parameters.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control.
+ * - (-ENODEV) if *port_id* invalid.
*/
-struct rte_eth_dev_tx_buffer {
- buffer_tx_error_fn error_callback;
- void *error_userdata;
- uint16_t size; /**< Size of buffer for buffered tx */
- uint16_t length; /**< Number of packets in the array */
- struct rte_mbuf *pkts[];
- /**< Pending packets to be sent on explicit flush or when full */
-};
+int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Calculate the size of the tx buffer.
+ * Configure the Ethernet link flow control for Ethernet device
*
- * @param sz
- * Number of stored packets.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure of the flow control parameters.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure
*/
-#define RTE_ETH_TX_BUFFER_SIZE(sz) \
- (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Initialize default values for buffered transmitting
+ * Configure the Ethernet priority flow control under DCB environment
+ * for Ethernet device.
*
- * @param buffer
- * Tx buffer to be initialized.
- * @param size
- * Buffer size
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param pfc_conf
+ * The pointer to the structure of the priority flow control parameters.
* @return
- * 0 if no error
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure
*/
-int
-rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_pfc_conf *pfc_conf);
/**
- * Send any packets queued up for transmission on a port and HW queue
- *
- * This causes an explicit flush of packets previously buffered via the
- * rte_eth_tx_buffer() function. It returns the number of packets successfully
- * sent to the NIC, and calls the error callback for any unsent packets. Unless
- * explicitly set up otherwise, the default callback simply frees the unsent
- * packets back to the owning mempool.
+ * Add a MAC address to an internal array of addresses used to enable whitelist
+ * filtering to accept packets only if the destination MAC address matches.
*
- * @param port_id
+ * @param port
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer of packets to be transmit.
+ * @param mac_addr
+ * The MAC address to add.
+ * @param pool
+ * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
+ * not enabled, this should be set to 0.
* @return
- * The number of packets successfully sent to the Ethernet device. The error
- * callback is called for any packets which could not be sent.
+ * - (0) if successfully added or *mac_addr" was already added.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port* is invalid.
+ * - (-ENOSPC) if no more MAC addresses can be added.
+ * - (-EINVAL) if MAC address is invalid.
*/
-static inline uint16_t
-rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer)
-{
- uint16_t sent;
- uint16_t to_send = buffer->length;
-
- if (to_send == 0)
- return 0;
-
- sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
-
- buffer->length = 0;
-
- /* All packets sent, or to be dealt with by callback below */
- if (unlikely(sent != to_send))
- buffer->error_callback(&buffer->pkts[sent], to_send - sent,
- buffer->error_userdata);
-
- return sent;
-}
+int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+ uint32_t pool);
/**
- * Buffer a single packet for future transmission on a port and queue
- *
- * This function takes a single mbuf/packet and buffers it for later
- * transmission on the particular port and queue specified. Once the buffer is
- * full of packets, an attempt will be made to transmit all the buffered
- * packets. In case of error, where not all packets can be transmitted, a
- * callback is called with the unsent packets as a parameter. If no callback
- * is explicitly set up, the unsent packets are just freed back to the owning
- * mempool. The function returns the number of packets actually sent i.e.
- * 0 if no buffer flush occurred, otherwise the number of packets successfully
- * flushed
+ * Remove a MAC address from the internal array of addresses.
*
- * @param port_id
+ * @param port
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer used to collect packets to be sent.
- * @param tx_pkt
- * Pointer to the packet mbuf to be sent.
+ * @param mac_addr
+ * MAC address to remove.
* @return
- * 0 = packet has been buffered for later transmission
- * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
- * causing N packets to be sent, and the error callback to be called for
- * the rest.
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-static __rte_always_inline uint16_t
-rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
-{
- buffer->pkts[buffer->length++] = tx_pkt;
- if (buffer->length < buffer->size)
- return 0;
-
- return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
-}
+int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
/**
- * Configure a callback for buffered packets which cannot be sent
- *
- * Register a specific callback to be called when an attempt is made to send
- * all packets buffered on an ethernet port, but not all packets can
- * successfully be sent. The callback registered here will be called only
- * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
- * The default callback configured for each queue by default just frees the
- * packets back to the calling mempool. If additional behaviour is required,
- * for example, to count dropped packets, or to retry transmission of packets
- * which cannot be sent, this function should be used to register a suitable
- * callback function to implement the desired behaviour.
- * The example callback "rte_eth_count_unsent_packet_callback()" is also
- * provided as reference.
+ * Set the default MAC address.
*
- * @param buffer
+ * @param port
* The port identifier of the Ethernet device.
- * @param callback
- * The function to be used as the callback.
- * @param userdata
- * Arbitrary parameter to be passed to the callback function
+ * @param mac_addr
+ * New default MAC address.
* @return
- * 0 on success, or -1 on error with rte_errno set appropriately
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EINVAL) if MAC address is invalid.
*/
-int
-rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
- buffer_tx_error_fn callback, void *userdata);
+int rte_eth_dev_default_mac_addr_set(uint16_t port,
+ struct ether_addr *mac_addr);
/**
- * Callback function for silently dropping unsent buffered packets.
+ * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets silently and is used by tx buffered
- * operations as default behavior.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to update.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_eth_dev_rss_reta_update(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+
+ /**
+ * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to query.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_eth_dev_rss_reta_query(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+
+ /**
+ * Updates unicast hash table for receiving packet with the given destination
+ * MAC address, and the packet is routed to all VFs for which the RX mode is
+ * accept packets that match the unicast hash table.
*
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param addr
+ * Unicast MAC address.
+ * @param on
+ * 1 - Set an unicast hash bit for receiving packets with the MAC address.
+ * 0 - Clear an unicast hash bit.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+ uint8_t on);
+
+ /**
+ * Updates all unicast hash bitmaps for receiving packet with any Unicast
+ * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
+ * mode is accept packets that match the unicast hash table.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Not used
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param on
+ * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
+ * MAC addresses
+ * 0 - Clear all unicast hash bitmaps
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-void
-rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
/**
- * Callback function for tracking unsent buffered packets.
- *
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets, but also updates a user-supplied counter
- * to track the overall number of packets dropped. The counter should be an
- * uint64_t variable.
- *
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
+ * Set a traffic mirroring rule on an Ethernet device
*
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param mirror_conf
+ * The pointer to the traffic mirroring structure describing the mirroring rule.
+ * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
+ * destination pool and the value of rule if enable vlan or pool mirroring.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Pointer to an uint64_t value, which will be incremented by unsent
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
+ * @param on
+ * 1 - Enable a mirroring rule.
+ * 0 - Disable a mirroring rule.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if the mr_conf information is not correct.
*/
-void
-rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_mirror_rule_set(uint16_t port_id,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
/**
- * Request the driver to free mbufs currently cached by the driver. The
- * driver will only free the mbuf if it is no longer in use. It is the
- * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
- * called if needed.
+ * Reset a traffic mirroring rule on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param free_cnt
- * Maximum number of packets to free. Use 0 to indicate all possible packets
- * should be freed. Note that a packet may be using multiple mbufs.
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
* @return
- * Failure: < 0
- * -ENODEV: Invalid interface
- * -ENOTSUP: Driver does not support function
- * Success: >= 0
- * 0-n: Number of packets freed. More packets may still remain in ring that
- * are in use.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int
-rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
+int rte_eth_mirror_rule_reset(uint16_t port_id,
+ uint8_t rule_id);
/**
- * The eth device event type for interrupt, and maybe others in the future.
- */
-enum rte_eth_event_type {
- RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
- RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
- RTE_ETH_EVENT_QUEUE_STATE,
- /**< queue state event (enabled/disabled) */
- RTE_ETH_EVENT_INTR_RESET,
- /**< reset interrupt event, sent to VF on PF reset */
- RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
- RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
- RTE_ETH_EVENT_INTR_RMV, /**< device removal event */
- RTE_ETH_EVENT_MAX /**< max value of this enum */
-};
-
-typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
- enum rte_eth_event_type event, void *cb_arg, void *ret_param);
-/**< user application callback to be registered for interrupts */
-
-
-
-/**
- * Register a callback function for specific port id.
- *
- * @param port_id
- * Port id.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback.
- *
- * @return
- * - On success, zero.
- * - On failure, a negative value.
- */
-int rte_eth_dev_callback_register(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
-
-/**
- * Unregister a callback function for specific port id.
+ * Set the rate limitation for a queue on an Ethernet device.
*
* @param port_id
- * Port id.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback. -1 means to
- * remove all for the same callback address and same event.
- *
+ * The port identifier of the Ethernet device.
+ * @param queue_idx
+ * The queue id.
+ * @param tx_rate
+ * The tx rate in Mbps. Allocated from the total port link speed.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_unregister(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
+ uint16_t tx_rate);
-/**
- * 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 packet arrives.
- *
- * The rte_eth_dev_rx_intr_enable() function enables rx queue
- * interrupt on specific rx queue of a port.
+ /**
+ * Configuration of Receive Side Scaling hash computation of Ethernet device.
*
* @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 rss_conf
+ * The new configuration to use for RSS hash computation on the port.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
+int rte_eth_dev_rss_hash_update(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * 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.
+ /**
+ * Retrieve current configuration of Receive Side Scaling hash computation
+ * of Ethernet device.
*
* @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 rss_conf
+ * Where to store the current RSS hash configuration of the Ethernet device.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support RSS.
*/
-int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
+int
+rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * RX Interrupt control per port.
+ /**
+ * Add UDP tunneling port for a specific type of tunnel.
+ * The packets with this UDP port will be identified as this type of tunnel.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to change or add more UDP port for the tunnel. So the offloading function
+ * can take effect on the packets with the specific UDP 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.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
+int
+rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
-/**
- * RX Interrupt control per queue.
+ /**
+ * Delete UDP tunneling port a specific type of tunnel.
+ * The packets with this UDP port will not be identified as this type of tunnel
+ * any more.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to delete a UDP port for the tunnel. So the offloading function will not take
+ * effect on the packets with the specific UDP 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().
- * @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.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
- int epfd, int op, void *data);
+int
+rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
/**
- * Turn on the LED on the Ethernet device.
- * This function turns on the LED on the Ethernet device.
+ * Check whether the filter type is supported on an Ethernet device.
+ * All the supported filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support this filter type.
* - (-ENODEV) if *port_id* invalid.
*/
-int rte_eth_led_on(uint16_t port_id);
+int rte_eth_dev_filter_supported(uint16_t port_id,
+ enum rte_filter_type filter_type);
/**
- * Turn off the LED on the Ethernet device.
- * This function turns off the LED on the Ethernet device.
+ * Take operations to assigned filter type on an Ethernet device.
+ * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
+ * @param filter_op
+ * Type of operation.
+ * @param arg
+ * A pointer to arguments defined specifically for the operation.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_led_off(uint16_t port_id);
+int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op, void *arg);
/**
- * Get current status of the Ethernet link flow control for Ethernet device
+ * Get DCB information on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure where to store the flow control parameters.
+ * @param dcb_info
+ * dcb information.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support.
*/
-int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+int rte_eth_dev_get_dcb_info(uint16_t port_id,
+ struct rte_eth_dcb_info *dcb_info);
/**
- * Configure the Ethernet link flow control for Ethernet device
+ * Add a callback to be called on packet RX on a given port and queue.
+ *
+ * This API configures a function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure of the flow control parameters.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Configure the Ethernet priority flow control under DCB environment
- * for Ethernet device.
+ * Add a callback that must be called first on packet RX on a given port
+ * and queue.
+ *
+ * This API configures a first function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param pfc_conf
- * The pointer to the structure of the priority flow control parameters.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_pfc_conf *pfc_conf);
+void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Add a MAC address to an internal array of addresses used to enable whitelist
- * filtering to accept packets only if the destination MAC address matches.
+ * Add a callback to be called on packet TX on a given port and queue.
*
- * @param port
+ * This API configures a function to be called for each burst of
+ * packets sent on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_tx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * The MAC address to add.
- * @param pool
- * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
- * not enabled, this should be set to 0.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successfully added or *mac_addr" was already added.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port* is invalid.
- * - (-ENOSPC) if no more MAC addresses can be added.
- * - (-EINVAL) if MAC address is invalid.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
- uint32_t pool);
+void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_tx_callback_fn fn, void *user_param);
/**
- * Remove a MAC address from the internal array of addresses.
+ * Remove an RX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_rx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * MAC address to remove.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_rx_callback().
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EADDRINUSE) if attempting to remove the default MAC address
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Set the default MAC address.
+ * Remove a TX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_tx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * New default MAC address.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_tx_callback().
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EINVAL) if MAC address is invalid.
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
- struct ether_addr *mac_addr);
+int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+ * Retrieve information about given port's RX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to update.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - 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_dev_rss_reta_update(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
- /**
- * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+/**
+ * Retrieve information about given port's TX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to query.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - 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_dev_rss_reta_query(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
- /**
- * Updates unicast hash table for receiving packet with the given destination
- * MAC address, and the packet is routed to all VFs for which the RX mode is
- * accept packets that match the unicast hash table.
+/**
+ * Retrieve device registers and register attributes (number of registers and
+ * register size)
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param addr
- * Unicast MAC address.
- * @param on
- * 1 - Set an unicast hash bit for receiving packets with the MAC address.
- * 0 - Clear an unicast hash bit.
+ * @param info
+ * Pointer to rte_dev_reg_info structure to fill in. If info->data is
+ * NULL the function fills in the width and length fields. If non-NULL
+ * the registers are put into the buffer pointed at by the data field.
* @return
* - (0) if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
- uint8_t on);
+int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
- /**
- * Updates all unicast hash bitmaps for receiving packet with any Unicast
- * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
- * mode is accept packets that match the unicast hash table.
+/**
+ * Retrieve size of device EEPROM
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param on
- * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
- * MAC addresses
- * 0 - Clear all unicast hash bitmaps
* @return
- * - (0) if successful.
+ * - (>=0) EEPROM size if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_get_eeprom_length(uint16_t port_id);
/**
- * Set a traffic mirroring rule on an Ethernet device
+ * Retrieve EEPROM and EEPROM attribute
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param mirror_conf
- * The pointer to the traffic mirroring structure describing the mirroring rule.
- * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
- * destination pool and the value of rule if enable vlan or pool mirroring.
- *
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
- * @param on
- * 1 - Enable a mirroring rule.
- * 0 - Disable a mirroring rule.
+ * @param info
+ * The template includes buffer for return EEPROM data and
+ * EEPROM attributes to be filled.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if the mr_conf information is not correct.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_set(uint16_t port_id,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
+int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
- * Reset a traffic mirroring rule on an Ethernet device.
+ * Program EEPROM with provided data
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
+ * @param info
+ * The template includes EEPROM data for programming and
+ * EEPROM attributes to be filled
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_reset(uint16_t port_id,
- uint8_t rule_id);
+int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
- * Set the rate limitation for a queue on an Ethernet device.
+ * Set the list of multicast addresses to filter on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_idx
- * The queue id.
- * @param tx_rate
- * The tx rate in Mbps. Allocated from the total port link speed.
+ * @param mc_addr_set
+ * The array of multicast addresses to set. Equal to NULL when the function
+ * is invoked to flush the set of filtered addresses.
+ * @param nb_mc_addr
+ * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
+ * when the function is invoked to flush the set of filtered addresses.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
+ * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
*/
-int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
- uint16_t tx_rate);
+int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
- /**
- * Configuration of Receive Side Scaling hash computation of Ethernet device.
+/**
+ * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * The new configuration to use for RSS hash computation on the port.
- * @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
- */
-int rte_eth_dev_rss_hash_update(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
-
- /**
- * Retrieve current configuration of Receive Side Scaling hash computation
- * of Ethernet device.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param rss_conf
- * Where to store the current RSS hash configuration of the Ethernet device.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support RSS.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_timesync_enable(uint16_t port_id);
- /**
- * Add UDP tunneling port for a specific type of tunnel.
- * The packets with this UDP port will be identified as this type of tunnel.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to change or add more UDP port for the tunnel. So the offloading function
- * can take effect on the packets with the specific UDP port.
+/**
+ * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_disable(uint16_t port_id);
- /**
- * Delete UDP tunneling port a specific type of tunnel.
- * The packets with this UDP port will not be identified as this type of tunnel
- * any more.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to delete a UDP port for the tunnel. So the offloading function will not take
- * effect on the packets with the specific UDP port.
+/**
+ * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ * @param flags
+ * Device specific flags. Used to pass the RX timesync register index to
+ * i40e. Unused in igb/ixgbe, pass 0 instead.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
+ struct timespec *timestamp, uint32_t flags);
/**
- * Check whether the filter type is supported on an Ethernet device.
- * All the supported filter types are defined in 'rte_eth_ctrl.h'.
+ * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param filter_type
- * Filter type.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this filter type.
- * - (-ENODEV) if *port_id* invalid.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_supported(uint16_t port_id,
- enum rte_filter_type filter_type);
+int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
+ struct timespec *timestamp);
/**
- * Take operations to assigned filter type on an Ethernet device.
- * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
+ * 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 filter_type
- * Filter type.
- * @param filter_op
- * Type of operation.
- * @param arg
- * A pointer to arguments defined specifically for the operation.
+ * @param delta
+ * The adjustment in nanoseconds.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
- enum rte_filter_op filter_op, void *arg);
+int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
/**
- * Get DCB information on an Ethernet device.
+ * 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 dcb_info
- * dcb information.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support.
+ * - 0: Success.
*/
-int rte_eth_dev_get_dcb_info(uint16_t port_id,
- struct rte_eth_dcb_info *dcb_info);
+int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
/**
- * Add a callback to be called on packet RX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
+ * Set the time of the timesync clock on an Ethernet device.
*
- * Multiple functions are called in the order that they are added.
+ * 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 queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
/**
- * Add a callback that must be called first on packet RX on a given port
- * and queue.
- *
- * This API configures a first function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Config l2 tunnel ether type of an Ethernet device for filtering specific
+ * tunnel packets by ether type.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param l2_tunnel
+ * l2 tunnel configuration.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int
+rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel);
/**
- * Add a callback to be called on packet TX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets sent on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_tx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Enable/disable l2 tunnel offload functions. Include,
+ * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
+ * Filtering, forwarding and offloading this type of tunnel packets depend on
+ * this ability.
+ * 2, Stripping the l2 tunnel tag.
+ * 3, Insertion of the l2 tunnel tag.
+ * 4, Forwarding the packets based on the l2 tunnel tag.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param l2_tunnel
+ * l2 tunnel parameters.
+ * @param mask
+ * Indicate the offload function.
+ * @param en
+ * Enable or disable this function.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
- rte_tx_callback_fn fn, void *user_param);
+int
+rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
/**
- * Remove an RX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_rx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
+* Get the port id from pci address or device name
+* Ex: 0000:2:00.0 or vdev name net_pcap0
+*
+* @param name
+* pci address or name of the device
+* @param port_id
+* pointer to port identifier of the device
+* @return
+* - (0) if successful and port_id is filled.
+* - (-ENODEV or -EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
+
+/**
+* Get the device name from port id
+*
+* @param port_id
+* pointer to port identifier of the device
+* @param name
+* pci address or name of the device
+* @return
+* - (0) if successful.
+* - (-EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+
+/**
+ * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
+ * the ethernet device information, otherwise adjust them to boundaries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_rx_callback().
+ * @param nb_rx_desc
+ * A pointer to a uint16_t where the number of receive
+ * descriptors stored.
+ * @param nb_tx_desc
+ * A pointer to a uint16_t where the number of transmit
+ * descriptors stored.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
+ */
+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: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
+ * - 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_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int
+rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
+
+#include <rte_ethdev_core.h>
/**
- * Remove a TX packet callback from a given port and queue.
*
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_tx_callback().
+ * Retrieve a burst of input packets from a receive queue of an Ethernet
+ * device. The retrieved packets are stored in *rte_mbuf* structures whose
+ * pointers are supplied in the *rx_pkts* array.
*
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
+ * The rte_eth_rx_burst() function loops, parsing the RX ring of the
+ * receive queue, up to *nb_pkts* packets, and for each completed RX
+ * descriptor in the ring, it performs the following operations:
*
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
+ * - Initialize the *rte_mbuf* data structure associated with the
+ * RX descriptor according to the information provided by the NIC into
+ * that RX descriptor.
*
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
+ * - Store the *rte_mbuf* data structure into the next entry of the
+ * *rx_pkts* array.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_tx_callback().
+ * - Replenish the RX descriptor with a new *rte_mbuf* buffer
+ * allocated from the memory pool associated with the receive queue at
+ * initialization time.
*
- * @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
- */
-int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
-
-/**
- * Retrieve information about given port's RX queue.
+ * When retrieving an input packet that was scattered by the controller
+ * into multiple receive descriptors, the rte_eth_rx_burst() function
+ * appends the associated *rte_mbuf* buffers to the first buffer of the
+ * packet.
+ *
+ * The rte_eth_rx_burst() function returns the number of packets
+ * actually retrieved, which is the number of *rte_mbuf* data structures
+ * effectively supplied into the *rx_pkts* array.
+ * A return value equal to *nb_pkts* indicates that the RX queue contained
+ * at least *rx_pkts* packets, and this is likely to signify that other
+ * received packets remain in the input queue. Applications implementing
+ * a "retrieve as much received packets as possible" policy can check this
+ * specific case and keep invoking the rte_eth_rx_burst() function until
+ * a value less than *nb_pkts* is returned.
+ *
+ * This receive method has the following advantages:
+ *
+ * - It allows a run-to-completion network stack engine to retrieve and
+ * to immediately process received packets in a fast burst-oriented
+ * approach, avoiding the overhead of unnecessary intermediate packet
+ * queue/dequeue operations.
+ *
+ * - Conversely, it also allows an asynchronous-oriented processing
+ * method to retrieve bursts of received packets and to immediately
+ * queue them for further parallel processing by another logical core,
+ * for instance. However, instead of having received packets being
+ * individually queued by the driver, this approach allows the caller
+ * of the rte_eth_rx_burst() function to queue a burst of retrieved
+ * packets at a time and therefore dramatically reduce the cost of
+ * enqueue/dequeue operations per packet.
+ *
+ * - It allows the rte_eth_rx_burst() function of the driver to take
+ * advantage of burst-oriented hardware features (CPU cache,
+ * prefetch instructions, and so on) to minimize the number of CPU
+ * cycles per packet.
+ *
+ * To summarize, the proposed receive API enables many
+ * burst-oriented optimizations in both synchronous and asynchronous
+ * packet processing environments with no overhead in both cases.
+ *
+ * The rte_eth_rx_burst() function does not provide any error
+ * notification to avoid the corresponding overhead. As a hint, the
+ * upper-level application might check the status of the device link once
+ * being systematically returned a 0 value for a given number of tries.
*
* @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.
- *
+ * 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 rx_pkts
+ * The address of an array of pointers to *rte_mbuf* structures that
+ * must be large enough to store *nb_pkts* pointers in it.
+ * @param nb_pkts
+ * The maximum number of packets to retrieve.
* @return
- * - 0: Success
- * - -ENOTSUP: routine is not supported by the device PMD.
- * - -EINVAL: The port_id or the queue_id is out of range.
+ * The number of packets actually retrieved, which is the number
+ * of pointers to *rte_mbuf* structures effectively supplied to the
+ * *rx_pkts* array.
*/
-int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxq_info *qinfo);
+static inline uint16_t
+rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_rx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+ int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
+ rx_pkts, nb_pkts);
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
+ nb_pkts, cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return nb_rx;
+}
/**
- * Retrieve information about given port's TX queue.
+ * Get the number of used descriptors of a rx queue
*
* @param port_id
- * The port identifier of the Ethernet device.
+ * 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.
- *
+ * The queue id on the specific port.
* @return
- * - 0: Success
- * - -ENOTSUP: routine is not supported by the device PMD.
- * - -EINVAL: The port_id or the queue_id is out of range.
+ * The number of used descriptors in the specific queue, or:
+ * (-EINVAL) if *port_id* or *queue_id* is invalid
+ * (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_txq_info *qinfo);
+static inline int
+rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
+{
+ struct rte_eth_dev *dev;
-/**
- * Retrieve device registers and register attributes (number of registers and
- * register size)
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * Pointer to rte_dev_reg_info structure to fill in. If info->data is
- * NULL the function fills in the width and length fields. If non-NULL
- * the registers are put into the buffer pointed at by the data field.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
+ dev = &rte_eth_devices[port_id];
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -EINVAL;
-/**
- * Retrieve size of device EEPROM
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @return
- * - (>=0) EEPROM size if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_eeprom_length(uint16_t port_id);
+ return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
+}
/**
- * Retrieve EEPROM and EEPROM attribute
+ * Check if the DD bit of the specific RX descriptor in the queue has been set
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes buffer for return EEPROM data and
- * EEPROM attributes to be filled.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
+ * @param offset
+ * The offset of the descriptor ID from tail.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - (1) if the specific DD bit is set.
+ * - (0) if the specific DD bit is not set.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+static inline int
+rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
+ return (*dev->dev_ops->rx_descriptor_done)( \
+ dev->data->rx_queues[queue_id], offset);
+}
-/**
- * Program EEPROM with provided data
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes EEPROM data for programming and
- * EEPROM attributes to be filled
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
+#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
+#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * Set the list of multicast addresses to filter on an Ethernet device.
+ * Check the status of a Rx descriptor in the queue
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param mc_addr_set
- * The array of multicast addresses to set. Equal to NULL when the function
- * is invoked to flush the set of filtered addresses.
- * @param nb_mc_addr
- * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
- * when the function is invoked to flush the set of filtered addresses.
- * @return
- * - (0) if successful.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
- * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
- */
-int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-
-/**
- * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * It should be called in a similar context than the Rx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
*
- * @param port_id
- * The port identifier of the Ethernet device.
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_enable(uint16_t port_id);
-
-/**
- * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Rx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the next
+ * packet to be received by the driver).
*
* @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
+ * receive a packet.
+ * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
+ * not yet processed by the driver (i.e. in the receive queue).
+ * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
+ * the driver and not yet returned to hw, or reserved by the hw.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int rte_eth_timesync_disable(uint16_t port_id);
+static inline int
+rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
+ uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *rxq;
-/**
- * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
- * @param flags
- * Device specific flags. Used to pass the RX timesync register index to
- * i40e. Unused in igb/ixgbe, pass 0 instead.
- *
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
- struct timespec *timestamp, uint32_t flags);
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
+ rxq = dev->data->rx_queues[queue_id];
-/**
- * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
- *
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
- struct timespec *timestamp);
+ return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
+}
+
+#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
+#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
+#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * 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.
+ * Check the status of a Tx descriptor in the queue.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param delta
- * The adjustment in nanoseconds.
+ * It should be called in a similar context than the Tx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
-
-/**
- * Read the time from the timesync clock on an Ethernet device.
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Tx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the place where
+ * the next packet will be send).
*
* @return
- * - 0: Success.
+ * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
+ * in the transmit queue.
+ * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
+ * be reused by the driver.
+ * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
+ * driver or the hardware.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
+static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
+ uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *txq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
+ txq = dev->data->tx_queues[queue_id];
+
+ return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
+}
/**
- * Set the time of the timesync clock on an Ethernet device.
+ * Send a burst of output packets on a transmit queue of 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.
+ * The rte_eth_tx_burst() function is invoked to transmit output packets
+ * on the output queue *queue_id* of the Ethernet device designated by its
+ * *port_id*.
+ * The *nb_pkts* parameter is the number of packets to send which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
+ * up to the number of transmit descriptors available in the TX ring of the
+ * transmit queue.
+ * For each packet to send, the rte_eth_tx_burst() function performs
+ * the following operations:
+ *
+ * - Pick up the next available descriptor in the transmit ring.
+ *
+ * - Free the network buffer previously sent with that descriptor, if any.
+ *
+ * - Initialize the transmit descriptor with the information provided
+ * in the *rte_mbuf data structure.
+ *
+ * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
+ * the rte_eth_tx_burst() function uses several transmit descriptors
+ * of the ring.
+ *
+ * The rte_eth_tx_burst() function returns the number of packets it
+ * actually sent. A return value equal to *nb_pkts* means that all packets
+ * have been sent, and this is likely to signify that other output packets
+ * could be immediately transmitted again. Applications that implement a
+ * "send as many packets to transmit as possible" policy can check this
+ * specific case and keep invoking the rte_eth_tx_burst() function until
+ * a value less than *nb_pkts* is returned.
+ *
+ * It is the responsibility of the rte_eth_tx_burst() function to
+ * transparently free the memory buffers of packets previously sent.
+ * This feature is driven by the *tx_free_thresh* value supplied to the
+ * rte_eth_dev_configure() function at device configuration time.
+ * When the number of free TX descriptors drops below this threshold, the
+ * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
+ * of those packets whose transmission was effectively completed.
+ *
+ * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
+ * invoke this function concurrently on the same tx queue without SW lock.
+ * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
- *
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to transmit.
* @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * The number of output packets actually stored in transmit descriptors of
+ * the transmit ring. The return value can be less than the value of the
+ * *tx_pkts* parameter when the transmit ring is full or has been filled up.
*/
-int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
+static inline uint16_t
+rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
+ cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
+}
/**
- * Config l2 tunnel ether type of an Ethernet device for filtering specific
- * tunnel packets by ether type.
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Process a burst of output packets on a transmit queue of an Ethernet device.
+ *
+ * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
+ * transmitted on the output queue *queue_id* of the Ethernet device designated
+ * by its *port_id*.
+ * The *nb_pkts* parameter is the number of packets to be prepared which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * For each packet to send, the rte_eth_tx_prepare() function performs
+ * the following operations:
+ *
+ * - Check if packet meets devices requirements for tx offloads.
+ *
+ * - Check limitations about number of segments.
+ *
+ * - Check additional requirements when debug is enabled.
+ *
+ * - Update and/or reset required checksums when tx offload is set for packet.
+ *
+ * Since this function can modify packet data, provided mbufs must be safely
+ * writable (e.g. modified data cannot be in shared segment).
+ *
+ * The rte_eth_tx_prepare() function returns the number of packets ready to be
+ * sent. A return value equal to *nb_pkts* means that all packets are valid and
+ * ready to be sent, otherwise stops processing on the first invalid packet and
+ * leaves the rest packets untouched.
+ *
+ * When this functionality is not implemented in the driver, all packets are
+ * are returned untouched.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel configuration.
- *
+ * The value must be a valid port id.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to process.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * The number of packets correct and ready to be sent. The return value can be
+ * less than the value of the *tx_pkts* parameter when some packet doesn't
+ * meet devices requirements with rte_errno set appropriately:
+ * - -EINVAL: offload flags are not correctly set
+ * - -ENOTSUP: the offload feature is not supported by the hardware
+ *
*/
-int
-rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel);
-/**
- * Enable/disable l2 tunnel offload functions. Include,
- * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
- * Filtering, forwarding and offloading this type of tunnel packets depend on
- * this ability.
- * 2, Stripping the l2 tunnel tag.
- * 3, Insertion of the l2 tunnel tag.
- * 4, Forwarding the packets based on the l2 tunnel tag.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel parameters.
- * @param mask
- * Indicate the offload function.
- * @param en
- * Enable or disable this function.
+#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
+
+static inline uint16_t
+rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ if (!dev->tx_pkt_prepare)
+ return nb_pkts;
+
+ return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
+ tx_pkts, nb_pkts);
+}
+
+#else
+
+/*
+ * Native NOOP operation for compilation targets which doesn't require any
+ * preparations steps, and functional NOOP may introduce unnecessary performance
+ * drop.
*
- * @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * Generally this is not a good idea to turn it on globally and didn't should
+ * be used if behavior of tx_preparation can change.
*/
-int
-rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**
-* Get the port id from pci address or device name
-* Ex: 0000:2:00.0 or vdev name net_pcap0
-*
-* @param name
-* pci address or name of the device
-* @param port_id
-* pointer to port identifier of the device
-* @return
-* - (0) if successful and port_id is filled.
-* - (-ENODEV or -EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
+static inline uint16_t
+rte_eth_tx_prepare(__rte_unused uint16_t port_id,
+ __rte_unused uint16_t queue_id,
+ __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ return nb_pkts;
+}
-/**
-* Get the device name from port id
-*
-* @param port_id
-* pointer to port identifier of the device
-* @param name
-* pci address or name of the device
-* @return
-* - (0) if successful.
-* - (-EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+#endif
/**
- * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
- * the ethernet device information, otherwise adjust them to boundaries.
+ * Send any packets queued up for transmission on a port and HW queue
+ *
+ * This causes an explicit flush of packets previously buffered via the
+ * rte_eth_tx_buffer() function. It returns the number of packets successfully
+ * sent to the NIC, and calls the error callback for any unsent packets. Unless
+ * explicitly set up otherwise, the default callback simply frees the unsent
+ * packets back to the owning mempool.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param nb_rx_desc
- * A pointer to a uint16_t where the number of receive
- * descriptors stored.
- * @param nb_tx_desc
- * A pointer to a uint16_t where the number of transmit
- * descriptors stored.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer of packets to be transmit.
* @return
- * - (0) if successful.
- * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
+ * The number of packets successfully sent to the Ethernet device. The error
+ * callback is called for any packets which could not be sent.
*/
-int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
- uint16_t *nb_rx_desc,
- uint16_t *nb_tx_desc);
+static inline uint16_t
+rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer)
+{
+ uint16_t sent;
+ uint16_t to_send = buffer->length;
+
+ if (to_send == 0)
+ return 0;
+
+ sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
+
+ buffer->length = 0;
+ /* All packets sent, or to be dealt with by callback below */
+ if (unlikely(sent != to_send))
+ buffer->error_callback(&buffer->pkts[sent], to_send - sent,
+ buffer->error_userdata);
+
+ return sent;
+}
/**
- * Test if a port supports specific mempool ops.
+ * Buffer a single packet for future transmission on a port and queue
+ *
+ * This function takes a single mbuf/packet and buffers it for later
+ * transmission on the particular port and queue specified. Once the buffer is
+ * full of packets, an attempt will be made to transmit all the buffered
+ * packets. In case of error, where not all packets can be transmitted, a
+ * callback is called with the unsent packets as a parameter. If no callback
+ * is explicitly set up, the unsent packets are just freed back to the owning
+ * mempool. The function returns the number of packets actually sent i.e.
+ * 0 if no buffer flush occurred, otherwise the number of packets successfully
+ * flushed
*
* @param port_id
- * Port identifier of the Ethernet device.
- * @param [in] pool
- * The name of the pool operations to test.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer used to collect packets to be sent.
+ * @param tx_pkt
+ * Pointer to the packet mbuf to be sent.
* @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.
+ * 0 = packet has been buffered for later transmission
+ * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
+ * causing N packets to be sent, and the error callback to be called for
+ * the rest.
*/
-int
-rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
+static __rte_always_inline uint16_t
+rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
+{
+ buffer->pkts[buffer->length++] = tx_pkt;
+ if (buffer->length < buffer->size)
+ return 0;
+
+ return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
+}
#ifdef __cplusplus
}
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v2 5/6] ethdev: rename function parameter for consistency
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
` (2 preceding siblings ...)
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 4/6] ethdev: reorder inline functions Ferruh Yigit
@ 2018-01-09 16:23 ` Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
5 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-09 16:23 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
Update "port" function argument variable to "port_id" in public
header to be consistent in all APIs.
No functional change.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index fc7ce29bf..a61a97c6a 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1146,7 +1146,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* The callback function is called on RX with a burst of packets that have
* been received on the given port and queue.
*
- * @param port
+ * @param port_id
* The Ethernet port on which RX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to receive the packets.
@@ -1162,7 +1162,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* @return
* The number of packets returned to the user.
*/
-typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
void *user_param);
@@ -1172,7 +1172,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* The callback function is called on TX with a burst of packets immediately
* before the packets are put onto the hardware queue for transmission.
*
- * @param port
+ * @param port_id
* The Ethernet port on which TX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to transmit the packets.
@@ -1186,7 +1186,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* @return
* The number of packets to be written to the NIC.
*/
-typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
struct rte_eth_rxtx_callback;
@@ -2508,7 +2508,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* Add a MAC address to an internal array of addresses used to enable whitelist
* filtering to accept packets only if the destination MAC address matches.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* The MAC address to add.
@@ -2516,19 +2516,19 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
* not enabled, this should be set to 0.
* @return
- * - (0) if successfully added or *mac_addr" was already added.
+ * - (0) if successfully added or *mac_addr* was already added.
* - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port* is invalid.
* - (-ENOSPC) if no more MAC addresses can be added.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr,
uint32_t pool);
/**
* Remove a MAC address from the internal array of addresses.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* MAC address to remove.
@@ -2538,12 +2538,12 @@ int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
* - (-ENODEV) if *port* invalid.
* - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr);
/**
* Set the default MAC address.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* New default MAC address.
@@ -2553,13 +2553,13 @@ int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
+int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
struct ether_addr *mac_addr);
/**
* Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to update.
@@ -2571,14 +2571,14 @@ int rte_eth_dev_default_mac_addr_set(uint16_t port,
* - (-ENOTSUP) if hardware doesn't support.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rss_reta_update(uint16_t port,
+int rte_eth_dev_rss_reta_update(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
/**
* Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to query.
@@ -2590,7 +2590,7 @@ int rte_eth_dev_rss_reta_update(uint16_t port,
* - (-ENOTSUP) if hardware doesn't support.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rss_reta_query(uint16_t port,
+int rte_eth_dev_rss_reta_query(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
@@ -2599,7 +2599,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* MAC address, and the packet is routed to all VFs for which the RX mode is
* accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param addr
* Unicast MAC address.
@@ -2612,7 +2612,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr,
uint8_t on);
/**
@@ -2620,7 +2620,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* Ethernet MAC addresses,the packet is routed to all VFs for which the RX
* mode is accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param on
* 1 - Set all unicast hash bitmaps for receiving all the Ethernet
@@ -2632,7 +2632,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on);
/**
* Set a traffic mirroring rule on an Ethernet device
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
` (3 preceding siblings ...)
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 5/6] ethdev: rename function parameter for consistency Ferruh Yigit
@ 2018-01-09 16:23 ` Ferruh Yigit
2018-01-09 18:55 ` Stephen Hemminger
2018-01-09 18:58 ` Stephen Hemminger
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
5 siblings, 2 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-09 16:23 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
"struct rte_eth_rxtx_callback" is defined as internal data structure and
used as named opaque type.
So the functions that are adding callbacks can return objects in this
type instead of void pointer.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v2:
* keep using struct * in parameters, instead add callback functions
return struct rte_eth_rxtx_callback pointer.
---
lib/librte_ether/rte_ethdev.c | 6 +++---
lib/librte_ether/rte_ethdev.h | 9 ++++++---
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index b3918b77a..184245880 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3115,7 +3115,7 @@ rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
return (*dev->dev_ops->filter_ctrl)(dev, filter_type, filter_op, arg);
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param)
{
@@ -3157,7 +3157,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
return cb;
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param)
{
@@ -3192,7 +3192,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
return cb;
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
rte_tx_callback_fn fn, void *user_param)
{
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index a61a97c6a..2877a455c 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -2846,7 +2846,8 @@ int rte_eth_dev_get_dcb_info(uint16_t port_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param);
/**
@@ -2874,7 +2875,8 @@ void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param);
/**
@@ -2901,7 +2903,8 @@ void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
rte_tx_callback_fn fn, void *user_param);
/**
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
@ 2018-01-09 18:55 ` Stephen Hemminger
2018-01-09 18:58 ` Stephen Hemminger
1 sibling, 0 replies; 76+ messages in thread
From: Stephen Hemminger @ 2018-01-09 18:55 UTC (permalink / raw)
To: Ferruh Yigit
Cc: Thomas Monjalon, dev, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
On Tue, 9 Jan 2018 16:23:17 +0000
Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> "struct rte_eth_rxtx_callback" is defined as internal data structure and
> used as named opaque type.
>
> So the functions that are adding callbacks can return objects in this
> type instead of void pointer.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> v2:
> * keep using struct * in parameters, instead add callback functions
> return struct rte_eth_rxtx_callback pointer.
> ---
> lib/librte_ether/rte_ethdev.c | 6 +++---
> lib/librte_ether/rte_ethdev.h | 9 ++++++---
> 2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index b3918b77a..184245880 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -3115,7 +3115,7 @@ rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
> return (*dev->dev_ops->filter_ctrl)(dev, filter_type, filter_op, arg);
> }
>
> -void *
> +struct rte_eth_rxtx_callback *
> rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
> rte_rx_callback_fn fn, void *user_param)
> {
> @@ -3157,7 +3157,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
> return cb;
> }
>
> -void *
> +struct rte_eth_rxtx_callback *
> rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
> rte_rx_callback_fn fn, void *user_param)
> {
> @@ -3192,7 +3192,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
> return cb;
> }
>
> -void *
> +struct rte_eth_rxtx_callback *
> rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
> rte_tx_callback_fn fn, void *user_param)
> {
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index a61a97c6a..2877a455c 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -2846,7 +2846,8 @@ int rte_eth_dev_get_dcb_info(uint16_t port_id,
> * NULL on error.
> * On success, a pointer value which can later be used to remove the callback.
> */
> -void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
> +struct rte_eth_rxtx_callback *
> +rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
> rte_rx_callback_fn fn, void *user_param);
>
> /**
> @@ -2874,7 +2875,8 @@ void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
> * NULL on error.
> * On success, a pointer value which can later be used to remove the callback.
> */
> -void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
> +struct rte_eth_rxtx_callback *
> +rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
> rte_rx_callback_fn fn, void *user_param);
>
> /**
> @@ -2901,7 +2903,8 @@ void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
> * NULL on error.
> * On success, a pointer value which can later be used to remove the callback.
> */
> -void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
> +struct rte_eth_rxtx_callback *
> +rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
> rte_tx_callback_fn fn, void *user_param);
>
> /**
I would prefer that the public API keep a typed (but opaque pointer).
Use of void * is problematic and likely to cause bugs.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
2018-01-09 18:55 ` Stephen Hemminger
@ 2018-01-09 18:58 ` Stephen Hemminger
1 sibling, 0 replies; 76+ messages in thread
From: Stephen Hemminger @ 2018-01-09 18:58 UTC (permalink / raw)
To: Ferruh Yigit
Cc: Thomas Monjalon, dev, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
On Tue, 9 Jan 2018 16:23:17 +0000
Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> "struct rte_eth_rxtx_callback" is defined as internal data structure and
> used as named opaque type.
>
> So the functions that are adding callbacks can return objects in this
> type instead of void pointer.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
My comment was "yes I agree pointer should have opaque type"
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/6] ethdev: separate driver APIs
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 2/6] ethdev: separate driver APIs Ferruh Yigit
@ 2018-01-09 19:19 ` Andrew Rybchenko
0 siblings, 0 replies; 76+ messages in thread
From: Andrew Rybchenko @ 2018-01-09 19:19 UTC (permalink / raw)
To: Ferruh Yigit, Thomas Monjalon, Hemant Agrawal, Shreyansh Jain,
Nipun Gupta, Jerin Jacob, Santosh Shukla, John W. Linville,
Shepard Siegel, Ed Czeck, John Miller, Allain Legacy,
Matt Peters, Harish Patil, Rasesh Mody, Ajit Khaparde,
Somnath Kotur, Declan Doherty, Rahul Lakkireddy, Wenzhuo Lu,
Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
John Daley, Nelson Escobar, Gaetan Rivet, Qi Zhang, Xiao Wang,
Beilei Xing, Chao Zhu, Jianbo Liu, Konstantin Ananyev,
Shijith Thotton, Srisivasubramanian Srinivasan, Adrien Mazarguil,
Nelio Laranjeiro, Yongseok Koh, Jacek Siuda, Tomasz Duszynski,
Dmitri Epshtein, Natalie Samsonov, Alejandro Lucero,
Tetsuya Mukawa, Shahed Shaikh, Bruce Richardson, Jasvinder Singh,
Cristian Dumitrescu, Matej Vido, Pascal Mazon, Maciej Czekaj,
Yuanhan Liu, Maxime Coquelin, Tiwei Bie, Shrikrishna Khare
Cc: dev, stable, Boris Pismenny, Aviad Yehezkel, Radu Nicolau
On 01/09/2018 07:23 PM, Ferruh Yigit wrote:
> Create a rte_ethdev_driver.h file and move PMD specific APIs here.
> Drivers updated to include this new header file.
>
> There is no update in header content and since ethdev.h included by
> ethdev_driver.h, nothing changed from driver point of view, only
> logically grouping of APIs. From applications point of view they can't
> access to driver specific APIs anymore and they shouldn't.
>
> More PMD specific data structures still remain in ethdev.h because of
> inline functions in header use them. Those will be handled separately.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
` (4 preceding siblings ...)
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
@ 2018-01-17 21:57 ` Ferruh Yigit
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
` (7 more replies)
5 siblings, 8 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-17 21:57 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Ferruh Yigit, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
port_id is now 16bits, update function parameter according.
Fixes: 4c270218aa26 ("ethdev: support security APIs")
Cc: stable@dpdk.org
Cc: declan.doherty@intel.com
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
Cc: Boris Pismenny <borisp@mellanox.com>
Cc: Aviad Yehezkel <aviadye@mellanox.com>
Cc: Radu Nicolau <radu.nicolau@intel.com>
Cc: Declan Doherty <declan.doherty@intel.com>
---
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index b3495992d..779853d02 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -277,7 +277,7 @@ rte_eth_dev_socket_id(uint16_t port_id)
}
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id)
+rte_eth_dev_get_sec_ctx(uint16_t port_id)
{
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL);
return rte_eth_devices[port_id].security_ctx;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index a5ba56412..e4927029d 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1722,7 +1722,7 @@ struct rte_eth_dev {
} __rte_cache_aligned;
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
+rte_eth_dev_get_sec_ctx(uint16_t port_id);
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
@ 2018-01-17 21:57 ` Ferruh Yigit
2018-01-17 22:11 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-03-09 11:25 ` [dpdk-dev] [PATCH v4] " Ferruh Yigit
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 3/6] ethdev: separate driver APIs Ferruh Yigit
` (6 subsequent siblings)
7 siblings, 2 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-17 21:57 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Ferruh Yigit, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
"struct rte_eth_rxtx_callback" is defined as internal data structure and
used as named opaque type.
So the functions that are adding callbacks can return objects in this
type instead of void pointer.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
v2:
* keep using struct * in parameters, instead add callback functions
return struct rte_eth_rxtx_callback pointer.
---
lib/librte_ether/rte_ethdev.c | 6 +++---
lib/librte_ether/rte_ethdev.h | 9 ++++++---
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 779853d02..b3d01dcb4 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3160,7 +3160,7 @@ rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
return (*dev->dev_ops->filter_ctrl)(dev, filter_type, filter_op, arg);
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param)
{
@@ -3202,7 +3202,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
return cb;
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param)
{
@@ -3237,7 +3237,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
return cb;
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
rte_tx_callback_fn fn, void *user_param)
{
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index e4927029d..e45806933 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -4080,7 +4080,8 @@ int rte_eth_dev_get_dcb_info(uint16_t port_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param);
/**
@@ -4108,7 +4109,8 @@ void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param);
/**
@@ -4135,7 +4137,8 @@ void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
rte_tx_callback_fn fn, void *user_param);
/**
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v3 3/6] ethdev: separate driver APIs
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
@ 2018-01-17 21:57 ` Ferruh Yigit
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 4/6] ethdev: separate internal structures into own header Ferruh Yigit
` (5 subsequent siblings)
7 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-17 21:57 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Ferruh Yigit, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.
There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.
More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
v2: use SPDX header
v3: rebased on next-net
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/avf/avf_ethdev.c | 2 +-
drivers/net/avf/avf_rxtx.c | 2 +-
drivers/net/avf/avf_rxtx_vec_common.h | 2 +-
drivers/net/avf/avf_rxtx_vec_sse.c | 2 +-
drivers/net/avf/avf_vchnl.c | 2 +-
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
drivers/net/bonding/rte_eth_bond_private.h | 2 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 2 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa/rte_pmd_dpaa.h | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 2 +-
drivers/net/e1000/igb_flow.c | 2 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 2 +-
drivers/net/enic/enic_clsf.c | 2 +-
drivers/net/enic/enic_ethdev.c | 2 +-
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/failsafe/failsafe.c | 2 +-
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 2 +-
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/rte_pmd_i40e.h | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 2 +-
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +-
drivers/net/kni/rte_eth_kni.c | 2 +-
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 2 +-
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/mlx5.c | 2 +-
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_defs.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
| 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mrvl/mrvl_ethdev.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/null/rte_eth_null.c | 2 +-
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 2 +-
drivers/net/qede/qede_ethdev.h | 2 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 2 +-
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 2 +-
drivers/net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 2 +-
drivers/net/tap/rte_eth_tap.c | 2 +-
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.c | 1 +
lib/librte_ether/rte_ethdev.h | 112 +-------------------
lib/librte_ether/rte_ethdev_driver.h | 132 ++++++++++++++++++++++++
lib/librte_ether/rte_ethdev_pci.h | 2 +-
lib/librte_ether/rte_ethdev_vdev.h | 2 +-
157 files changed, 291 insertions(+), 261 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_driver.h
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 329a125c4..119371df7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_bus.h>
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index da3749044..15bf73a40 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -11,7 +11,7 @@
#include <stdbool.h>
#include <net/if.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <compat.h>
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index acc275a4c..9a24c8c65 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -14,7 +14,7 @@
#include <rte_malloc.h>
#include <rte_devargs.h>
#include <rte_memcpy.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <fslmc_vfio.h>
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 9f28fa0bf..1241295be 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -22,7 +22,7 @@
#include <eal_filesystem.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index ffad0f536..139249c07 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -19,7 +19,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
index f0edaf414..fb28e4970 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 537141d07..eefde1552 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -24,7 +24,7 @@
#include<sys/eventfd.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index ba7e5145e..42115a09d 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -26,7 +26,7 @@
#include <rte_memory.h>
#include <rte_pci.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fslmc_vfio.h>
diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
index cdb3f86eb..0caab5cf9 100644
--- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
+++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <mc/fsl_dpcon.h>
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index 6bff72ac7..d116a1671 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -8,7 +8,7 @@
#include <rte_debug.h>
#include <rte_dev.h>
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <rte_lcore.h>
#include <rte_log.h>
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 51770d412..afda2c290 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -14,7 +14,7 @@
#include <errno.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index d51540898..ac58ad6b2 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -37,7 +37,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index 3a54a4c91..146787112 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -38,7 +38,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
int eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
diff --git a/drivers/net/ark/ark_ethdev_tx.h b/drivers/net/ark/ark_ethdev_tx.h
index 8aaafc22e..657f895a4 100644
--- a/drivers/net/ark/ark_ethdev_tx.h
+++ b/drivers/net/ark/ark_ethdev_tx.h
@@ -36,7 +36,7 @@
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
uint16_t eth_ark_xmit_pkts_noop(void *vtxq,
diff --git a/drivers/net/ark/ark_ext.h b/drivers/net/ark/ark_ext.h
index d26c8198b..031cfddc3 100644
--- a/drivers/net/ark/ark_ext.h
+++ b/drivers/net/ark/ark_ext.h
@@ -34,7 +34,7 @@
#ifndef _ARK_EXT_H_
#define _ARK_EXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* This is the template file for users who which to define a dynamic
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index aef2cf73b..41eb260e6 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -38,7 +38,7 @@
#include <assert.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 202a1d9be..2cadaab80 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -36,7 +36,7 @@
#include <locale.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktchkr.h"
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index 018f37b69..d3c3dee1e 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -38,7 +38,7 @@
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktgen.h"
diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index b36d31705..cf7bbb2e7 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -19,7 +19,7 @@
#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/avf/avf_rxtx.c b/drivers/net/avf/avf_rxtx.c
index e0c45839e..d276d9752 100644
--- a/drivers/net/avf/avf_rxtx.c
+++ b/drivers/net/avf/avf_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/avf/avf_rxtx_vec_common.h b/drivers/net/avf/avf_rxtx_vec_common.h
index 56a23a732..8057b9682 100644
--- a/drivers/net/avf/avf_rxtx_vec_common.h
+++ b/drivers/net/avf/avf_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _AVF_RXTX_VEC_COMMON_H_
#define _AVF_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "avf.h"
diff --git a/drivers/net/avf/avf_rxtx_vec_sse.c b/drivers/net/avf/avf_rxtx_vec_sse.c
index 8f389f311..8275100f3 100644
--- a/drivers/net/avf/avf_rxtx_vec_sse.c
+++ b/drivers/net/avf/avf_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/avf_prototype.h"
diff --git a/drivers/net/avf/avf_vchnl.c b/drivers/net/avf/avf_vchnl.c
index cc347e6ea..fa71014e1 100644
--- a/drivers/net/avf/avf_vchnl.c
+++ b/drivers/net/avf/avf_vchnl.c
@@ -16,7 +16,7 @@
#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_dev.h>
#include "avf_log.h"
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index deb6f355d..e4ad7b00a 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -36,7 +36,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h
index 967d6dc50..37cac1589 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.h
+++ b/drivers/net/bnx2x/bnx2x_ethdev.h
@@ -33,7 +33,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_eal.h>
#include <rte_mempool.h>
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 7e3d7aefd..cf0b1d27c 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -40,7 +40,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
#include <rte_lcore.h>
#include <rte_spinlock.h>
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 89b63978f..057786a62 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
diff --git a/drivers/net/bnxt/bnxt_stats.h b/drivers/net/bnxt/bnxt_stats.h
index 51d16f5d3..c1c83d57b 100644
--- a/drivers/net/bnxt/bnxt_stats.h
+++ b/drivers/net/bnxt/bnxt_stats.h
@@ -34,7 +34,7 @@
#ifndef _BNXT_STATS_H_
#define _BNXT_STATS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
void bnxt_free_stats(struct bnxt *bp);
int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index e86e670dc..595208997 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -36,7 +36,7 @@
#include <unistd.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h
index f881d30d6..cd7227ac2 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.h
+++ b/drivers/net/bnxt/rte_pmd_bnxt.h
@@ -34,7 +34,7 @@
#ifndef _PMD_BNXT_H_
#define _PMD_BNXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* Response sent back to the caller after callback
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 534a890bf..03b73be03 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 10c1920ae..158f3aa1d 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_tcp.h>
#include <rte_udp.h>
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index e2b717f72..92e15f8cc 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -5,7 +5,7 @@
#ifndef _RTE_ETH_BOND_PRIVATE_H_
#define _RTE_ETH_BOND_PRIVATE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_bitmap.h>
diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 282e2e625..56f38c838 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -44,7 +44,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index dc153c731..5cd260f48 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 5b828c237..28db6c061 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -55,7 +55,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index fc10d9585..3d5aa596f 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 444c122e0..0ed64e80c 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -28,7 +28,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 1fa6caf38..2a77ffb30 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -9,7 +9,7 @@
/* System headers */
#include <stdbool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fsl_usd.h>
#include <fsl_qman.h>
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 041393206..b5ffde598 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_ip.h>
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index 9614be84e..2b03d52d4 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -15,7 +15,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @warning
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index f7a8d9f26..b93376de4 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 8b1e4d273..4cfa611b6 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 89b7c1a94..c1281383d 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index dcffb0797..07ee25f84 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index a010b3ab8..02fae100c 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 077e09400..53b8ffa45 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index b560f16a2..d98bdc844 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 3258f3b5b..b9f2e5391 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -16,7 +16,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index a2abc759f..2f3716724 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 3f379a9b2..656f3ca05 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -32,7 +32,7 @@
*/
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_tcp.h>
#include <rte_atomic.h>
diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index d52e5e475..3ef1d0832 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -5,7 +5,7 @@
#include <libgen.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_hash.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index ad7a4e306..e1ff9dcbd 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -9,7 +9,7 @@
#include <rte_dev.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index 9a2bb8ebd..28923b0e2 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -4,7 +4,7 @@
#include <errno.h>
#include <rte_log.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow_driver.h>
#include <rte_ether.h>
#include <rte_ip.h>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 9bbe054b3..9274defd9 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -16,7 +16,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "enic_compat.h"
#include "enic.h"
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index c8ded867d..c99d61837 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -4,7 +4,7 @@
*/
#include "enic_compat.h"
-#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "wq_enet_desc.h"
#include "rq_enet_desc.h"
#include "cq_enet_desc.h"
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index e2002e136..98902caa0 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -4,7 +4,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include "enic_compat.h"
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index b76735261..cb274eb76 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -33,7 +33,7 @@
#include <rte_alarm.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_devargs.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index a2c74f5df..4c0280a7c 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -36,7 +36,7 @@
#include <rte_debug.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_flow.h>
#include <rte_cycles.h>
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 54b5b9169..c61579e38 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -38,7 +38,7 @@
#include <rte_atomic.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_devargs.h>
#define FAILSAFE_DRIVER_NAME "Fail-safe PMD"
diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c
index 0ebf06a6f..165449411 100644
--- a/drivers/net/failsafe/failsafe_rxtx.c
+++ b/drivers/net/failsafe/failsafe_rxtx.c
@@ -34,7 +34,7 @@
#include <rte_atomic.h>
#include <rte_debug.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "failsafe_private.h"
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index cf8cc6a6e..340f6040f 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2013-2016 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 65956db08..9320748c4 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_net.h>
#include "fm10k.h"
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index 630ca49b9..498a17815 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "fm10k.h"
#include "base/fm10k_type.h"
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 46cd3fadf..d5d7706ea 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0cca0d324..6ac3f8c04 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_dev.h>
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 906c2048a..4c53986a8 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index cd9a9b64b..a74fa08ab 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_eth_ctrl.h>
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index e19917715..dd3962d38 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -14,7 +14,7 @@
#include <rte_string_fns.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 23256b753..37761886e 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index 5e4e472a3..f3fc82672 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index ea6e7715c..dbcb61f38 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -32,7 +32,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index e3faaefd9..3ffedcb9e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _I40E_RXTX_VEC_COMMON_H_
#define _I40E_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "i40e_ethdev.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index b5685e2b9..e549d1e8c 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 1df306122..3b22588c5 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index cfdcae7e5..d248adb1a 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -14,7 +14,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Response sent back to i40e driver from user app after callback
diff --git a/drivers/net/ixgbe/ixgbe_bypass.c b/drivers/net/ixgbe/ixgbe_bypass.c
index 62a550653..ae38ce355 100644
--- a/drivers/net/ixgbe/ixgbe_bypass.c
+++ b/drivers/net/ixgbe/ixgbe_bypass.c
@@ -4,7 +4,7 @@
#include <time.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_bypass_api.h"
#include "rte_pmd_ixgbe.h"
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4f4334df2..58217680c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 551580c04..75f74ac07 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -13,7 +13,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_logs.h"
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 0e486c38a..dcbfb38b3 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index 85305c60a..d4e59179a 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ip.h>
#include <rte_jhash.h>
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index f81dc314d..ea9973711 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 4b382477e..eeff91b0d 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -62,7 +62,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
index df580f39b..414840a2b 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _IXGBE_RXTX_VEC_COMMON_H_
#define _IXGBE_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_rxtx.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index b2a2774da..e0f9998f0 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 0131b06d2..c9ba48246 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index 001a8647e..d8ca8ca31 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "base/ixgbe_api.h"
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 463a78e50..11a9f334b 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -11,7 +11,7 @@
#ifndef _PMD_IXGBE_H_
#define _PMD_IXGBE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Notify VF when PF link status changes.
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index a1df4c6a9..dc4e65f5d 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -6,7 +6,7 @@
#include <pthread.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kni.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 2a5d4f12f..ddbc8c0e0 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -4,7 +4,7 @@
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/base/lio_mbox.c b/drivers/net/liquidio/base/lio_mbox.c
index 3c6379341..112900151 100644
--- a/drivers/net/liquidio/base/lio_mbox.c
+++ b/drivers/net/liquidio/base/lio_mbox.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include "lio_logs.h"
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 8f6ef6381..843d02338 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 5d447706a..8d705bfe7 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 61c5bf4d3..ab3071930 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -57,7 +57,7 @@
#include <rte_common.h>
#include <rte_dev.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 99dc3357a..638cb08b0 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_interrupts.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index c80eab5a8..3db546a1f 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -63,7 +63,7 @@
#include <rte_bus_pci.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_pci.h>
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 96a6a6fa7..fb84060db 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -57,7 +57,7 @@
#include <rte_byteorder.h>
#include <rte_errno.h>
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index b10c4f552..cd46f860d 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -47,7 +47,7 @@
#endif
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c
index 9becee4a8..2ff72188a 100644
--- a/drivers/net/mlx4/mlx4_intr.c
+++ b/drivers/net/mlx4/mlx4_intr.c
@@ -52,7 +52,7 @@
#include <rte_alarm.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_io.h>
#include <rte_interrupts.h>
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index 98ab1d266..163598765 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -55,7 +55,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h
index 900cab372..6a9fd28a5 100644
--- a/drivers/net/mlx4/mlx4_rxtx.h
+++ b/drivers/net/mlx4/mlx4_rxtx.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c
index 7664c3e1a..2bd4b9cb6 100644
--- a/drivers/net/mlx4/mlx4_txq.c
+++ b/drivers/net/mlx4/mlx4_txq.c
@@ -54,7 +54,7 @@
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 1c95f3520..58076ece8 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -51,7 +51,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index e740a4e77..fae959d21 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -53,7 +53,7 @@
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_interrupts.h>
#include <rte_errno.h>
diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 64bb0712e..a71db281d 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -34,7 +34,7 @@
#ifndef RTE_PMD_MLX5_DEFS_H_
#define RTE_PMD_MLX5_DEFS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5_autoconf.h"
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 6f78adc4a..a8e6ed5e1 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -55,7 +55,7 @@
#include <sys/un.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_bus_pci.h>
#include <rte_mbuf.h>
#include <rte_common.h>
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index ff9fd78d5..acc3967d7 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -44,7 +44,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 9fb5ba5e7..a5e78ec8d 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -52,7 +52,7 @@
#endif
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5.h"
--git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index f47bda667..9e12b51fe 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -48,7 +48,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_defs.h"
diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c
index 6fb245ba1..897695855 100644
--- a/drivers/net/mlx5/mlx5_rxmode.c
+++ b/drivers/net/mlx5/mlx5_rxmode.c
@@ -45,7 +45,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_rxtx.h"
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 950472754..8e4fbbf2a 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -52,7 +52,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_debug.h>
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 4cb6136fc..36234b870 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -34,7 +34,7 @@
#include <linux/sockios.h>
#include <linux/ethtool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 1a20967a2..631f00c6f 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_interrupts.h>
#include <rte_alarm.h>
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 26db15a4f..49018303e 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -51,7 +51,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 9443e4f03..d51dbe941 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -36,7 +36,7 @@
#include <assert.h>
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 4294c5676..b0cece154 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -32,7 +32,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_log.h>
#include <rte_malloc.h>
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index d14f2442b..004469923 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -43,7 +43,7 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_debug.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ether.h>
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 726a5c5e4..7cd5c7163 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -32,7 +32,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h
index 637b92cf4..10e42e142 100644
--- a/drivers/net/octeontx/octeontx_ethdev.h
+++ b/drivers/net/octeontx/octeontx_ethdev.h
@@ -8,7 +8,7 @@
#include <stdbool.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eventdev.h>
#include <rte_mempool.h>
#include <rte_memory.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c
index 2445fae48..2502d90e9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.c
+++ b/drivers/net/octeontx/octeontx_rxtx.c
@@ -9,7 +9,7 @@
#include <rte_atomic.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index e8eed169a..fe3e5ccd9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -5,7 +5,7 @@
#ifndef __OCTEONTX_RXTX_H__
#define __OCTEONTX_RXTX_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#ifndef __hot
#define __hot __attribute__((hot))
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index debb0cec2..c1571e1fe 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -11,7 +11,7 @@
#include <pcap.h>
#include <rte_cycles.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 7cddbe66b..cb9597390 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -13,7 +13,7 @@
#include <sys/queue.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ip.h>
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 48091f459..df13c44be 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -4,7 +4,7 @@
#include "rte_eth_ring.h"
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 3a4f66d60..75575349b 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -14,7 +14,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_spinlock.h>
#include <rte_atomic.h>
diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index 8bfb549e3..be725dcbd 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -11,7 +11,7 @@
#define _SFC_DP_RX_H
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h
index f400755d9..acb8802b8 100644
--- a/drivers/net/sfc/sfc_dp_tx.h
+++ b/drivers/net/sfc/sfc_dp_tx.h
@@ -10,7 +10,7 @@
#ifndef _SFC_DP_TX_H
#define _SFC_DP_TX_H
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index af867a7d1..86eb59296 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -8,7 +8,7 @@
*/
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index da2b5c6ef..872f79b91 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -10,7 +10,7 @@
#ifndef _SFC_EV_H_
#define _SFC_EV_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index c0ef415b5..99d0db813 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -9,7 +9,7 @@
#include <rte_tailq.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eth_ctrl.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 2cf75bc01..88c460131 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -12,7 +12,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_tx.h b/drivers/net/sfc/sfc_tx.h
index c2b889f1c..b2a189468 100644
--- a/drivers/net/sfc/sfc_tx.h
+++ b/drivers/net/sfc/sfc_tx.h
@@ -11,7 +11,7 @@
#define _SFC_TX_H
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 5c5464c8d..b0c134152 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index 3a1282347..050e3e7e1 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -9,7 +9,7 @@
#include <rte_mbuf.h>
#include <rte_sched.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tm_driver.h>
#include "rte_eth_softnic.h"
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 45aebed33..e53c738db 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -44,7 +44,7 @@
#include <libsze2.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index be73f93c8..75fd492fb 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -7,7 +7,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index 829f32f3e..00d6ad8a0 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -41,7 +41,7 @@
#include <linux/if_tun.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#ifdef IFF_MULTI_QUEUE
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index b9a873f2f..cbe1e2a1b 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -24,7 +24,7 @@
#include <rte_dev.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_interrupts.h>
#include <rte_log.h>
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index fd20d2cb1..c672f62e2 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -5,7 +5,7 @@
#ifndef __THUNDERX_NICVF_ETHDEV_H__
#define __THUNDERX_NICVF_ETHDEV_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define THUNDERX_NICVF_PMD_VERSION "2.0"
#define THUNDERX_REG_BYTES 8
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index aa278afee..72305d9d2 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -13,7 +13,7 @@
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h
index ae6355361..8bdd582ed 100644
--- a/drivers/net/thunderx/nicvf_rxtx.h
+++ b/drivers/net/thunderx/nicvf_rxtx.h
@@ -6,7 +6,7 @@
#define __THUNDERX_NICVF_RXTX_H__
#include <rte_byteorder.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define NICVF_TX_OFFLOAD_MASK (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 429d29044..68ab74c66 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -11,7 +11,7 @@
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
struct nicvf_rbdr {
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 014428580..4e541e3d8 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 1f0e239f3..574ca62c7 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -8,7 +8,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 9d810a599..a28ba8339 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -9,7 +9,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
struct virtqueue;
struct virtnet_ctl;
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 80e996d06..854af399e 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index 98a9da5d8..7247a0822 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c
index b73867ac7..d6207d7bb 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_neon.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c
@@ -12,7 +12,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c
index 6378b12af..d768d0757 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_sse.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c
@@ -14,7 +14,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index d3b704b40..a2fb93cc9 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
#include <rte_malloc.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index f9416f348..b70e91756 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -32,7 +32,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index ea8cf941a..48d84f445 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -27,6 +27,7 @@ SRCS-y += ethdev_profile.c
# Export include files
#
SYMLINK-y-include += rte_ethdev.h
+SYMLINK-y-include += rte_ethdev_driver.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index b3d01dcb4..15106a56c 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -37,6 +37,7 @@
#include "rte_ether.h"
#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "ethdev_profile.h"
static const char *MZ_RTE_ETH_DEV_DATA = "rte_eth_dev_data";
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index e45806933..3a12f33cd 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -17,10 +17,10 @@
* to get its MAC address, the speed and the status of its physical link,
* to receive and to transmit packets, and so on.
*
- * - The driver-oriented Ethernet API that exports a function allowing
- * an Ethernet Poll Mode Driver (PMD) to simultaneously register itself as
- * an Ethernet device driver and as a PCI driver for a set of matching PCI
- * [Ethernet] devices classes.
+ * - The driver-oriented Ethernet API that exports functions allowing
+ * an Ethernet Poll Mode Driver (PMD) to allocate an Ethernet device instance,
+ * create memzone for HW rings and process registered callbacks, and so on.
+ * PMDs should include rte_ethdev_driver.h instead of this header.
*
* By default, all the functions of the Ethernet Device API exported by a PMD
* are lock-free functions which assume to not be invoked in parallel on
@@ -1833,53 +1833,6 @@ uint16_t rte_eth_find_next(uint16_t port_id);
*/
uint16_t rte_eth_dev_count(void);
-/**
- * @internal
- * Returns a ethdev slot specified by the unique identifier name.
- *
- * @param name
- * The pointer to the Unique identifier name for each Ethernet device
- * @return
- * - The pointer to the ethdev slot, on success. NULL on error
- */
-struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
-
-/**
- * @internal
- * Allocates a new ethdev slot for an ethernet device and returns the pointer
- * to that slot for the driver to use.
- *
- * @param name Unique identifier name for each Ethernet device
- * @param type Device type of this Ethernet device
- * @return
- * - Slot in the rte_dev_devices array for a new device;
- */
-struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
-
-/**
- * @internal
- * Attach to the ethdev already initialized by the primary
- * process.
- *
- * @param name Ethernet device's name.
- * @return
- * - Success: Slot in the rte_dev_devices array for attached
- * device.
- * - Error: Null pointer.
- */
-struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
-
-/**
- * @internal
- * Release the specified ethdev port.
- *
- * @param eth_dev
- * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
- * @return
- * - 0 on success, negative on error
- */
-int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
-
/**
* Attach a new Ethernet device specified by arguments.
*
@@ -1957,19 +1910,6 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
-/**
- * @internal
- * Release device queues and clear its configuration to force the user
- * application to reconfigure it. It is for internal use only.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- *
- * @return
- * void
- */
-void _rte_eth_dev_reset(struct rte_eth_dev *dev);
-
/**
* Allocate and set up a receive queue for an Ethernet device.
*
@@ -3554,26 +3494,6 @@ int rte_eth_dev_callback_unregister(uint16_t port_id,
enum rte_eth_event_type event,
rte_eth_dev_cb_fn cb_fn, void *cb_arg);
-/**
- * @internal Executes all the user application registered callbacks for
- * the specific device. It is for DPDK internal user only. User
- * application should not call it directly.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- * @param event
- * Eth device interrupt event type.
- * @param ret_param
- * To pass data back to user application.
- * This allows the user application to decide if a particular function
- * is permitted or not.
- *
- * @return
- * int
- */
-int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
- enum rte_eth_event_type event, void *ret_param);
-
/**
* 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
@@ -4447,30 +4367,6 @@ int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
*/
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
-/**
- * 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);
-
/**
* Config l2 tunnel ether type of an Ethernet device for filtering specific
* tunnel packets by ether type.
diff --git a/lib/librte_ether/rte_ethdev_driver.h b/lib/librte_ether/rte_ethdev_driver.h
new file mode 100644
index 000000000..45f08c65e
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_driver.h
@@ -0,0 +1,132 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
+ */
+
+#ifndef _RTE_ETHDEV_DRIVER_H_
+#define _RTE_ETHDEV_DRIVER_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device PMD API
+ *
+ * These APIs for the use from Ethernet drivers, user applications shouldn't
+ * use them.
+ *
+ */
+
+#include <rte_ethdev.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @internal
+ * Returns a ethdev slot specified by the unique identifier name.
+ *
+ * @param name
+ * The pointer to the Unique identifier name for each Ethernet device
+ * @return
+ * - The pointer to the ethdev slot, on success. NULL on error
+ */
+struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+
+/**
+ * @internal
+ * Allocates a new ethdev slot for an ethernet device and returns the pointer
+ * to that slot for the driver to use.
+ *
+ * @param name Unique identifier name for each Ethernet device
+ * @param type Device type of this Ethernet device
+ * @return
+ * - Slot in the rte_dev_devices array for a new device;
+ */
+struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
+
+/**
+ * @internal
+ * Attach to the ethdev already initialized by the primary
+ * process.
+ *
+ * @param name Ethernet device's name.
+ * @return
+ * - Success: Slot in the rte_dev_devices array for attached
+ * device.
+ * - Error: Null pointer.
+ */
+struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
+
+/**
+ * @internal
+ * Release the specified ethdev port.
+ *
+ * @param eth_dev
+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
+ * @return
+ * - 0 on success, negative on error
+ */
+int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
+
+/**
+ * @internal
+ * Release device queues and clear its configuration to force the user
+ * application to reconfigure it. It is for internal use only.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ *
+ * @return
+ * void
+ */
+void _rte_eth_dev_reset(struct rte_eth_dev *dev);
+
+/**
+ * @internal Executes all the user application registered callbacks for
+ * the specific device. It is for DPDK internal user only. User
+ * application should not call it directly.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ * @param event
+ * Eth device interrupt event type.
+ * @param ret_param
+ * To pass data back to user application.
+ * This allows the user application to decide if a particular function
+ * is permitted or not.
+ *
+ * @return
+ * int
+ */
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+ enum rte_eth_event_type event, void *ret_param);
+
+/**
+ * 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
+
+#endif /* _RTE_ETHDEV_DRIVER_H_ */
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index ad64a169c..897ce5b41 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -38,7 +38,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_config.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Copy pci device info to the Ethernet device data.
diff --git a/lib/librte_ether/rte_ethdev_vdev.h b/lib/librte_ether/rte_ethdev_vdev.h
index feb5a3eb0..259feda3f 100644
--- a/lib/librte_ether/rte_ethdev_vdev.h
+++ b/lib/librte_ether/rte_ethdev_vdev.h
@@ -37,7 +37,7 @@
#include <rte_config.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @internal
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v3 4/6] ethdev: separate internal structures into own header
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 3/6] ethdev: separate driver APIs Ferruh Yigit
@ 2018-01-17 21:58 ` Ferruh Yigit
2018-01-17 22:24 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 5/6] ethdev: reorder inline functions Ferruh Yigit
` (4 subsequent siblings)
7 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-17 21:58 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Ferruh Yigit, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
rte_ethdev_core.h created. Internal data structures are moved here.
These structures are mostly intended to be used by drivers, but they
need to be in the public header file because of the inline functions
in the ethdev.h header, and those inline functions are preferred to
kept because of the performance concerns.
The accessibility of the data structures are not changed, only logically
grouped to show that they are not intended to be used by applications.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.h | 579 +---------------------------------
lib/librte_ether/rte_ethdev_core.h | 619 +++++++++++++++++++++++++++++++++++++
3 files changed, 621 insertions(+), 578 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_core.h
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 48d84f445..34d014e71 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -28,6 +28,7 @@ SRCS-y += ethdev_profile.c
#
SYMLINK-y-include += rte_ethdev.h
SYMLINK-y-include += rte_ethdev_driver.h
+SYMLINK-y-include += rte_ethdev_core.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 3a12f33cd..4bfa25590 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1143,478 +1143,6 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
/**< l2 tunnel forwarding mask */
#define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
-/*
- * Definitions of all functions exported by an Ethernet driver through the
- * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
- * structure associated with an Ethernet device.
- */
-
-typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
-/**< @internal Ethernet device configuration. */
-
-typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to start a configured Ethernet device. */
-
-typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to stop a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link up a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link down a configured Ethernet device. */
-
-typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to close a configured Ethernet device. */
-
-typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
-/** <@internal Function used to reset a configured Ethernet device. */
-
-typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
-
-typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
-
-typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
- int wait_to_complete);
-/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
-
-typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_stats *igb_stats);
-/**< @internal Get global I/O statistics of an Ethernet device. */
-
-typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
-
-typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat *stats, unsigned n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
- const uint64_t *ids,
- uint64_t *values,
- unsigned int n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, unsigned size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
- unsigned int size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
- uint16_t queue_id,
- uint8_t stat_idx,
- uint8_t is_rx);
-/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
-
-typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_dev_info *dev_info);
-/**< @internal Get specific informations of an Ethernet device. */
-
-typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
-/**< @internal Get supported ptypes of an Ethernet device. */
-
-typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Start rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Stop rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- uint16_t nb_rx_desc,
- unsigned int socket_id,
- const struct rte_eth_rxconf *rx_conf,
- struct rte_mempool *mb_pool);
-/**< @internal Set up a receive queue of an Ethernet device. */
-
-typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t tx_queue_id,
- uint16_t nb_tx_desc,
- unsigned int socket_id,
- 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. */
-
-typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id);
-/**< @internal Get number of used descriptors on a receive queue. */
-
-typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
-/**< @internal Check DD bit of specific RX descriptor */
-
-typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
-/**< @internal Check the status of a Rx descriptor */
-
-typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
-/**< @internal Check the status of a Tx descriptor */
-
-typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
- char *fw_version, size_t fw_size);
-/**< @internal Get firmware information of an Ethernet device. */
-
-typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
-/**< @internal Force mbufs to be from TX ring. */
-
-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. */
-
-typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
-
-typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
- enum rte_vlan_type type, uint16_t tpid);
-/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
-
-typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
-/**< @internal set VLAN offload function by an Ethernet device. */
-
-typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal set port based TX VLAN insertion by an Ethernet device. */
-
-typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- int on);
-/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
-
-typedef uint16_t (*eth_rx_burst_t)(void *rxq,
- struct rte_mbuf **rx_pkts,
- uint16_t nb_pkts);
-/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_burst_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Send output packets on a transmit queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_prep_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Prepare output packets on a transmit queue of 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 */
-
-typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_fc_conf *fc_conf);
-/**< @internal Setup flow control parameter on an Ethernet device */
-
-typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_pfc_conf *pfc_conf);
-/**< @internal Setup priority flow control parameter on an Ethernet device */
-
-typedef int (*reta_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Update RSS redirection table on an Ethernet device */
-
-typedef int (*reta_query_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Query RSS redirection table on an Ethernet device */
-
-typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Update RSS hash configuration of an Ethernet device */
-
-typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Get current RSS hash configuration of an Ethernet device */
-
-typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
-/**< @internal Turn on SW controllable LED on an Ethernet device */
-
-typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
-/**< @internal Turn off SW controllable LED on an Ethernet device */
-
-typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
-/**< @internal Remove MAC address from receive address register */
-
-typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint32_t index,
- uint32_t vmdq);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint8_t on);
-/**< @internal Set a Unicast Hash bitmap */
-
-typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
- uint8_t on);
-/**< @internal Set all Unicast Hash bitmap */
-
-typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
- uint16_t queue_idx,
- uint16_t tx_rate);
-/**< @internal Set queue TX rate */
-
-typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
-/**< @internal Add a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
- uint8_t rule_id);
-/**< @internal Remove a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Add tunneling UDP port */
-
-typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Delete tunneling UDP port */
-
-typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-/**< @internal set the list of multicast addresses on an Ethernet device */
-
-typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
- struct timespec *timestamp,
- uint32_t flags);
-/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
-
-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_t)(struct rte_eth_dev *dev,
- struct rte_dev_reg_info *info);
-/**< @internal Retrieve registers */
-
-typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
-/**< @internal Retrieve eeprom size */
-
-typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Retrieve eeprom data */
-
-typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Program eeprom data */
-
-typedef int (*eth_l2_tunnel_eth_type_conf_t)
- (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
-/**< @internal config l2 tunnel ether type */
-
-typedef int (*eth_l2_tunnel_offload_set_t)
- (struct rte_eth_dev *dev,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**< @internal enable/disable the l2 tunnel offload functions */
-
-
-typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
- enum rte_filter_type filter_type,
- enum rte_filter_op filter_op,
- void *arg);
-/**< @internal Take operations to assigned filter type on an Ethernet device */
-
-typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
-
-typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Trafffic Metering and Policing (MTR) operations */
-
-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.
- */
-struct eth_dev_ops {
- eth_dev_configure_t dev_configure; /**< Configure device. */
- eth_dev_start_t dev_start; /**< Start device. */
- eth_dev_stop_t dev_stop; /**< Stop device. */
- eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
- eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
- eth_dev_close_t dev_close; /**< Close device. */
- eth_dev_reset_t dev_reset; /**< Reset device. */
- eth_link_update_t link_update; /**< Get device link state. */
-
- eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
- eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
- eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
- eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
- eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
- eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
- eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
- eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
- mtu_set_t mtu_set; /**< Set MTU. */
-
- eth_stats_get_t stats_get; /**< Get generic device statistics. */
- eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
- eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
- eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
- eth_xstats_get_names_t xstats_get_names;
- /**< Get names of extended statistics. */
- eth_queue_stats_mapping_set_t queue_stats_mapping_set;
- /**< Configure per queue stat counter mapping. */
-
- eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
- eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
- eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
- eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
- eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
- /**< Get packet types supported and identified by device. */
-
- vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
- vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
- vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
- vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
- vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
-
- eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
- eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
- eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
- eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
- eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
- eth_queue_release_t rx_queue_release; /**< Release RX queue. */
- eth_rx_queue_count_t rx_queue_count;
- /**< Get the number of used RX descriptors. */
- eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
- eth_rx_descriptor_status_t rx_descriptor_status;
- /**< Check the status of a Rx descriptor. */
- eth_tx_descriptor_status_t tx_descriptor_status;
- /**< Check the status of a Tx descriptor. */
- eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
- eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
- eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
- eth_queue_release_t tx_queue_release; /**< Release TX queue. */
- eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
-
- eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
- eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
-
- flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
- flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
- priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
-
- eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
- eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
-
- eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
- eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
-
- eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
- eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
- eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
- /** Config ether type of l2 tunnel. */
- eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
- /** Enable/disable l2 tunnel offload functions. */
-
- eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
-
- rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
- rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
- reta_update_t reta_update; /** Update redirection table. */
- reta_query_t reta_query; /** Query redirection table. */
-
- eth_get_reg_t get_reg; /**< Get registers. */
- eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
- eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
- eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
-
-
- eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
-
- eth_get_dcb_info get_dcb_info; /** Get DCB information. */
-
- eth_timesync_enable_t timesync_enable;
- /** Turn IEEE1588/802.1AS timestamping on. */
- eth_timesync_disable_t timesync_disable;
- /** Turn IEEE1588/802.1AS timestamping off. */
- eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
- /** Read the IEEE1588/802.1AS RX timestamp. */
- eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
- /** Read the IEEE1588/802.1AS TX timestamp. */
- eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
- eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
- eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
-
- eth_xstats_get_by_id_t xstats_get_by_id;
- /**< Get extended device statistic values by ID. */
- eth_xstats_get_names_by_id_t xstats_get_names_by_id;
- /**< Get name of extended device statistics by ID. */
-
- eth_tm_ops_get_t tm_ops_get;
- /**< Get Traffic Management (TM) operations. */
-
- eth_mtr_ops_get_t mtr_ops_get;
- /**< Get Traffic Metering and Policing (MTR) operations. */
-
- eth_pool_ops_supported_t pool_ops_supported;
- /**< Test if a port supports specific mempool ops */
-};
-
/**
* Function type used for RX packet processing packet callbacks.
*
@@ -1664,20 +1192,6 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
-/**
- * @internal
- * Structure used to hold information about the callbacks to be called for a
- * queue on RX and TX.
- */
-struct rte_eth_rxtx_callback {
- struct rte_eth_rxtx_callback *next;
- union{
- rte_rx_callback_fn rx;
- rte_tx_callback_fn tx;
- } fn;
- void *param;
-};
-
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1687,40 +1201,6 @@ enum rte_eth_dev_state {
RTE_ETH_DEV_DEFERRED,
};
-/**
- * @internal
- * The generic data structure associated with each ethernet device.
- *
- * Pointers to burst-oriented packet receive and transmit functions are
- * located at the beginning of the structure, along with the pointer to
- * where all the data elements for the particular device are stored in shared
- * memory. This split allows the function pointer and driver data to be per-
- * process, while the actual configuration data for the device is shared.
- */
-struct rte_eth_dev {
- eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
- eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
- eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
- struct rte_eth_dev_data *data; /**< Pointer to device data */
- const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
- struct rte_device *device; /**< Backing device */
- struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
- /** User application callbacks for NIC interrupts */
- struct rte_eth_dev_cb_list link_intr_cbs;
- /**
- * User-supplied functions called from rx_burst to post-process
- * received packets before passing them to the user
- */
- struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- /**
- * User-supplied functions called from tx_burst to pre-process
- * received packets before passing them to the driver for transmission.
- */
- struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- enum rte_eth_dev_state state; /**< Flag indicating the port state */
- void *security_ctx; /**< Context for security ops */
-} __rte_cache_aligned;
-
void *
rte_eth_dev_get_sec_ctx(uint16_t port_id);
@@ -1734,57 +1214,7 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-/**
- * @internal
- * The data part, with no function pointers, associated with each ethernet device.
- *
- * This structure is safe to place in shared memory to be common among different
- * processes in a multi-process configuration.
- */
-struct rte_eth_dev_data {
- char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
-
- void **rx_queues; /**< Array of pointers to RX queues. */
- void **tx_queues; /**< Array of pointers to TX queues. */
- uint16_t nb_rx_queues; /**< Number of RX queues. */
- uint16_t nb_tx_queues; /**< Number of TX queues. */
-
- struct rte_eth_dev_sriov sriov; /**< SRIOV data */
-
- void *dev_private; /**< PMD-specific private data */
-
- struct rte_eth_link dev_link;
- /**< Link-level information & status */
-
- struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
- uint16_t mtu; /**< Maximum Transmission Unit. */
-
- uint32_t min_rx_buf_size;
- /**< Common rx buffer size handled by all queues */
-
- uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
- struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
- uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
- /** bitmap array of associating Ethernet MAC addresses to pools */
- struct ether_addr* hash_mac_addrs;
- /** Device Ethernet MAC addresses of hash filtering. */
- uint16_t port_id; /**< Device [external] port identifier. */
- __extension__
- uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
- scattered_rx : 1, /**< RX of scattered packets 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). */
- lro : 1; /**< RX LRO is ON(1) / OFF(0) */
- uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint32_t dev_flags; /**< Capabilities */
- enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
- int numa_node; /**< NUMA node connection */
- struct rte_vlan_filter_conf vlan_filter_conf;
- /**< VLAN filter configuration. */
-};
+#include <rte_ethdev_core.h>
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
@@ -1793,13 +1223,6 @@ struct rte_eth_dev_data {
/** Device supports device removal interrupt */
#define RTE_ETH_DEV_INTR_RMV 0x0008
-/**
- * @internal
- * The pool of *rte_eth_dev* structures. The size of the pool
- * is configured at compile-time in the <rte_ethdev.c> file.
- */
-extern struct rte_eth_dev rte_eth_devices[];
-
/**
* Iterates over valid ethdev ports.
*
diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h
new file mode 100644
index 000000000..79610c368
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_core.h
@@ -0,0 +1,619 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2017 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTE_ETHDEV_COMMON_H_
+#define _RTE_ETHDEV_COMMON_H_
+/*
+ * Definitions of all functions exported by an Ethernet driver through the
+ * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
+ * structure associated with an Ethernet device.
+ */
+
+struct rte_eth_dev;
+
+typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
+/**< @internal Ethernet device configuration. */
+
+typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to start a configured Ethernet device. */
+
+typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to stop a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link up a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link down a configured Ethernet device. */
+
+typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to close a configured Ethernet device. */
+
+typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
+/** <@internal Function used to reset a configured Ethernet device. */
+
+typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
+
+typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
+
+typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
+ int wait_to_complete);
+/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
+
+typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_stats *igb_stats);
+/**< @internal Get global I/O statistics of an Ethernet device. */
+
+typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
+
+typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat *stats, unsigned n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
+ const uint64_t *ids,
+ uint64_t *values,
+ unsigned int n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, unsigned size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+ unsigned int size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id,
+ uint8_t stat_idx,
+ uint8_t is_rx);
+/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
+
+typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_dev_info *dev_info);
+/**< @internal Get specific informations of an Ethernet device. */
+
+typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
+/**< @internal Get supported ptypes of an Ethernet device. */
+
+typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Start rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Stop rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ uint16_t nb_rx_desc,
+ unsigned int socket_id,
+ const struct rte_eth_rxconf *rx_conf,
+ struct rte_mempool *mb_pool);
+/**< @internal Set up a receive queue of an Ethernet device. */
+
+typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t tx_queue_id,
+ uint16_t nb_tx_desc,
+ unsigned int socket_id,
+ 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. */
+
+typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id);
+/**< @internal Get number of used descriptors on a receive queue. */
+
+typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
+/**< @internal Check DD bit of specific RX descriptor */
+
+typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
+/**< @internal Check the status of a Rx descriptor */
+
+typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
+/**< @internal Check the status of a Tx descriptor */
+
+typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size);
+/**< @internal Get firmware information of an Ethernet device. */
+
+typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
+/**< @internal Force mbufs to be from TX ring. */
+
+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. */
+
+typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
+
+typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
+ enum rte_vlan_type type, uint16_t tpid);
+/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
+
+typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
+/**< @internal set VLAN offload function by an Ethernet device. */
+
+typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal set port based TX VLAN insertion by an Ethernet device. */
+
+typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ int on);
+/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
+
+typedef uint16_t (*eth_rx_burst_t)(void *rxq,
+ struct rte_mbuf **rx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_burst_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Send output packets on a transmit queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_prep_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Prepare output packets on a transmit queue of 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 */
+
+typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_fc_conf *fc_conf);
+/**< @internal Setup flow control parameter on an Ethernet device */
+
+typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_pfc_conf *pfc_conf);
+/**< @internal Setup priority flow control parameter on an Ethernet device */
+
+typedef int (*reta_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Update RSS redirection table on an Ethernet device */
+
+typedef int (*reta_query_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Query RSS redirection table on an Ethernet device */
+
+typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Update RSS hash configuration of an Ethernet device */
+
+typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Get current RSS hash configuration of an Ethernet device */
+
+typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
+/**< @internal Turn on SW controllable LED on an Ethernet device */
+
+typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
+/**< @internal Turn off SW controllable LED on an Ethernet device */
+
+typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
+/**< @internal Remove MAC address from receive address register */
+
+typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint32_t index,
+ uint32_t vmdq);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint8_t on);
+/**< @internal Set a Unicast Hash bitmap */
+
+typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
+ uint8_t on);
+/**< @internal Set all Unicast Hash bitmap */
+
+typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
+ uint16_t queue_idx,
+ uint16_t tx_rate);
+/**< @internal Set queue TX rate */
+
+typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
+/**< @internal Add a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
+ uint8_t rule_id);
+/**< @internal Remove a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Add tunneling UDP port */
+
+typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Delete tunneling UDP port */
+
+typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
+/**< @internal set the list of multicast addresses on an Ethernet device */
+
+typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
+ struct timespec *timestamp,
+ uint32_t flags);
+/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
+
+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_t)(struct rte_eth_dev *dev,
+ struct rte_dev_reg_info *info);
+/**< @internal Retrieve registers */
+
+typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
+/**< @internal Retrieve eeprom size */
+
+typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Retrieve eeprom data */
+
+typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Program eeprom data */
+
+typedef int (*eth_l2_tunnel_eth_type_conf_t)
+ (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
+/**< @internal config l2 tunnel ether type */
+
+typedef int (*eth_l2_tunnel_offload_set_t)
+ (struct rte_eth_dev *dev,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
+/**< @internal enable/disable the l2 tunnel offload functions */
+
+
+typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
+ enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op,
+ void *arg);
+/**< @internal Take operations to assigned filter type on an Ethernet device */
+
+typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
+
+typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Trafffic Metering and Policing (MTR) operations */
+
+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.
+ */
+struct eth_dev_ops {
+ eth_dev_configure_t dev_configure; /**< Configure device. */
+ eth_dev_start_t dev_start; /**< Start device. */
+ eth_dev_stop_t dev_stop; /**< Stop device. */
+ eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
+ eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
+ eth_dev_close_t dev_close; /**< Close device. */
+ eth_dev_reset_t dev_reset; /**< Reset device. */
+ eth_link_update_t link_update; /**< Get device link state. */
+
+ eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
+ eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
+ eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
+ eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
+ eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
+ eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
+ eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
+ eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
+ mtu_set_t mtu_set; /**< Set MTU. */
+
+ eth_stats_get_t stats_get; /**< Get generic device statistics. */
+ eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
+ eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
+ eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
+ eth_xstats_get_names_t xstats_get_names;
+ /**< Get names of extended statistics. */
+ eth_queue_stats_mapping_set_t queue_stats_mapping_set;
+ /**< Configure per queue stat counter mapping. */
+
+ eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
+ eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
+ eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
+ eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
+ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
+ /**< Get packet types supported and identified by device. */
+
+ vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
+ vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
+ vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
+ vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
+ vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
+
+ eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
+ eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
+ eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
+ eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
+ eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
+ eth_queue_release_t rx_queue_release; /**< Release RX queue. */
+ eth_rx_queue_count_t rx_queue_count;
+ /**< Get the number of used RX descriptors. */
+ eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
+ eth_rx_descriptor_status_t rx_descriptor_status;
+ /**< Check the status of a Rx descriptor. */
+ eth_tx_descriptor_status_t tx_descriptor_status;
+ /**< Check the status of a Tx descriptor. */
+ eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
+ eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
+ eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
+ eth_queue_release_t tx_queue_release; /**< Release TX queue. */
+ eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
+
+ eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
+ eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
+
+ flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
+ flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
+ priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
+
+ eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
+ eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
+
+ eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
+ eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
+
+ eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
+ eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
+ eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
+ /** Config ether type of l2 tunnel. */
+ eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
+ /** Enable/disable l2 tunnel offload functions. */
+
+ eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
+
+ rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
+ rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
+ reta_update_t reta_update; /** Update redirection table. */
+ reta_query_t reta_query; /** Query redirection table. */
+
+ eth_get_reg_t get_reg; /**< Get registers. */
+ eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
+ eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
+ eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
+
+
+ eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
+
+ eth_get_dcb_info get_dcb_info; /** Get DCB information. */
+
+ eth_timesync_enable_t timesync_enable;
+ /** Turn IEEE1588/802.1AS timestamping on. */
+ eth_timesync_disable_t timesync_disable;
+ /** Turn IEEE1588/802.1AS timestamping off. */
+ eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
+ /** Read the IEEE1588/802.1AS RX timestamp. */
+ eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
+ /** Read the IEEE1588/802.1AS TX timestamp. */
+ eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
+ eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
+ eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
+
+ eth_xstats_get_by_id_t xstats_get_by_id;
+ /**< Get extended device statistic values by ID. */
+ eth_xstats_get_names_by_id_t xstats_get_names_by_id;
+ /**< Get name of extended device statistics by ID. */
+
+ eth_tm_ops_get_t tm_ops_get;
+ /**< Get Traffic Management (TM) operations. */
+
+ eth_mtr_ops_get_t mtr_ops_get;
+ /**< Get Traffic Metering and Policing (MTR) operations. */
+
+ eth_pool_ops_supported_t pool_ops_supported;
+ /**< Test if a port supports specific mempool ops */
+};
+
+/**
+ * @internal
+ * Structure used to hold information about the callbacks to be called for a
+ * queue on RX and TX.
+ */
+struct rte_eth_rxtx_callback {
+ struct rte_eth_rxtx_callback *next;
+ union{
+ rte_rx_callback_fn rx;
+ rte_tx_callback_fn tx;
+ } fn;
+ void *param;
+};
+
+/**
+ * @internal
+ * The generic data structure associated with each ethernet device.
+ *
+ * Pointers to burst-oriented packet receive and transmit functions are
+ * located at the beginning of the structure, along with the pointer to
+ * where all the data elements for the particular device are stored in shared
+ * memory. This split allows the function pointer and driver data to be per-
+ * process, while the actual configuration data for the device is shared.
+ */
+struct rte_eth_dev {
+ eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
+ eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
+ eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
+ struct rte_eth_dev_data *data; /**< Pointer to device data */
+ const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
+ struct rte_device *device; /**< Backing device */
+ struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
+ /** User application callbacks for NIC interrupts */
+ struct rte_eth_dev_cb_list link_intr_cbs;
+ /**
+ * User-supplied functions called from rx_burst to post-process
+ * received packets before passing them to the user
+ */
+ struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ /**
+ * User-supplied functions called from tx_burst to pre-process
+ * received packets before passing them to the driver for transmission.
+ */
+ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ enum rte_eth_dev_state state; /**< Flag indicating the port state */
+ void *security_ctx; /**< Context for security ops */
+} __rte_cache_aligned;
+
+struct rte_eth_dev_sriov;
+
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each ethernet device.
+ *
+ * This structure is safe to place in shared memory to be common among different
+ * processes in a multi-process configuration.
+ */
+struct rte_eth_dev_data {
+ char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
+
+ void **rx_queues; /**< Array of pointers to RX queues. */
+ void **tx_queues; /**< Array of pointers to TX queues. */
+ uint16_t nb_rx_queues; /**< Number of RX queues. */
+ uint16_t nb_tx_queues; /**< Number of TX queues. */
+
+ struct rte_eth_dev_sriov sriov; /**< SRIOV data */
+
+ void *dev_private; /**< PMD-specific private data */
+
+ struct rte_eth_link dev_link;
+ /**< Link-level information & status */
+
+ struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
+ uint16_t mtu; /**< Maximum Transmission Unit. */
+
+ uint32_t min_rx_buf_size;
+ /**< Common rx buffer size handled by all queues */
+
+ uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
+ struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
+ uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
+ /** bitmap array of associating Ethernet MAC addresses to pools */
+ struct ether_addr* hash_mac_addrs;
+ /** Device Ethernet MAC addresses of hash filtering. */
+ uint16_t port_id; /**< Device [external] port identifier. */
+ __extension__
+ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
+ scattered_rx : 1, /**< RX of scattered packets 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). */
+ lro : 1; /**< RX LRO is ON(1) / OFF(0) */
+ uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint32_t dev_flags; /**< Capabilities */
+ enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
+ int numa_node; /**< NUMA node connection */
+ struct rte_vlan_filter_conf vlan_filter_conf;
+ /**< VLAN filter configuration. */
+};
+
+/**
+ * @internal
+ * The pool of *rte_eth_dev* structures. The size of the pool
+ * is configured at compile-time in the <rte_ethdev.c> file.
+ */
+extern struct rte_eth_dev rte_eth_devices[];
+
+#endif /* _RTE_ETHDEV_COMMON_H_ */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v3 5/6] ethdev: reorder inline functions
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
` (2 preceding siblings ...)
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 4/6] ethdev: separate internal structures into own header Ferruh Yigit
@ 2018-01-17 21:58 ` Ferruh Yigit
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 6/6] ethdev: rename function parameter for consistency Ferruh Yigit
` (3 subsequent siblings)
7 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-17 21:58 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Ferruh Yigit, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
Move all inline function to the end of the ethdev.h header file and move
the ethdev_core.h just before inline functions.
Since inline functions need data structures in ethdev_core.h, this
reorder is to group them and make it clear where put further inline
functions.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 2704 +++++++++++++++++++++--------------------
1 file changed, 1353 insertions(+), 1351 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 4bfa25590..15b2c92f8 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1192,6 +1192,8 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
+struct rte_eth_rxtx_callback;
+
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1214,8 +1216,6 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-#include <rte_ethdev_core.h>
-
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
/** Device is a bonded slave */
@@ -2134,1775 +2134,1777 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id);
*/
int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
+typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
+ void *userdata);
+
/**
+ * Structure used to buffer packets for future TX
+ * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ */
+struct rte_eth_dev_tx_buffer {
+ buffer_tx_error_fn error_callback;
+ void *error_userdata;
+ uint16_t size; /**< Size of buffer for buffered tx */
+ uint16_t length; /**< Number of packets in the array */
+ struct rte_mbuf *pkts[];
+ /**< Pending packets to be sent on explicit flush or when full */
+};
+
+/**
+ * Calculate the size of the tx buffer.
*
- * Retrieve a burst of input packets from a receive queue of an Ethernet
- * device. The retrieved packets are stored in *rte_mbuf* structures whose
- * pointers are supplied in the *rx_pkts* array.
- *
- * The rte_eth_rx_burst() function loops, parsing the RX ring of the
- * receive queue, up to *nb_pkts* packets, and for each completed RX
- * descriptor in the ring, it performs the following operations:
+ * @param sz
+ * Number of stored packets.
+ */
+#define RTE_ETH_TX_BUFFER_SIZE(sz) \
+ (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+
+/**
+ * Initialize default values for buffered transmitting
*
- * - Initialize the *rte_mbuf* data structure associated with the
- * RX descriptor according to the information provided by the NIC into
- * that RX descriptor.
+ * @param buffer
+ * Tx buffer to be initialized.
+ * @param size
+ * Buffer size
+ * @return
+ * 0 if no error
+ */
+int
+rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+
+/**
+ * Configure a callback for buffered packets which cannot be sent
*
- * - Store the *rte_mbuf* data structure into the next entry of the
- * *rx_pkts* array.
+ * Register a specific callback to be called when an attempt is made to send
+ * all packets buffered on an ethernet port, but not all packets can
+ * successfully be sent. The callback registered here will be called only
+ * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
+ * The default callback configured for each queue by default just frees the
+ * packets back to the calling mempool. If additional behaviour is required,
+ * for example, to count dropped packets, or to retry transmission of packets
+ * which cannot be sent, this function should be used to register a suitable
+ * callback function to implement the desired behaviour.
+ * The example callback "rte_eth_count_unsent_packet_callback()" is also
+ * provided as reference.
*
- * - Replenish the RX descriptor with a new *rte_mbuf* buffer
- * allocated from the memory pool associated with the receive queue at
- * initialization time.
+ * @param buffer
+ * The port identifier of the Ethernet device.
+ * @param callback
+ * The function to be used as the callback.
+ * @param userdata
+ * Arbitrary parameter to be passed to the callback function
+ * @return
+ * 0 on success, or -1 on error with rte_errno set appropriately
+ */
+int
+rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
+ buffer_tx_error_fn callback, void *userdata);
+
+/**
+ * Callback function for silently dropping unsent buffered packets.
*
- * When retrieving an input packet that was scattered by the controller
- * into multiple receive descriptors, the rte_eth_rx_burst() function
- * appends the associated *rte_mbuf* buffers to the first buffer of the
- * packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets silently and is used by tx buffered
+ * operations as default behavior.
*
- * The rte_eth_rx_burst() function returns the number of packets
- * actually retrieved, which is the number of *rte_mbuf* data structures
- * effectively supplied into the *rx_pkts* array.
- * A return value equal to *nb_pkts* indicates that the RX queue contained
- * at least *rx_pkts* packets, and this is likely to signify that other
- * received packets remain in the input queue. Applications implementing
- * a "retrieve as much received packets as possible" policy can check this
- * specific case and keep invoking the rte_eth_rx_burst() function until
- * a value less than *nb_pkts* is returned.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * This receive method has the following advantages:
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * - It allows a run-to-completion network stack engine to retrieve and
- * to immediately process received packets in a fast burst-oriented
- * approach, avoiding the overhead of unnecessary intermediate packet
- * queue/dequeue operations.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Not used
+ */
+void
+rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Callback function for tracking unsent buffered packets.
*
- * - Conversely, it also allows an asynchronous-oriented processing
- * method to retrieve bursts of received packets and to immediately
- * queue them for further parallel processing by another logical core,
- * for instance. However, instead of having received packets being
- * individually queued by the driver, this approach allows the caller
- * of the rte_eth_rx_burst() function to queue a burst of retrieved
- * packets at a time and therefore dramatically reduce the cost of
- * enqueue/dequeue operations per packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets, but also updates a user-supplied counter
+ * to track the overall number of packets dropped. The counter should be an
+ * uint64_t variable.
*
- * - It allows the rte_eth_rx_burst() function of the driver to take
- * advantage of burst-oriented hardware features (CPU cache,
- * prefetch instructions, and so on) to minimize the number of CPU
- * cycles per packet.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * To summarize, the proposed receive API enables many
- * burst-oriented optimizations in both synchronous and asynchronous
- * packet processing environments with no overhead in both cases.
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * The rte_eth_rx_burst() function does not provide any error
- * notification to avoid the corresponding overhead. As a hint, the
- * upper-level application might check the status of the device link once
- * being systematically returned a 0 value for a given number of tries.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Pointer to an uint64_t value, which will be incremented by unsent
+ */
+void
+rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Request the driver to free mbufs currently cached by the driver. The
+ * driver will only free the mbuf if it is no longer in use. It is the
+ * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
+ * called if needed.
*
* @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
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
* to rte_eth_dev_configure().
- * @param rx_pkts
- * The address of an array of pointers to *rte_mbuf* structures that
- * must be large enough to store *nb_pkts* pointers in it.
- * @param nb_pkts
- * The maximum number of packets to retrieve.
+ * @param free_cnt
+ * Maximum number of packets to free. Use 0 to indicate all possible packets
+ * should be freed. Note that a packet may be using multiple mbufs.
* @return
- * The number of packets actually retrieved, which is the number
- * of pointers to *rte_mbuf* structures effectively supplied to the
- * *rx_pkts* array.
+ * Failure: < 0
+ * -ENODEV: Invalid interface
+ * -ENOTSUP: Driver does not support function
+ * Success: >= 0
+ * 0-n: Number of packets freed. More packets may still remain in ring that
+ * are in use.
*/
-static inline uint16_t
-rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+int
+rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
- if (queue_id >= dev->data->nb_rx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
- int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
- rx_pkts, nb_pkts);
+/**
+ * The eth device event type for interrupt, and maybe others in the future.
+ */
+enum rte_eth_event_type {
+ RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
+ RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
+ RTE_ETH_EVENT_QUEUE_STATE,
+ /**< queue state event (enabled/disabled) */
+ RTE_ETH_EVENT_INTR_RESET,
+ /**< reset interrupt event, sent to VF on PF reset */
+ RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
+ RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
+ 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_MAX /**< max value of this enum */
+};
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
+ enum rte_eth_event_type event, void *cb_arg, void *ret_param);
+/**< user application callback to be registered for interrupts */
- if (unlikely(cb != NULL)) {
- do {
- nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
- nb_pkts, cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
- return nb_rx;
-}
/**
- * Get the number of used descriptors of a rx queue
+ * Register a callback function for port event.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
+ * Port id.
+ * RTE_ETH_ALL means register the event for all port ids.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback.
+ *
* @return
- * The number of used descriptors in the specific queue, or:
- * (-EINVAL) if *port_id* or *queue_id* is invalid
- * (-ENOTSUP) if the device does not support this function
- */
-static inline int
-rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
- dev = &rte_eth_devices[port_id];
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
- if (queue_id >= dev->data->nb_rx_queues)
- return -EINVAL;
-
- return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
-}
+ * - On success, zero.
+ * - On failure, a negative value.
+ */
+int rte_eth_dev_callback_register(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check if the DD bit of the specific RX descriptor in the queue has been set
+ * Unregister a callback function for port event.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
- * @param offset
- * The offset of the descriptor ID from tail.
+ * Port id.
+ * RTE_ETH_ALL means unregister the event for all port ids.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback. -1 means to
+ * remove all for the same callback address and same event.
+ *
* @return
- * - (1) if the specific DD bit is set.
- * - (0) if the specific DD bit is not set.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
- return (*dev->dev_ops->rx_descriptor_done)( \
- dev->data->rx_queues[queue_id], offset);
-}
-
-#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
-#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
-#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_callback_unregister(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check the status of a Rx descriptor in the queue
- *
- * It should be called in a similar context than the Rx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * 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 packet arrives.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_enable() function enables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Rx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the next
- * packet to be received by the driver).
- *
+ * 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
- * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
- * receive a packet.
- * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
- * not yet processed by the driver (i.e. in the receive queue).
- * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
- * the driver and not yet returned to hw, or reserved by the hw.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-static inline int
-rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
- uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *rxq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_rx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
- rxq = dev->data->rx_queues[queue_id];
-
- return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
-}
-
-#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
-#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
-#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
/**
- * Check the status of a Tx descriptor in the queue.
- *
- * It should be called in a similar context than the Tx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * When lcore wakes up from rx interrupt indicating packet coming, disable rx
+ * interrupt and returns to polling mode.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_disable() function disables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Tx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the place where
- * the next packet will be send).
- *
+ * 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
- * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
- * in the transmit queue.
- * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
- * be reused by the driver.
- * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
- * driver or the hardware.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
- uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *txq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
- txq = dev->data->tx_queues[queue_id];
-
- return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
-}
+int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
/**
- * Send a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_burst() function is invoked to transmit output packets
- * on the output queue *queue_id* of the Ethernet device designated by its
- * *port_id*.
- * The *nb_pkts* parameter is the number of packets to send which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
- * up to the number of transmit descriptors available in the TX ring of the
- * transmit queue.
- * For each packet to send, the rte_eth_tx_burst() function performs
- * the following operations:
- *
- * - Pick up the next available descriptor in the transmit ring.
- *
- * - Free the network buffer previously sent with that descriptor, if any.
- *
- * - Initialize the transmit descriptor with the information provided
- * in the *rte_mbuf data structure.
- *
- * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
- * the rte_eth_tx_burst() function uses several transmit descriptors
- * of the ring.
- *
- * The rte_eth_tx_burst() function returns the number of packets it
- * actually sent. A return value equal to *nb_pkts* means that all packets
- * have been sent, and this is likely to signify that other output packets
- * could be immediately transmitted again. Applications that implement a
- * "send as many packets to transmit as possible" policy can check this
- * specific case and keep invoking the rte_eth_tx_burst() function until
- * a value less than *nb_pkts* is returned.
- *
- * It is the responsibility of the rte_eth_tx_burst() function to
- * transparently free the memory buffers of packets previously sent.
- * This feature is driven by the *tx_free_thresh* value supplied to the
- * rte_eth_dev_configure() function at device configuration time.
- * When the number of free TX descriptors drops below this threshold, the
- * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
- * of those packets whose transmission was effectively completed.
- *
- * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
- * invoke this function concurrently on the same tx queue without SW lock.
- * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
+ * RX Interrupt control per port.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to transmit.
+ * @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
- * The number of output packets actually stored in transmit descriptors of
- * the transmit ring. The return value can be less than the value of the
- * *tx_pkts* parameter when the transmit ring is full or has been filled up.
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline uint16_t
-rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
-
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
-
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
-
- if (unlikely(cb != NULL)) {
- do {
- nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
- cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
-
- return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
-}
+int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
/**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
- * Process a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
- * transmitted on the output queue *queue_id* of the Ethernet device designated
- * by its *port_id*.
- * The *nb_pkts* parameter is the number of packets to be prepared which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * For each packet to send, the rte_eth_tx_prepare() function performs
- * the following operations:
- *
- * - Check if packet meets devices requirements for tx offloads.
- *
- * - Check limitations about number of segments.
- *
- * - Check additional requirements when debug is enabled.
- *
- * - Update and/or reset required checksums when tx offload is set for packet.
- *
- * Since this function can modify packet data, provided mbufs must be safely
- * writable (e.g. modified data cannot be in shared segment).
- *
- * The rte_eth_tx_prepare() function returns the number of packets ready to be
- * sent. A return value equal to *nb_pkts* means that all packets are valid and
- * ready to be sent, otherwise stops processing on the first invalid packet and
- * leaves the rest packets untouched.
- *
- * When this functionality is not implemented in the driver, all packets are
- * are returned untouched.
+ * RX Interrupt control per queue.
*
* @param port_id
* The port identifier of the Ethernet device.
- * The value must be a valid port id.
* @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * 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 tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to process.
+ * @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
- * The number of packets correct and ready to be sent. The return value can be
- * less than the value of the *tx_pkts* parameter when some packet doesn't
- * meet devices requirements with rte_errno set appropriately:
- * - -EINVAL: offload flags are not correctly set
- * - -ENOTSUP: the offload feature is not supported by the hardware
- *
- */
-
-#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
-
-static inline uint16_t
-rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (!rte_eth_dev_is_valid_port(port_id)) {
- RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- if (!dev->tx_pkt_prepare)
- return nb_pkts;
-
- return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
- tx_pkts, nb_pkts);
-}
-
-#else
-
-/*
- * Native NOOP operation for compilation targets which doesn't require any
- * preparations steps, and functional NOOP may introduce unnecessary performance
- * drop.
- *
- * Generally this is not a good idea to turn it on globally and didn't should
- * be used if behavior of tx_preparation can change.
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-
-static inline uint16_t
-rte_eth_tx_prepare(__rte_unused uint16_t port_id,
- __rte_unused uint16_t queue_id,
- __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- return nb_pkts;
-}
-
-#endif
-
-typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
- void *userdata);
+int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
+ int epfd, int op, void *data);
/**
- * Structure used to buffer packets for future TX
- * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ * Turn on the LED on the Ethernet device.
+ * This function turns on the LED on the Ethernet device.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-struct rte_eth_dev_tx_buffer {
- buffer_tx_error_fn error_callback;
- void *error_userdata;
- uint16_t size; /**< Size of buffer for buffered tx */
- uint16_t length; /**< Number of packets in the array */
- struct rte_mbuf *pkts[];
- /**< Pending packets to be sent on explicit flush or when full */
-};
+int rte_eth_led_on(uint16_t port_id);
/**
- * Calculate the size of the tx buffer.
+ * Turn off the LED on the Ethernet device.
+ * This function turns off the LED on the Ethernet device.
*
- * @param sz
- * Number of stored packets.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-#define RTE_ETH_TX_BUFFER_SIZE(sz) \
- (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+int rte_eth_led_off(uint16_t port_id);
/**
- * Initialize default values for buffered transmitting
+ * Get current status of the Ethernet link flow control for Ethernet device
*
- * @param buffer
- * Tx buffer to be initialized.
- * @param size
- * Buffer size
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure where to store the flow control parameters.
* @return
- * 0 if no error
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control.
+ * - (-ENODEV) if *port_id* invalid.
*/
-int
-rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Send any packets queued up for transmission on a port and HW queue
- *
- * This causes an explicit flush of packets previously buffered via the
- * rte_eth_tx_buffer() function. It returns the number of packets successfully
- * sent to the NIC, and calls the error callback for any unsent packets. Unless
- * explicitly set up otherwise, the default callback simply frees the unsent
- * packets back to the owning mempool.
+ * Configure the Ethernet link flow control for Ethernet device
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer of packets to be transmit.
+ * @param fc_conf
+ * The pointer to the structure of the flow control parameters.
* @return
- * The number of packets successfully sent to the Ethernet device. The error
- * callback is called for any packets which could not be sent.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure
*/
-static inline uint16_t
-rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer)
-{
- uint16_t sent;
- uint16_t to_send = buffer->length;
-
- if (to_send == 0)
- return 0;
-
- sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
-
- buffer->length = 0;
-
- /* All packets sent, or to be dealt with by callback below */
- if (unlikely(sent != to_send))
- buffer->error_callback(&buffer->pkts[sent], to_send - sent,
- buffer->error_userdata);
-
- return sent;
-}
+int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Buffer a single packet for future transmission on a port and queue
- *
- * This function takes a single mbuf/packet and buffers it for later
- * transmission on the particular port and queue specified. Once the buffer is
- * full of packets, an attempt will be made to transmit all the buffered
- * packets. In case of error, where not all packets can be transmitted, a
- * callback is called with the unsent packets as a parameter. If no callback
- * is explicitly set up, the unsent packets are just freed back to the owning
- * mempool. The function returns the number of packets actually sent i.e.
- * 0 if no buffer flush occurred, otherwise the number of packets successfully
- * flushed
+ * Configure the Ethernet priority flow control under DCB environment
+ * for Ethernet device.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer used to collect packets to be sent.
- * @param tx_pkt
- * Pointer to the packet mbuf to be sent.
+ * The port identifier of the Ethernet device.
+ * @param pfc_conf
+ * The pointer to the structure of the priority flow control parameters.
* @return
- * 0 = packet has been buffered for later transmission
- * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
- * causing N packets to be sent, and the error callback to be called for
- * the rest.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure
*/
-static __rte_always_inline uint16_t
-rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
-{
- buffer->pkts[buffer->length++] = tx_pkt;
- if (buffer->length < buffer->size)
- return 0;
-
- return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
-}
+int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_pfc_conf *pfc_conf);
/**
- * Configure a callback for buffered packets which cannot be sent
- *
- * Register a specific callback to be called when an attempt is made to send
- * all packets buffered on an ethernet port, but not all packets can
- * successfully be sent. The callback registered here will be called only
- * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
- * The default callback configured for each queue by default just frees the
- * packets back to the calling mempool. If additional behaviour is required,
- * for example, to count dropped packets, or to retry transmission of packets
- * which cannot be sent, this function should be used to register a suitable
- * callback function to implement the desired behaviour.
- * The example callback "rte_eth_count_unsent_packet_callback()" is also
- * provided as reference.
+ * Add a MAC address to an internal array of addresses used to enable whitelist
+ * filtering to accept packets only if the destination MAC address matches.
*
- * @param buffer
+ * @param port
* The port identifier of the Ethernet device.
- * @param callback
- * The function to be used as the callback.
- * @param userdata
- * Arbitrary parameter to be passed to the callback function
+ * @param mac_addr
+ * The MAC address to add.
+ * @param pool
+ * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
+ * not enabled, this should be set to 0.
* @return
- * 0 on success, or -1 on error with rte_errno set appropriately
+ * - (0) if successfully added or *mac_addr" was already added.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port* is invalid.
+ * - (-ENOSPC) if no more MAC addresses can be added.
+ * - (-EINVAL) if MAC address is invalid.
*/
-int
-rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
- buffer_tx_error_fn callback, void *userdata);
+int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+ uint32_t pool);
/**
- * Callback function for silently dropping unsent buffered packets.
- *
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets silently and is used by tx buffered
- * operations as default behavior.
- *
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
- *
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * Remove a MAC address from the internal array of addresses.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Not used
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param mac_addr
+ * MAC address to remove.
+ * @return
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-void
-rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
/**
- * Callback function for tracking unsent buffered packets.
- *
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets, but also updates a user-supplied counter
- * to track the overall number of packets dropped. The counter should be an
- * uint64_t variable.
- *
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
- *
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * Set the default MAC address.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Pointer to an uint64_t value, which will be incremented by unsent
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param mac_addr
+ * New default MAC address.
+ * @return
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EINVAL) if MAC address is invalid.
*/
-void
-rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_dev_default_mac_addr_set(uint16_t port,
+ struct ether_addr *mac_addr);
/**
- * Request the driver to free mbufs currently cached by the driver. The
- * driver will only free the mbuf if it is no longer in use. It is the
- * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
- * called if needed.
+ * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port_id
+ * @param port
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param free_cnt
- * Maximum number of packets to free. Use 0 to indicate all possible packets
- * should be freed. Note that a packet may be using multiple mbufs.
+ * @param reta_conf
+ * RETA to update.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
* @return
- * Failure: < 0
- * -ENODEV: Invalid interface
- * -ENOTSUP: Driver does not support function
- * Success: >= 0
- * 0-n: Number of packets freed. More packets may still remain in ring that
- * are in use.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-int
-rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
+int rte_eth_dev_rss_reta_update(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
-/**
- * The eth device event type for interrupt, and maybe others in the future.
+ /**
+ * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+ *
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to query.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-enum rte_eth_event_type {
- RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
- RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
- RTE_ETH_EVENT_QUEUE_STATE,
- /**< queue state event (enabled/disabled) */
- RTE_ETH_EVENT_INTR_RESET,
- /**< reset interrupt event, sent to VF on PF reset */
- RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
- RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
- 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_MAX /**< max value of this enum */
-};
-
-typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
- enum rte_eth_event_type event, void *cb_arg, void *ret_param);
-/**< user application callback to be registered for interrupts */
-
-
+int rte_eth_dev_rss_reta_query(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
-/**
- * Register a callback function for port event.
- *
- * @param port_id
- * Port id.
- * RTE_ETH_ALL means register the event for all port ids.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback.
+ /**
+ * Updates unicast hash table for receiving packet with the given destination
+ * MAC address, and the packet is routed to all VFs for which the RX mode is
+ * accept packets that match the unicast hash table.
*
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param addr
+ * Unicast MAC address.
+ * @param on
+ * 1 - Set an unicast hash bit for receiving packets with the MAC address.
+ * 0 - Clear an unicast hash bit.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_register(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+ uint8_t on);
-/**
- * Unregister a callback function for port event.
- *
- * @param port_id
- * Port id.
- * RTE_ETH_ALL means unregister the event for all port ids.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback. -1 means to
- * remove all for the same callback address and same event.
+ /**
+ * Updates all unicast hash bitmaps for receiving packet with any Unicast
+ * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
+ * mode is accept packets that match the unicast hash table.
*
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param on
+ * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
+ * MAC addresses
+ * 0 - Clear all unicast hash bitmaps
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_unregister(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
/**
- * 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 packet arrives.
- *
- * The rte_eth_dev_rx_intr_enable() function enables rx queue
- * interrupt on specific rx queue of a port.
+ * Set a traffic mirroring rule on an Ethernet device
*
* @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 mirror_conf
+ * The pointer to the traffic mirroring structure describing the mirroring rule.
+ * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
+ * destination pool and the value of rule if enable vlan or pool mirroring.
+ *
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
+ * @param on
+ * 1 - Enable a mirroring rule.
+ * 0 - Disable a mirroring rule.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if the mr_conf information is not correct.
*/
-int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
+int rte_eth_mirror_rule_set(uint16_t port_id,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
/**
- * 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.
+ * Reset a traffic mirroring rule on an Ethernet device.
*
* @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 rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
+int rte_eth_mirror_rule_reset(uint16_t port_id,
+ uint8_t rule_id);
/**
- * RX Interrupt control per port.
+ * Set the rate limitation for a queue on an Ethernet device.
*
* @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.
+ * @param queue_idx
+ * The queue id.
+ * @param tx_rate
+ * The tx rate in Mbps. Allocated from the total port link speed.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
+int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
+ uint16_t tx_rate);
-/**
- * RX Interrupt control per queue.
+ /**
+ * Configuration of Receive Side Scaling hash computation of Ethernet device.
*
* @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.
+ * @param rss_conf
+ * The new configuration to use for RSS hash computation on the port.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
- int epfd, int op, void *data);
+int rte_eth_dev_rss_hash_update(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * Turn on the LED on the Ethernet device.
- * This function turns on the LED on the Ethernet device.
+ /**
+ * Retrieve current configuration of Receive Side Scaling hash computation
+ * of Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param rss_conf
+ * Where to store the current RSS hash configuration of the Ethernet device.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support RSS.
*/
-int rte_eth_led_on(uint16_t port_id);
+int
+rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * Turn off the LED on the Ethernet device.
- * This function turns off the LED on the Ethernet device.
+ /**
+ * Add UDP tunneling port for a specific type of tunnel.
+ * The packets with this UDP port will be identified as this type of tunnel.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to change or add more UDP port for the tunnel. So the offloading function
+ * can take effect on the packets with the specific UDP port.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_led_off(uint16_t port_id);
+int
+rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
-/**
- * Get current status of the Ethernet link flow control for Ethernet device
+ /**
+ * Delete UDP tunneling port a specific type of tunnel.
+ * The packets with this UDP port will not be identified as this type of tunnel
+ * any more.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to delete a UDP port for the tunnel. So the offloading function will not take
+ * effect on the packets with the specific UDP port.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure where to store the flow control parameters.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+int
+rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
/**
- * Configure the Ethernet link flow control for Ethernet device
+ * Check whether the filter type is supported on an Ethernet device.
+ * All the supported filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure of the flow control parameters.
+ * @param filter_type
+ * Filter type.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure
+ * - (-ENOTSUP) if hardware doesn't support this filter type.
+ * - (-ENODEV) if *port_id* invalid.
*/
-int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+int rte_eth_dev_filter_supported(uint16_t port_id,
+ enum rte_filter_type filter_type);
/**
- * Configure the Ethernet priority flow control under DCB environment
- * for Ethernet device.
+ * Take operations to assigned filter type on an Ethernet device.
+ * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param pfc_conf
- * The pointer to the structure of the priority flow control parameters.
+ * The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
+ * @param filter_op
+ * Type of operation.
+ * @param arg
+ * A pointer to arguments defined specifically for the operation.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_pfc_conf *pfc_conf);
+int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op, void *arg);
/**
- * Add a MAC address to an internal array of addresses used to enable whitelist
- * filtering to accept packets only if the destination MAC address matches.
+ * Get DCB information on an Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * The MAC address to add.
- * @param pool
- * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
- * not enabled, this should be set to 0.
+ * @param dcb_info
+ * dcb information.
* @return
- * - (0) if successfully added or *mac_addr" was already added.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port* is invalid.
- * - (-ENOSPC) if no more MAC addresses can be added.
- * - (-EINVAL) if MAC address is invalid.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
- uint32_t pool);
+int rte_eth_dev_get_dcb_info(uint16_t port_id,
+ struct rte_eth_dcb_info *dcb_info);
/**
- * Remove a MAC address from the internal array of addresses.
+ * Add a callback to be called on packet RX on a given port and queue.
+ *
+ * This API configures a function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
*
- * @param port
- * The port identifier of the Ethernet device.
- * @param mac_addr
- * MAC address to remove.
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EADDRINUSE) if attempting to remove the default MAC address
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+struct rte_eth_rxtx_callback *
+rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Set the default MAC address.
+ * Add a callback that must be called first on packet RX on a given port
+ * and queue.
*
- * @param port
+ * This API configures a first function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * New default MAC address.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EINVAL) if MAC address is invalid.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
- struct ether_addr *mac_addr);
+struct rte_eth_rxtx_callback *
+rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+ * Add a callback to be called on packet TX on a given port and queue.
*
- * @param port
+ * This API configures a function to be called for each burst of
+ * packets sent on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_tx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to update.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_rss_reta_update(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+struct rte_eth_rxtx_callback *
+rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_tx_callback_fn fn, void *user_param);
- /**
- * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+/**
+ * Remove an RX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_rx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to query.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_rx_callback().
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_rss_reta_query(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
- /**
- * Updates unicast hash table for receiving packet with the given destination
- * MAC address, and the packet is routed to all VFs for which the RX mode is
- * accept packets that match the unicast hash table.
+/**
+ * Remove a TX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_tx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param addr
- * Unicast MAC address.
- * @param on
- * 1 - Set an unicast hash bit for receiving packets with the MAC address.
- * 0 - Clear an unicast hash bit.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_tx_callback().
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
- uint8_t on);
+int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
- /**
- * Updates all unicast hash bitmaps for receiving packet with any Unicast
- * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
- * mode is accept packets that match the unicast hash table.
+/**
+ * Retrieve information about given port's RX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param on
- * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
- * MAC addresses
- * 0 - Clear all unicast hash bitmaps
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - 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_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
/**
- * Set a traffic mirroring rule on an Ethernet device
+ * Retrieve information about given port's TX queue.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param mirror_conf
- * The pointer to the traffic mirroring structure describing the mirroring rule.
- * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
- * destination pool and the value of rule if enable vlan or pool mirroring.
+ * @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.
*
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
- * @param on
- * 1 - Enable a mirroring rule.
- * 0 - Disable a mirroring rule.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if the mr_conf information is not correct.
+ * - 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_mirror_rule_set(uint16_t port_id,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
+int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
/**
- * Reset a traffic mirroring rule on an Ethernet device.
+ * Retrieve device registers and register attributes (number of registers and
+ * register size)
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
+ * @param info
+ * Pointer to rte_dev_reg_info structure to fill in. If info->data is
+ * NULL the function fills in the width and length fields. If non-NULL
+ * the registers are put into the buffer pointed at by the data field.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_reset(uint16_t port_id,
- uint8_t rule_id);
+int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
/**
- * Set the rate limitation for a queue on an Ethernet device.
+ * Retrieve size of device EEPROM
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_idx
- * The queue id.
- * @param tx_rate
- * The tx rate in Mbps. Allocated from the total port link speed.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (>=0) EEPROM size if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
- uint16_t tx_rate);
+int rte_eth_dev_get_eeprom_length(uint16_t port_id);
- /**
- * Configuration of Receive Side Scaling hash computation of Ethernet device.
+/**
+ * Retrieve EEPROM and EEPROM attribute
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * The new configuration to use for RSS hash computation on the port.
+ * @param info
+ * The template includes buffer for return EEPROM data and
+ * EEPROM attributes to be filled.
* @return
* - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_rss_hash_update(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
- /**
- * Retrieve current configuration of Receive Side Scaling hash computation
- * of Ethernet device.
+/**
+ * Program EEPROM with provided data
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * Where to store the current RSS hash configuration of the Ethernet device.
+ * @param info
+ * The template includes EEPROM data for programming and
+ * EEPROM attributes to be filled
* @return
* - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support RSS.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int
-rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
- /**
- * Add UDP tunneling port for a specific type of tunnel.
- * The packets with this UDP port will be identified as this type of tunnel.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to change or add more UDP port for the tunnel. So the offloading function
- * can take effect on the packets with the specific UDP port.
+/**
+ * Set the list of multicast addresses to filter on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
- *
+ * @param mc_addr_set
+ * The array of multicast addresses to set. Equal to NULL when the function
+ * is invoked to flush the set of filtered addresses.
+ * @param nb_mc_addr
+ * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
+ * when the function is invoked to flush the set of filtered addresses.
* @return
* - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
+ * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
*/
-int
-rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
- /**
- * Delete UDP tunneling port a specific type of tunnel.
- * The packets with this UDP port will not be identified as this type of tunnel
- * any more.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to delete a UDP port for the tunnel. So the offloading function will not take
- * effect on the packets with the specific UDP port.
+/**
+ * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_enable(uint16_t port_id);
/**
- * Check whether the filter type is supported on an Ethernet device.
- * All the supported filter types are defined in 'rte_eth_ctrl.h'.
+ * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param filter_type
- * Filter type.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this filter type.
- * - (-ENODEV) if *port_id* invalid.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_supported(uint16_t port_id,
- enum rte_filter_type filter_type);
+int rte_eth_timesync_disable(uint16_t port_id);
/**
- * Take operations to assigned filter type on an Ethernet device.
- * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
+ * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param filter_type
- * Filter type.
- * @param filter_op
- * Type of operation.
- * @param arg
- * A pointer to arguments defined specifically for the operation.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ * @param flags
+ * Device specific flags. Used to pass the RX timesync register index to
+ * i40e. Unused in igb/ixgbe, pass 0 instead.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
- enum rte_filter_op filter_op, void *arg);
+int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
+ struct timespec *timestamp, uint32_t flags);
/**
- * Get DCB information on an Ethernet device.
+ * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param dcb_info
- * dcb information.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_get_dcb_info(uint16_t port_id,
- struct rte_eth_dcb_info *dcb_info);
+int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
+ struct timespec *timestamp);
/**
- * Add a callback to be called on packet RX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
+ * Adjust the timesync clock on an Ethernet device.
*
- * Multiple functions are called in the order that they are added.
+ * 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 queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param delta
+ * The adjustment in nanoseconds.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-struct rte_eth_rxtx_callback *
-rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
/**
- * Add a callback that must be called first on packet RX on a given port
- * and queue.
- *
- * This API configures a first function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
+ * Read the time from the timesync clock on an Ethernet device.
*
- * Multiple functions are called in the order that they are added.
+ * 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 queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - 0: Success.
*/
-struct rte_eth_rxtx_callback *
-rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
/**
- * Add a callback to be called on packet TX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets sent on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_tx_callback().
+ * Set the time of the timesync clock on an Ethernet device.
*
- * Multiple functions are called in the order that they are added.
+ * 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 queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-struct rte_eth_rxtx_callback *
-rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
- rte_tx_callback_fn fn, void *user_param);
+int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
/**
- * Remove an RX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_rx_callback().
+ * Config l2 tunnel ether type of an Ethernet device for filtering specific
+ * tunnel packets by ether type.
*
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_rx_callback().
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param l2_tunnel
+ * l2 tunnel configuration.
*
* @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int
+rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel);
/**
- * Remove a TX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_tx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
+ * Enable/disable l2 tunnel offload functions. Include,
+ * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
+ * Filtering, forwarding and offloading this type of tunnel packets depend on
+ * this ability.
+ * 2, Stripping the l2 tunnel tag.
+ * 3, Insertion of the l2 tunnel tag.
+ * 4, Forwarding the packets based on the l2 tunnel tag.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_tx_callback().
+ * @param l2_tunnel
+ * l2 tunnel parameters.
+ * @param mask
+ * Indicate the offload function.
+ * @param en
+ * Enable or disable this function.
*
* @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int
+rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
/**
- * 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(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxq_info *qinfo);
+* Get the port id from pci address or device name
+* Ex: 0000:2:00.0 or vdev name net_pcap0
+*
+* @param name
+* pci address or name of the device
+* @param port_id
+* pointer to port identifier of the device
+* @return
+* - (0) if successful and port_id is filled.
+* - (-ENODEV or -EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
/**
- * 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(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_txq_info *qinfo);
+* Get the device name from port id
+*
+* @param port_id
+* pointer to port identifier of the device
+* @param name
+* pci address or name of the device
+* @return
+* - (0) if successful.
+* - (-EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
/**
- * Retrieve device registers and register attributes (number of registers and
- * register size)
+ * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
+ * the ethernet device information, otherwise adjust them to boundaries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param info
- * Pointer to rte_dev_reg_info structure to fill in. If info->data is
- * NULL the function fills in the width and length fields. If non-NULL
- * the registers are put into the buffer pointed at by the data field.
+ * @param nb_rx_desc
+ * A pointer to a uint16_t where the number of receive
+ * descriptors stored.
+ * @param nb_tx_desc
+ * A pointer to a uint16_t where the number of transmit
+ * descriptors stored.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
*/
-int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
+int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
+ uint16_t *nb_rx_desc,
+ uint16_t *nb_tx_desc);
-/**
- * Retrieve size of device EEPROM
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @return
- * - (>=0) EEPROM size if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_eeprom_length(uint16_t port_id);
/**
- * Retrieve EEPROM and EEPROM attribute
+ * Test if a port supports specific mempool ops.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes buffer for return EEPROM data and
- * EEPROM attributes to be filled.
+ * Port identifier of the Ethernet device.
+ * @param [in] pool
+ * The name of the pool operations to test.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - 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_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+int
+rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
-/**
- * Program EEPROM with provided data
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes EEPROM data for programming and
- * EEPROM attributes to be filled
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+#include <rte_ethdev_core.h>
/**
- * Set the list of multicast addresses to filter on an Ethernet device.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param mc_addr_set
- * The array of multicast addresses to set. Equal to NULL when the function
- * is invoked to flush the set of filtered addresses.
- * @param nb_mc_addr
- * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
- * when the function is invoked to flush the set of filtered addresses.
- * @return
- * - (0) if successful.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
- * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
- */
-int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-
-/**
- * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * Retrieve a burst of input packets from a receive queue of an Ethernet
+ * device. The retrieved packets are stored in *rte_mbuf* structures whose
+ * pointers are supplied in the *rx_pkts* array.
*
- * @param port_id
- * The port identifier of the Ethernet device.
+ * The rte_eth_rx_burst() function loops, parsing the RX ring of the
+ * receive queue, up to *nb_pkts* packets, and for each completed RX
+ * descriptor in the ring, it performs the following operations:
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_enable(uint16_t port_id);
-
-/**
- * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * - Initialize the *rte_mbuf* data structure associated with the
+ * RX descriptor according to the information provided by the NIC into
+ * that RX descriptor.
*
- * @param port_id
- * The port identifier of the Ethernet device.
+ * - Store the *rte_mbuf* data structure into the next entry of the
+ * *rx_pkts* array.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_disable(uint16_t port_id);
-
-/**
- * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
+ * - Replenish the RX descriptor with a new *rte_mbuf* buffer
+ * allocated from the memory pool associated with the receive queue at
+ * initialization time.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
- * @param flags
- * Device specific flags. Used to pass the RX timesync register index to
- * i40e. Unused in igb/ixgbe, pass 0 instead.
+ * When retrieving an input packet that was scattered by the controller
+ * into multiple receive descriptors, the rte_eth_rx_burst() function
+ * appends the associated *rte_mbuf* buffers to the first buffer of the
+ * packet.
*
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
- struct timespec *timestamp, uint32_t flags);
-
-/**
- * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
+ * The rte_eth_rx_burst() function returns the number of packets
+ * actually retrieved, which is the number of *rte_mbuf* data structures
+ * effectively supplied into the *rx_pkts* array.
+ * A return value equal to *nb_pkts* indicates that the RX queue contained
+ * at least *rx_pkts* packets, and this is likely to signify that other
+ * received packets remain in the input queue. Applications implementing
+ * a "retrieve as much received packets as possible" policy can check this
+ * specific case and keep invoking the rte_eth_rx_burst() function until
+ * a value less than *nb_pkts* is returned.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
+ * This receive method has the following advantages:
*
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
- struct timespec *timestamp);
-
-/**
- * Adjust the timesync clock on an Ethernet device.
+ * - It allows a run-to-completion network stack engine to retrieve and
+ * to immediately process received packets in a fast burst-oriented
+ * approach, avoiding the overhead of unnecessary intermediate packet
+ * queue/dequeue operations.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * - Conversely, it also allows an asynchronous-oriented processing
+ * method to retrieve bursts of received packets and to immediately
+ * queue them for further parallel processing by another logical core,
+ * for instance. However, instead of having received packets being
+ * individually queued by the driver, this approach allows the caller
+ * of the rte_eth_rx_burst() function to queue a burst of retrieved
+ * packets at a time and therefore dramatically reduce the cost of
+ * enqueue/dequeue operations per packet.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param delta
- * The adjustment in nanoseconds.
+ * - It allows the rte_eth_rx_burst() function of the driver to take
+ * advantage of burst-oriented hardware features (CPU cache,
+ * prefetch instructions, and so on) to minimize the number of CPU
+ * cycles per packet.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
-
-/**
- * Read the time from the timesync clock on an Ethernet device.
+ * To summarize, the proposed receive API enables many
+ * burst-oriented optimizations in both synchronous and asynchronous
+ * packet processing environments with no overhead in both cases.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * The rte_eth_rx_burst() function does not provide any error
+ * notification to avoid the corresponding overhead. As a hint, the
+ * upper-level application might check the status of the device link once
+ * being systematically returned a 0 value for a given number of tries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
- *
+ * @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 rx_pkts
+ * The address of an array of pointers to *rte_mbuf* structures that
+ * must be large enough to store *nb_pkts* pointers in it.
+ * @param nb_pkts
+ * The maximum number of packets to retrieve.
* @return
- * - 0: Success.
+ * The number of packets actually retrieved, which is the number
+ * of pointers to *rte_mbuf* structures effectively supplied to the
+ * *rx_pkts* array.
*/
-int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
+static inline uint16_t
+rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_rx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+ int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
+ rx_pkts, nb_pkts);
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
+ nb_pkts, cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return nb_rx;
+}
/**
- * 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.
+ * Get the number of used descriptors of a rx queue
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
- *
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
* @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * The number of used descriptors in the specific queue, or:
+ * (-EINVAL) if *port_id* or *queue_id* is invalid
+ * (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
+static inline int
+rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
+ dev = &rte_eth_devices[port_id];
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -EINVAL;
+
+ return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
+}
/**
- * Config l2 tunnel ether type of an Ethernet device for filtering specific
- * tunnel packets by ether type.
+ * Check if the DD bit of the specific RX descriptor in the queue has been set
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel configuration.
- *
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
+ * @param offset
+ * The offset of the descriptor ID from tail.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - (1) if the specific DD bit is set.
+ * - (0) if the specific DD bit is not set.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if the device does not support this function
*/
-int
-rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel);
+static inline int
+rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
+ return (*dev->dev_ops->rx_descriptor_done)( \
+ dev->data->rx_queues[queue_id], offset);
+}
+
+#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
+#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
+#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * Enable/disable l2 tunnel offload functions. Include,
- * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
- * Filtering, forwarding and offloading this type of tunnel packets depend on
- * this ability.
- * 2, Stripping the l2 tunnel tag.
- * 3, Insertion of the l2 tunnel tag.
- * 4, Forwarding the packets based on the l2 tunnel tag.
+ * Check the status of a Rx descriptor in the queue
+ *
+ * It should be called in a similar context than the Rx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
+ *
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
+ *
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel parameters.
- * @param mask
- * Indicate the offload function.
- * @param en
- * Enable or disable this function.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Rx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the next
+ * packet to be received by the driver).
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
+ * receive a packet.
+ * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
+ * not yet processed by the driver (i.e. in the receive queue).
+ * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
+ * the driver and not yet returned to hw, or reserved by the hw.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int
-rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
+static inline int
+rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
+ uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *rxq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
+ rxq = dev->data->rx_queues[queue_id];
+
+ return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
+}
+
+#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
+#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
+#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
-* Get the port id from pci address or device name
-* Ex: 0000:2:00.0 or vdev name net_pcap0
-*
-* @param name
-* pci address or name of the device
-* @param port_id
-* pointer to port identifier of the device
-* @return
-* - (0) if successful and port_id is filled.
-* - (-ENODEV or -EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
+ * Check the status of a Tx descriptor in the queue.
+ *
+ * It should be called in a similar context than the Tx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
+ *
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
+ *
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
+ *
+ * @param port_id
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Tx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the place where
+ * the next packet will be send).
+ *
+ * @return
+ * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
+ * in the transmit queue.
+ * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
+ * be reused by the driver.
+ * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
+ * driver or the hardware.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
+ */
+static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
+ uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *txq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
+ txq = dev->data->tx_queues[queue_id];
+
+ return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
+}
/**
-* Get the device name from port id
-*
-* @param port_id
-* pointer to port identifier of the device
-* @param name
-* pci address or name of the device
-* @return
-* - (0) if successful.
-* - (-EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+ * Send a burst of output packets on a transmit queue of an Ethernet device.
+ *
+ * The rte_eth_tx_burst() function is invoked to transmit output packets
+ * on the output queue *queue_id* of the Ethernet device designated by its
+ * *port_id*.
+ * The *nb_pkts* parameter is the number of packets to send which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
+ * up to the number of transmit descriptors available in the TX ring of the
+ * transmit queue.
+ * For each packet to send, the rte_eth_tx_burst() function performs
+ * the following operations:
+ *
+ * - Pick up the next available descriptor in the transmit ring.
+ *
+ * - Free the network buffer previously sent with that descriptor, if any.
+ *
+ * - Initialize the transmit descriptor with the information provided
+ * in the *rte_mbuf data structure.
+ *
+ * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
+ * the rte_eth_tx_burst() function uses several transmit descriptors
+ * of the ring.
+ *
+ * The rte_eth_tx_burst() function returns the number of packets it
+ * actually sent. A return value equal to *nb_pkts* means that all packets
+ * have been sent, and this is likely to signify that other output packets
+ * could be immediately transmitted again. Applications that implement a
+ * "send as many packets to transmit as possible" policy can check this
+ * specific case and keep invoking the rte_eth_tx_burst() function until
+ * a value less than *nb_pkts* is returned.
+ *
+ * It is the responsibility of the rte_eth_tx_burst() function to
+ * transparently free the memory buffers of packets previously sent.
+ * This feature is driven by the *tx_free_thresh* value supplied to the
+ * rte_eth_dev_configure() function at device configuration time.
+ * When the number of free TX descriptors drops below this threshold, the
+ * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
+ * of those packets whose transmission was effectively completed.
+ *
+ * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
+ * invoke this function concurrently on the same tx queue without SW lock.
+ * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to transmit.
+ * @return
+ * The number of output packets actually stored in transmit descriptors of
+ * the transmit ring. The return value can be less than the value of the
+ * *tx_pkts* parameter when the transmit ring is full or has been filled up.
+ */
+static inline uint16_t
+rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
+ cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
+}
/**
- * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
- * the ethernet device information, otherwise adjust them to boundaries.
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Process a burst of output packets on a transmit queue of an Ethernet device.
+ *
+ * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
+ * transmitted on the output queue *queue_id* of the Ethernet device designated
+ * by its *port_id*.
+ * The *nb_pkts* parameter is the number of packets to be prepared which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * For each packet to send, the rte_eth_tx_prepare() function performs
+ * the following operations:
+ *
+ * - Check if packet meets devices requirements for tx offloads.
+ *
+ * - Check limitations about number of segments.
+ *
+ * - Check additional requirements when debug is enabled.
+ *
+ * - Update and/or reset required checksums when tx offload is set for packet.
+ *
+ * Since this function can modify packet data, provided mbufs must be safely
+ * writable (e.g. modified data cannot be in shared segment).
+ *
+ * The rte_eth_tx_prepare() function returns the number of packets ready to be
+ * sent. A return value equal to *nb_pkts* means that all packets are valid and
+ * ready to be sent, otherwise stops processing on the first invalid packet and
+ * leaves the rest packets untouched.
+ *
+ * When this functionality is not implemented in the driver, all packets are
+ * are returned untouched.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param nb_rx_desc
- * A pointer to a uint16_t where the number of receive
- * descriptors stored.
- * @param nb_tx_desc
- * A pointer to a uint16_t where the number of transmit
- * descriptors stored.
+ * The value must be a valid port id.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to process.
* @return
- * - (0) if successful.
- * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
+ * The number of packets correct and ready to be sent. The return value can be
+ * less than the value of the *tx_pkts* parameter when some packet doesn't
+ * meet devices requirements with rte_errno set appropriately:
+ * - -EINVAL: offload flags are not correctly set
+ * - -ENOTSUP: the offload feature is not supported by the hardware
+ *
*/
-int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
- uint16_t *nb_rx_desc,
- uint16_t *nb_tx_desc);
+#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
+
+static inline uint16_t
+rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ if (!dev->tx_pkt_prepare)
+ return nb_pkts;
+
+ return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
+ tx_pkts, nb_pkts);
+}
+
+#else
+
+/*
+ * Native NOOP operation for compilation targets which doesn't require any
+ * preparations steps, and functional NOOP may introduce unnecessary performance
+ * drop.
+ *
+ * Generally this is not a good idea to turn it on globally and didn't should
+ * be used if behavior of tx_preparation can change.
+ */
+
+static inline uint16_t
+rte_eth_tx_prepare(__rte_unused uint16_t port_id,
+ __rte_unused uint16_t queue_id,
+ __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ return nb_pkts;
+}
+
+#endif
/**
- * Test if a port supports specific mempool ops.
+ * Send any packets queued up for transmission on a port and HW queue
+ *
+ * This causes an explicit flush of packets previously buffered via the
+ * rte_eth_tx_buffer() function. It returns the number of packets successfully
+ * sent to the NIC, and calls the error callback for any unsent packets. Unless
+ * explicitly set up otherwise, the default callback simply frees the unsent
+ * packets back to the owning mempool.
*
* @param port_id
- * Port identifier of the Ethernet device.
- * @param [in] pool
- * The name of the pool operations to test.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer of packets to be transmit.
* @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.
+ * The number of packets successfully sent to the Ethernet device. The error
+ * callback is called for any packets which could not be sent.
*/
-int
-rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
+static inline uint16_t
+rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer)
+{
+ uint16_t sent;
+ uint16_t to_send = buffer->length;
+
+ if (to_send == 0)
+ return 0;
+
+ sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
+
+ buffer->length = 0;
+
+ /* All packets sent, or to be dealt with by callback below */
+ if (unlikely(sent != to_send))
+ buffer->error_callback(&buffer->pkts[sent], to_send - sent,
+ buffer->error_userdata);
+
+ return sent;
+}
+
+/**
+ * Buffer a single packet for future transmission on a port and queue
+ *
+ * This function takes a single mbuf/packet and buffers it for later
+ * transmission on the particular port and queue specified. Once the buffer is
+ * full of packets, an attempt will be made to transmit all the buffered
+ * packets. In case of error, where not all packets can be transmitted, a
+ * callback is called with the unsent packets as a parameter. If no callback
+ * is explicitly set up, the unsent packets are just freed back to the owning
+ * mempool. The function returns the number of packets actually sent i.e.
+ * 0 if no buffer flush occurred, otherwise the number of packets successfully
+ * flushed
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer used to collect packets to be sent.
+ * @param tx_pkt
+ * Pointer to the packet mbuf to be sent.
+ * @return
+ * 0 = packet has been buffered for later transmission
+ * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
+ * causing N packets to be sent, and the error callback to be called for
+ * the rest.
+ */
+static __rte_always_inline uint16_t
+rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
+{
+ buffer->pkts[buffer->length++] = tx_pkt;
+ if (buffer->length < buffer->size)
+ return 0;
+
+ return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
+}
#ifdef __cplusplus
}
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v3 6/6] ethdev: rename function parameter for consistency
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
` (3 preceding siblings ...)
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 5/6] ethdev: reorder inline functions Ferruh Yigit
@ 2018-01-17 21:58 ` Ferruh Yigit
2018-01-17 22:09 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Thomas Monjalon
` (2 subsequent siblings)
7 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-17 21:58 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Ferruh Yigit, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
Update "port" function argument variable to "port_id" in public
header to be consistent in all APIs.
No functional change.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 15b2c92f8..2fdd4e38a 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1149,7 +1149,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* The callback function is called on RX with a burst of packets that have
* been received on the given port and queue.
*
- * @param port
+ * @param port_id
* The Ethernet port on which RX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to receive the packets.
@@ -1165,7 +1165,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* @return
* The number of packets returned to the user.
*/
-typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
void *user_param);
@@ -1175,7 +1175,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* The callback function is called on TX with a burst of packets immediately
* before the packets are put onto the hardware queue for transmission.
*
- * @param port
+ * @param port_id
* The Ethernet port on which TX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to transmit the packets.
@@ -1189,7 +1189,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* @return
* The number of packets to be written to the NIC.
*/
-typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
struct rte_eth_rxtx_callback;
@@ -2515,7 +2515,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* Add a MAC address to an internal array of addresses used to enable whitelist
* filtering to accept packets only if the destination MAC address matches.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* The MAC address to add.
@@ -2523,19 +2523,19 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
* not enabled, this should be set to 0.
* @return
- * - (0) if successfully added or *mac_addr" was already added.
+ * - (0) if successfully added or *mac_addr* was already added.
* - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port* is invalid.
* - (-ENOSPC) if no more MAC addresses can be added.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr,
uint32_t pool);
/**
* Remove a MAC address from the internal array of addresses.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* MAC address to remove.
@@ -2545,12 +2545,12 @@ int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
* - (-ENODEV) if *port* invalid.
* - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr);
/**
* Set the default MAC address.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* New default MAC address.
@@ -2560,13 +2560,13 @@ int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
+int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
struct ether_addr *mac_addr);
/**
* Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to update.
@@ -2578,14 +2578,14 @@ int rte_eth_dev_default_mac_addr_set(uint16_t port,
* - (-ENOTSUP) if hardware doesn't support.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rss_reta_update(uint16_t port,
+int rte_eth_dev_rss_reta_update(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
/**
* Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to query.
@@ -2597,7 +2597,7 @@ int rte_eth_dev_rss_reta_update(uint16_t port,
* - (-ENOTSUP) if hardware doesn't support.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rss_reta_query(uint16_t port,
+int rte_eth_dev_rss_reta_query(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
@@ -2606,7 +2606,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* MAC address, and the packet is routed to all VFs for which the RX mode is
* accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param addr
* Unicast MAC address.
@@ -2619,7 +2619,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr,
uint8_t on);
/**
@@ -2627,7 +2627,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* Ethernet MAC addresses,the packet is routed to all VFs for which the RX
* mode is accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param on
* 1 - Set all unicast hash bitmaps for receiving all the Ethernet
@@ -2639,7 +2639,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on);
/**
* Set a traffic mirroring rule on an Ethernet device
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
` (4 preceding siblings ...)
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 6/6] ethdev: rename function parameter for consistency Ferruh Yigit
@ 2018-01-17 22:09 ` Thomas Monjalon
2018-01-17 22:19 ` Thomas Monjalon
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-03-09 11:27 ` [dpdk-dev] [PATCH v4] ethdev: fix port id storage Ferruh Yigit
7 siblings, 1 reply; 76+ messages in thread
From: Thomas Monjalon @ 2018-01-17 22:09 UTC (permalink / raw)
To: Ferruh Yigit
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
17/01/2018 22:57, Ferruh Yigit:
> port_id is now 16bits, update function parameter according.
>
> Fixes: 4c270218aa26 ("ethdev: support security APIs")
> Cc: stable@dpdk.org
> Cc: declan.doherty@intel.com
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Obviously,
Acked-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
@ 2018-01-17 22:11 ` Thomas Monjalon
2018-01-18 10:09 ` Ferruh Yigit
2018-03-09 11:25 ` [dpdk-dev] [PATCH v4] " Ferruh Yigit
1 sibling, 1 reply; 76+ messages in thread
From: Thomas Monjalon @ 2018-01-17 22:11 UTC (permalink / raw)
To: Ferruh Yigit
Cc: stable, dev, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
17/01/2018 22:57, Ferruh Yigit:
> "struct rte_eth_rxtx_callback" is defined as internal data structure and
> used as named opaque type.
>
> So the functions that are adding callbacks can return objects in this
> type instead of void pointer.
It is an API change.
Let's plan it for 18.05.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage
2018-01-17 22:09 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Thomas Monjalon
@ 2018-01-17 22:19 ` Thomas Monjalon
2018-01-18 10:15 ` Ferruh Yigit
0 siblings, 1 reply; 76+ messages in thread
From: Thomas Monjalon @ 2018-01-17 22:19 UTC (permalink / raw)
To: Ferruh Yigit
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
17/01/2018 23:09, Thomas Monjalon:
> 17/01/2018 22:57, Ferruh Yigit:
> > port_id is now 16bits, update function parameter according.
> >
> > Fixes: 4c270218aa26 ("ethdev: support security APIs")
> > Cc: stable@dpdk.org
> > Cc: declan.doherty@intel.com
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
> Obviously,
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Not so obvious actually.
It is a good fix, but an API change.
This function was not declared experimental.
It must wait 18.05.
And the function has no doxygen!
And the function was placed randomly in the middle of struct declarations!
One more proof of the poor quality of rte_security stuff.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v3 4/6] ethdev: separate internal structures into own header
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 4/6] ethdev: separate internal structures into own header Ferruh Yigit
@ 2018-01-17 22:24 ` Thomas Monjalon
2018-01-18 10:09 ` Ferruh Yigit
0 siblings, 1 reply; 76+ messages in thread
From: Thomas Monjalon @ 2018-01-17 22:24 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
17/01/2018 22:58, Ferruh Yigit:
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2017 Intel Corporation. All rights reserved.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in
> + * the documentation and/or other materials provided with the
> + * distribution.
> + * * Neither the name of Intel Corporation nor the names of its
> + * contributors may be used to endorse or promote products derived
> + * from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
SPDX tag requirement spotted :)
> +#ifndef _RTE_ETHDEV_COMMON_H_
> +#define _RTE_ETHDEV_COMMON_H_
> +/*
> + * Definitions of all functions exported by an Ethernet driver through the
> + * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
> + * structure associated with an Ethernet device.
> + */
You should explain that it is internal but included by the API functions
because of inlining.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer
2018-01-17 22:11 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
@ 2018-01-18 10:09 ` Ferruh Yigit
0 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-18 10:09 UTC (permalink / raw)
To: Thomas Monjalon
Cc: stable, dev, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
On 1/17/2018 10:11 PM, Thomas Monjalon wrote:
> 17/01/2018 22:57, Ferruh Yigit:
>> "struct rte_eth_rxtx_callback" is defined as internal data structure and
>> used as named opaque type.
>>
>> So the functions that are adding callbacks can return objects in this
>> type instead of void pointer.
>
> It is an API change.
> Let's plan it for 18.05.
No issue for pushing this to next release, but not sure if this API change
effects end user.
"struct rte_eth_rxtx_callback" is private data structure, previously how user
should be using it can be:
a)
void *cb;
cb = rte_eth_add_rx_callback(..);
rte_eth_remove_rx_callback(.., cb);
b)
struct rte_eth_rxtx_callback *cb;
cb = rte_eth_add_rx_callback(..);
rte_eth_remove_rx_callback(.., cb);
And same a) or b) can be used without any side effect with updated API.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v3 4/6] ethdev: separate internal structures into own header
2018-01-17 22:24 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
@ 2018-01-18 10:09 ` Ferruh Yigit
0 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-18 10:09 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On 1/17/2018 10:24 PM, Thomas Monjalon wrote:
> 17/01/2018 22:58, Ferruh Yigit:
>> +/*-
>> + * BSD LICENSE
>> + *
>> + * Copyright(c) 2017 Intel Corporation. All rights reserved.
>> + * All rights reserved.
>> + *
>> + * Redistribution and use in source and binary forms, with or without
>> + * modification, are permitted provided that the following conditions
>> + * are met:
>> + *
>> + * * Redistributions of source code must retain the above copyright
>> + * notice, this list of conditions and the following disclaimer.
>> + * * Redistributions in binary form must reproduce the above copyright
>> + * notice, this list of conditions and the following disclaimer in
>> + * the documentation and/or other materials provided with the
>> + * distribution.
>> + * * Neither the name of Intel Corporation nor the names of its
>> + * contributors may be used to endorse or promote products derived
>> + * from this software without specific prior written permission.
>> + *
>> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
>> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
>> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
>> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
>> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
>> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
>> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
>> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>> + */
>
> SPDX tag requirement spotted :)
Will fix.
>
>> +#ifndef _RTE_ETHDEV_COMMON_H_
>> +#define _RTE_ETHDEV_COMMON_H_
>> +/*
>> + * Definitions of all functions exported by an Ethernet driver through the
>> + * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
>> + * structure associated with an Ethernet device.
>> + */
>
> You should explain that it is internal but included by the API functions
> because of inlining.
OK
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage
2018-01-17 22:19 ` Thomas Monjalon
@ 2018-01-18 10:15 ` Ferruh Yigit
2018-01-18 11:29 ` Thomas Monjalon
0 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-18 10:15 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
On 1/17/2018 10:19 PM, Thomas Monjalon wrote:
> 17/01/2018 23:09, Thomas Monjalon:
>> 17/01/2018 22:57, Ferruh Yigit:
>>> port_id is now 16bits, update function parameter according.
>>>
>>> Fixes: 4c270218aa26 ("ethdev: support security APIs")
>>> Cc: stable@dpdk.org
>>> Cc: declan.doherty@intel.com
>>>
>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>>
>> Obviously,
>> Acked-by: Thomas Monjalon <thomas@monjalon.net>
>
> Not so obvious actually.
> It is a good fix, but an API change.
It is more like API fix.
While whole library is using 16bits for port_id, I think we shouldn't deliver
release with this specific API uses 8bits.
I am for getting this because what it does is wrong.
> This function was not declared experimental.
> It must wait 18.05.
>
> And the function has no doxygen!
There was a request to add it [1] but not received the patch yet.
[1]
https://dpdk.org/ml/archives/dev/2017-December/082824.html
> And the function was placed randomly in the middle of struct declarations!
> One more proof of the poor quality of rte_security stuff.
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage
2018-01-18 10:15 ` Ferruh Yigit
@ 2018-01-18 11:29 ` Thomas Monjalon
0 siblings, 0 replies; 76+ messages in thread
From: Thomas Monjalon @ 2018-01-18 11:29 UTC (permalink / raw)
To: Ferruh Yigit
Cc: dev, stable, declan.doherty, Boris Pismenny, Aviad Yehezkel,
Radu Nicolau
18/01/2018 11:15, Ferruh Yigit:
> On 1/17/2018 10:19 PM, Thomas Monjalon wrote:
> > 17/01/2018 23:09, Thomas Monjalon:
> >> 17/01/2018 22:57, Ferruh Yigit:
> >>> port_id is now 16bits, update function parameter according.
> >>>
> >>> Fixes: 4c270218aa26 ("ethdev: support security APIs")
> >>> Cc: stable@dpdk.org
> >>> Cc: declan.doherty@intel.com
> >>>
> >>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >>> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> >>
> >> Obviously,
> >> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> >
> > Not so obvious actually.
> > It is a good fix, but an API change.
>
> It is more like API fix.
> While whole library is using 16bits for port_id, I think we shouldn't deliver
> release with this specific API uses 8bits.
>
> I am for getting this because what it does is wrong.
>
> > This function was not declared experimental.
> > It must wait 18.05.
I really want to keep API stable in 18.02.
We have to keep this mistake for one more release.
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
` (5 preceding siblings ...)
2018-01-17 22:09 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Thomas Monjalon
@ 2018-01-20 16:57 ` Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 2/4] ethdev: separate internal structures into own header Ferruh Yigit
` (4 more replies)
2018-03-09 11:27 ` [dpdk-dev] [PATCH v4] ethdev: fix port id storage Ferruh Yigit
7 siblings, 5 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-20 16:57 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.
There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.
More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
v2: use SPDX header
v3: rebased on next-net
v4: rebased on next-net
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/avf/avf_ethdev.c | 2 +-
drivers/net/avf/avf_rxtx.c | 2 +-
drivers/net/avf/avf_rxtx_vec_common.h | 2 +-
drivers/net/avf/avf_rxtx_vec_sse.c | 2 +-
drivers/net/avf/avf_vchnl.c | 2 +-
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
drivers/net/bonding/rte_eth_bond_private.h | 2 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 2 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa/rte_pmd_dpaa.h | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 2 +-
drivers/net/e1000/igb_flow.c | 2 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 2 +-
drivers/net/enic/enic_clsf.c | 2 +-
drivers/net/enic/enic_ethdev.c | 2 +-
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/failsafe/failsafe.c | 2 +-
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 2 +-
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/rte_pmd_i40e.h | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 2 +-
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +-
drivers/net/kni/rte_eth_kni.c | 2 +-
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 2 +-
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/mlx5.c | 2 +-
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_defs.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
| 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mrvl/mrvl_ethdev.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/null/rte_eth_null.c | 2 +-
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 2 +-
drivers/net/qede/qede_ethdev.h | 2 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 2 +-
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 2 +-
drivers/net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 2 +-
drivers/net/tap/rte_eth_tap.c | 2 +-
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.c | 1 +
lib/librte_ether/rte_ethdev.h | 112 +-------------------
lib/librte_ether/rte_ethdev_driver.h | 132 ++++++++++++++++++++++++
lib/librte_ether/rte_ethdev_pci.h | 2 +-
lib/librte_ether/rte_ethdev_vdev.h | 2 +-
157 files changed, 291 insertions(+), 261 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_driver.h
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 4c2854f09..ba33566c7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_bus.h>
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index da3749044..15bf73a40 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -11,7 +11,7 @@
#include <stdbool.h>
#include <net/if.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <compat.h>
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 8fe08f64e..e9acd3588 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -14,7 +14,7 @@
#include <rte_malloc.h>
#include <rte_devargs.h>
#include <rte_memcpy.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <fslmc_vfio.h>
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 9f28fa0bf..1241295be 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -22,7 +22,7 @@
#include <eal_filesystem.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index ffad0f536..139249c07 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -19,7 +19,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
index f0edaf414..fb28e4970 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 537141d07..eefde1552 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -24,7 +24,7 @@
#include<sys/eventfd.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 1d3e3612e..84ecd1b86 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -26,7 +26,7 @@
#include <rte_memory.h>
#include <rte_pci.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fslmc_vfio.h>
diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
index c949b2db2..f2377b983 100644
--- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
+++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index 748ae5fa5..edac6d4f6 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -8,7 +8,7 @@
#include <rte_debug.h>
#include <rte_dev.h>
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <rte_kvargs.h>
#include <rte_lcore.h>
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 51770d412..afda2c290 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -14,7 +14,7 @@
#include <errno.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index d51540898..ac58ad6b2 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -37,7 +37,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index 3a54a4c91..146787112 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -38,7 +38,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
int eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
diff --git a/drivers/net/ark/ark_ethdev_tx.h b/drivers/net/ark/ark_ethdev_tx.h
index 8aaafc22e..657f895a4 100644
--- a/drivers/net/ark/ark_ethdev_tx.h
+++ b/drivers/net/ark/ark_ethdev_tx.h
@@ -36,7 +36,7 @@
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
uint16_t eth_ark_xmit_pkts_noop(void *vtxq,
diff --git a/drivers/net/ark/ark_ext.h b/drivers/net/ark/ark_ext.h
index d26c8198b..031cfddc3 100644
--- a/drivers/net/ark/ark_ext.h
+++ b/drivers/net/ark/ark_ext.h
@@ -34,7 +34,7 @@
#ifndef _ARK_EXT_H_
#define _ARK_EXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* This is the template file for users who which to define a dynamic
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index aef2cf73b..41eb260e6 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -38,7 +38,7 @@
#include <assert.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 202a1d9be..2cadaab80 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -36,7 +36,7 @@
#include <locale.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktchkr.h"
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index 018f37b69..d3c3dee1e 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -38,7 +38,7 @@
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktgen.h"
diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index b36d31705..cf7bbb2e7 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -19,7 +19,7 @@
#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/avf/avf_rxtx.c b/drivers/net/avf/avf_rxtx.c
index e0c45839e..d276d9752 100644
--- a/drivers/net/avf/avf_rxtx.c
+++ b/drivers/net/avf/avf_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/avf/avf_rxtx_vec_common.h b/drivers/net/avf/avf_rxtx_vec_common.h
index 56a23a732..8057b9682 100644
--- a/drivers/net/avf/avf_rxtx_vec_common.h
+++ b/drivers/net/avf/avf_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _AVF_RXTX_VEC_COMMON_H_
#define _AVF_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "avf.h"
diff --git a/drivers/net/avf/avf_rxtx_vec_sse.c b/drivers/net/avf/avf_rxtx_vec_sse.c
index 8f389f311..8275100f3 100644
--- a/drivers/net/avf/avf_rxtx_vec_sse.c
+++ b/drivers/net/avf/avf_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/avf_prototype.h"
diff --git a/drivers/net/avf/avf_vchnl.c b/drivers/net/avf/avf_vchnl.c
index cc347e6ea..fa71014e1 100644
--- a/drivers/net/avf/avf_vchnl.c
+++ b/drivers/net/avf/avf_vchnl.c
@@ -16,7 +16,7 @@
#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_dev.h>
#include "avf_log.h"
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index deb6f355d..e4ad7b00a 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -36,7 +36,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h
index 967d6dc50..37cac1589 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.h
+++ b/drivers/net/bnx2x/bnx2x_ethdev.h
@@ -33,7 +33,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_eal.h>
#include <rte_mempool.h>
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 7e3d7aefd..cf0b1d27c 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -40,7 +40,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
#include <rte_lcore.h>
#include <rte_spinlock.h>
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 89b63978f..057786a62 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
diff --git a/drivers/net/bnxt/bnxt_stats.h b/drivers/net/bnxt/bnxt_stats.h
index 51d16f5d3..c1c83d57b 100644
--- a/drivers/net/bnxt/bnxt_stats.h
+++ b/drivers/net/bnxt/bnxt_stats.h
@@ -34,7 +34,7 @@
#ifndef _BNXT_STATS_H_
#define _BNXT_STATS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
void bnxt_free_stats(struct bnxt *bp);
int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index e86e670dc..595208997 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -36,7 +36,7 @@
#include <unistd.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h
index f881d30d6..cd7227ac2 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.h
+++ b/drivers/net/bnxt/rte_pmd_bnxt.h
@@ -34,7 +34,7 @@
#ifndef _PMD_BNXT_H_
#define _PMD_BNXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* Response sent back to the caller after callback
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 534a890bf..03b73be03 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 10c1920ae..158f3aa1d 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_tcp.h>
#include <rte_udp.h>
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index e2b717f72..92e15f8cc 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -5,7 +5,7 @@
#ifndef _RTE_ETH_BOND_PRIVATE_H_
#define _RTE_ETH_BOND_PRIVATE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_bitmap.h>
diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 282e2e625..56f38c838 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -44,7 +44,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index dc153c731..5cd260f48 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 5b828c237..28db6c061 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -55,7 +55,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index fc10d9585..3d5aa596f 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 88524a2f0..bf5eb96ed 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -28,7 +28,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 3c9162bf6..92aec253c 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -9,7 +9,7 @@
/* System headers */
#include <stdbool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fsl_usd.h>
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 1976fe5fc..ab2335270 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_ip.h>
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index 9614be84e..2b03d52d4 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -15,7 +15,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @warning
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index f7a8d9f26..b93376de4 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index a0a3d5264..09a11d65a 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 2f750ad20..3d4566988 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index dcffb0797..07ee25f84 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index a010b3ab8..02fae100c 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 077e09400..53b8ffa45 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index b560f16a2..d98bdc844 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 3258f3b5b..b9f2e5391 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -16,7 +16,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index a2abc759f..2f3716724 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 5419e61f3..83e0ae2c9 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -32,7 +32,7 @@
*/
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_tcp.h>
#include <rte_atomic.h>
diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index d52e5e475..3ef1d0832 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -5,7 +5,7 @@
#include <libgen.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_hash.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index ad7a4e306..e1ff9dcbd 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -9,7 +9,7 @@
#include <rte_dev.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index 9a2bb8ebd..28923b0e2 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -4,7 +4,7 @@
#include <errno.h>
#include <rte_log.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow_driver.h>
#include <rte_ether.h>
#include <rte_ip.h>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 9bbe054b3..9274defd9 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -16,7 +16,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "enic_compat.h"
#include "enic.h"
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index c8ded867d..c99d61837 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -4,7 +4,7 @@
*/
#include "enic_compat.h"
-#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "wq_enet_desc.h"
#include "rq_enet_desc.h"
#include "cq_enet_desc.h"
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index e2002e136..98902caa0 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -4,7 +4,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include "enic_compat.h"
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index b76735261..cb274eb76 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -33,7 +33,7 @@
#include <rte_alarm.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_devargs.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 3384c3d95..29711cbdc 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -36,7 +36,7 @@
#include <rte_debug.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_flow.h>
#include <rte_cycles.h>
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 9fcf72e45..cfb226d44 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -38,7 +38,7 @@
#include <rte_atomic.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_devargs.h>
#define FAILSAFE_DRIVER_NAME "Fail-safe PMD"
diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c
index 0ebf06a6f..165449411 100644
--- a/drivers/net/failsafe/failsafe_rxtx.c
+++ b/drivers/net/failsafe/failsafe_rxtx.c
@@ -34,7 +34,7 @@
#include <rte_atomic.h>
#include <rte_debug.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "failsafe_private.h"
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index cf8cc6a6e..340f6040f 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2013-2016 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 65956db08..9320748c4 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_net.h>
#include "fm10k.h"
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index 630ca49b9..498a17815 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "fm10k.h"
#include "base/fm10k_type.h"
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5ea9f9917..c4df65df0 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0cca0d324..6ac3f8c04 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_dev.h>
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index f43cf4aa4..a4320b1b5 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index cd9a9b64b..a74fa08ab 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_eth_ctrl.h>
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index e19917715..dd3962d38 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -14,7 +14,7 @@
#include <rte_string_fns.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index f16944e40..1217e5a61 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index 5e4e472a3..f3fc82672 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index ea6e7715c..dbcb61f38 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -32,7 +32,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index e3faaefd9..3ffedcb9e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _I40E_RXTX_VEC_COMMON_H_
#define _I40E_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "i40e_ethdev.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index b5685e2b9..e549d1e8c 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 1df306122..3b22588c5 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index cfdcae7e5..d248adb1a 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -14,7 +14,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Response sent back to i40e driver from user app after callback
diff --git a/drivers/net/ixgbe/ixgbe_bypass.c b/drivers/net/ixgbe/ixgbe_bypass.c
index 62a550653..ae38ce355 100644
--- a/drivers/net/ixgbe/ixgbe_bypass.c
+++ b/drivers/net/ixgbe/ixgbe_bypass.c
@@ -4,7 +4,7 @@
#include <time.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_bypass_api.h"
#include "rte_pmd_ixgbe.h"
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4f4334df2..58217680c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 236ab8c95..d5e51797c 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -13,7 +13,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_logs.h"
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 0e486c38a..dcbfb38b3 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index 85305c60a..d4e59179a 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ip.h>
#include <rte_jhash.h>
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index f81dc314d..ea9973711 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 4b382477e..eeff91b0d 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -62,7 +62,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
index df580f39b..414840a2b 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _IXGBE_RXTX_VEC_COMMON_H_
#define _IXGBE_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_rxtx.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index b2a2774da..e0f9998f0 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 0131b06d2..c9ba48246 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index 001a8647e..d8ca8ca31 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "base/ixgbe_api.h"
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 463a78e50..11a9f334b 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -11,7 +11,7 @@
#ifndef _PMD_IXGBE_H_
#define _PMD_IXGBE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Notify VF when PF link status changes.
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index a1df4c6a9..dc4e65f5d 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -6,7 +6,7 @@
#include <pthread.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kni.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 2a5d4f12f..ddbc8c0e0 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -4,7 +4,7 @@
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/base/lio_mbox.c b/drivers/net/liquidio/base/lio_mbox.c
index 3c6379341..112900151 100644
--- a/drivers/net/liquidio/base/lio_mbox.c
+++ b/drivers/net/liquidio/base/lio_mbox.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include "lio_logs.h"
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 8f6ef6381..843d02338 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 5d447706a..8d705bfe7 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 61c5bf4d3..ab3071930 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -57,7 +57,7 @@
#include <rte_common.h>
#include <rte_dev.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 99dc3357a..638cb08b0 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_interrupts.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index c80eab5a8..3db546a1f 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -63,7 +63,7 @@
#include <rte_bus_pci.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_pci.h>
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 96a6a6fa7..fb84060db 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -57,7 +57,7 @@
#include <rte_byteorder.h>
#include <rte_errno.h>
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index b10c4f552..cd46f860d 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -47,7 +47,7 @@
#endif
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c
index 9becee4a8..2ff72188a 100644
--- a/drivers/net/mlx4/mlx4_intr.c
+++ b/drivers/net/mlx4/mlx4_intr.c
@@ -52,7 +52,7 @@
#include <rte_alarm.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_io.h>
#include <rte_interrupts.h>
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index 98ab1d266..163598765 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -55,7 +55,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h
index 900cab372..6a9fd28a5 100644
--- a/drivers/net/mlx4/mlx4_rxtx.h
+++ b/drivers/net/mlx4/mlx4_rxtx.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c
index 7664c3e1a..2bd4b9cb6 100644
--- a/drivers/net/mlx4/mlx4_txq.c
+++ b/drivers/net/mlx4/mlx4_txq.c
@@ -54,7 +54,7 @@
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index fc2d59fee..a4ed32a5d 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -51,7 +51,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 9a4a59bd4..119c1dbe9 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -53,7 +53,7 @@
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_interrupts.h>
#include <rte_errno.h>
diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 64bb0712e..a71db281d 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -34,7 +34,7 @@
#ifndef RTE_PMD_MLX5_DEFS_H_
#define RTE_PMD_MLX5_DEFS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5_autoconf.h"
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 9a2ebd80c..391897c0d 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -55,7 +55,7 @@
#include <sys/un.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_bus_pci.h>
#include <rte_mbuf.h>
#include <rte_common.h>
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 4396ea852..13b6483ba 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -44,7 +44,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 9fb5ba5e7..a5e78ec8d 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -52,7 +52,7 @@
#endif
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5.h"
--git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index f47bda667..9e12b51fe 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -48,7 +48,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_defs.h"
diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c
index 6fb245ba1..897695855 100644
--- a/drivers/net/mlx5/mlx5_rxmode.c
+++ b/drivers/net/mlx5/mlx5_rxmode.c
@@ -45,7 +45,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_rxtx.h"
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 950472754..8e4fbbf2a 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -52,7 +52,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_debug.h>
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 4cb6136fc..36234b870 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -34,7 +34,7 @@
#include <linux/sockios.h>
#include <linux/ethtool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 6f5c799b5..61fa2604f 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_interrupts.h>
#include <rte_alarm.h>
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 26db15a4f..49018303e 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -51,7 +51,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 9443e4f03..d51dbe941 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -36,7 +36,7 @@
#include <assert.h>
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 16a964b1f..c327ff27e 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -32,7 +32,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_log.h>
#include <rte_malloc.h>
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index d14f2442b..004469923 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -43,7 +43,7 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_debug.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ether.h>
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 726a5c5e4..7cd5c7163 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -32,7 +32,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h
index 637b92cf4..10e42e142 100644
--- a/drivers/net/octeontx/octeontx_ethdev.h
+++ b/drivers/net/octeontx/octeontx_ethdev.h
@@ -8,7 +8,7 @@
#include <stdbool.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eventdev.h>
#include <rte_mempool.h>
#include <rte_memory.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c
index 2445fae48..2502d90e9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.c
+++ b/drivers/net/octeontx/octeontx_rxtx.c
@@ -9,7 +9,7 @@
#include <rte_atomic.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index e8eed169a..fe3e5ccd9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -5,7 +5,7 @@
#ifndef __OCTEONTX_RXTX_H__
#define __OCTEONTX_RXTX_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#ifndef __hot
#define __hot __attribute__((hot))
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index debb0cec2..c1571e1fe 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -11,7 +11,7 @@
#include <pcap.h>
#include <rte_cycles.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 7cddbe66b..cb9597390 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -13,7 +13,7 @@
#include <sys/queue.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ip.h>
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 48091f459..df13c44be 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -4,7 +4,7 @@
#include "rte_eth_ring.h"
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 3a4f66d60..75575349b 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -14,7 +14,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_spinlock.h>
#include <rte_atomic.h>
diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index 8bfb549e3..be725dcbd 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -11,7 +11,7 @@
#define _SFC_DP_RX_H
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h
index 75d72feb4..0c1aad908 100644
--- a/drivers/net/sfc/sfc_dp_tx.h
+++ b/drivers/net/sfc/sfc_dp_tx.h
@@ -10,7 +10,7 @@
#ifndef _SFC_DP_TX_H
#define _SFC_DP_TX_H
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index a86cff6b1..89a452907 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -8,7 +8,7 @@
*/
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index da2b5c6ef..872f79b91 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -10,7 +10,7 @@
#ifndef _SFC_EV_H_
#define _SFC_EV_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 11ab892ee..93cdf8f4c 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -9,7 +9,7 @@
#include <rte_tailq.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eth_ctrl.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 8c0fa7125..6706ee6fc 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -12,7 +12,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_tx.h b/drivers/net/sfc/sfc_tx.h
index e3c5d517a..c2e5f13e9 100644
--- a/drivers/net/sfc/sfc_tx.h
+++ b/drivers/net/sfc/sfc_tx.h
@@ -11,7 +11,7 @@
#define _SFC_TX_H
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 5c5464c8d..b0c134152 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index 3a1282347..050e3e7e1 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -9,7 +9,7 @@
#include <rte_mbuf.h>
#include <rte_sched.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tm_driver.h>
#include "rte_eth_softnic.h"
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 45aebed33..e53c738db 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -44,7 +44,7 @@
#include <libsze2.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 2eb873406..fd425726a 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -7,7 +7,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index 73c201b93..d4f1e6c55 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -41,7 +41,7 @@
#include <linux/if_tun.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#ifdef IFF_MULTI_QUEUE
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index c42ba30a4..d34938c64 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -24,7 +24,7 @@
#include <rte_dev.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_interrupts.h>
#include <rte_log.h>
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index da30a9f3c..ea8dccd19 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -5,7 +5,7 @@
#ifndef __THUNDERX_NICVF_ETHDEV_H__
#define __THUNDERX_NICVF_ETHDEV_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define THUNDERX_NICVF_PMD_VERSION "2.0"
#define THUNDERX_REG_BYTES 8
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index aa278afee..72305d9d2 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -13,7 +13,7 @@
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h
index ae6355361..8bdd582ed 100644
--- a/drivers/net/thunderx/nicvf_rxtx.h
+++ b/drivers/net/thunderx/nicvf_rxtx.h
@@ -6,7 +6,7 @@
#define __THUNDERX_NICVF_RXTX_H__
#include <rte_byteorder.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define NICVF_TX_OFFLOAD_MASK (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 6d0a6b245..d4a83c372 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -11,7 +11,7 @@
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
struct nicvf_rbdr {
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 014428580..4e541e3d8 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 17ac04931..65cb71fa6 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -8,7 +8,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 9d810a599..a28ba8339 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -9,7 +9,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
struct virtqueue;
struct virtnet_ctl;
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 80e996d06..854af399e 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index 98a9da5d8..7247a0822 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c
index b73867ac7..d6207d7bb 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_neon.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c
@@ -12,7 +12,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c
index 6378b12af..d768d0757 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_sse.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c
@@ -14,7 +14,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index d3b704b40..a2fb93cc9 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
#include <rte_malloc.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index abea641ef..3a8c62fc1 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -32,7 +32,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index ea8cf941a..48d84f445 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -27,6 +27,7 @@ SRCS-y += ethdev_profile.c
# Export include files
#
SYMLINK-y-include += rte_ethdev.h
+SYMLINK-y-include += rte_ethdev_driver.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 8a365393d..340773308 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -38,6 +38,7 @@
#include "rte_ether.h"
#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "ethdev_profile.h"
static const char *MZ_RTE_ETH_DEV_DATA = "rte_eth_dev_data";
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 2729e2b43..523809c3a 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -17,10 +17,10 @@
* to get its MAC address, the speed and the status of its physical link,
* to receive and to transmit packets, and so on.
*
- * - The driver-oriented Ethernet API that exports a function allowing
- * an Ethernet Poll Mode Driver (PMD) to simultaneously register itself as
- * an Ethernet device driver and as a PCI driver for a set of matching PCI
- * [Ethernet] devices classes.
+ * - The driver-oriented Ethernet API that exports functions allowing
+ * an Ethernet Poll Mode Driver (PMD) to allocate an Ethernet device instance,
+ * create memzone for HW rings and process registered callbacks, and so on.
+ * PMDs should include rte_ethdev_driver.h instead of this header.
*
* By default, all the functions of the Ethernet Device API exported by a PMD
* are lock-free functions which assume to not be invoked in parallel on
@@ -1840,53 +1840,6 @@ uint16_t rte_eth_find_next(uint16_t port_id);
*/
uint16_t rte_eth_dev_count(void);
-/**
- * @internal
- * Returns a ethdev slot specified by the unique identifier name.
- *
- * @param name
- * The pointer to the Unique identifier name for each Ethernet device
- * @return
- * - The pointer to the ethdev slot, on success. NULL on error
- */
-struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
-
-/**
- * @internal
- * Allocates a new ethdev slot for an ethernet device and returns the pointer
- * to that slot for the driver to use.
- *
- * @param name Unique identifier name for each Ethernet device
- * @param type Device type of this Ethernet device
- * @return
- * - Slot in the rte_dev_devices array for a new device;
- */
-struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
-
-/**
- * @internal
- * Attach to the ethdev already initialized by the primary
- * process.
- *
- * @param name Ethernet device's name.
- * @return
- * - Success: Slot in the rte_dev_devices array for attached
- * device.
- * - Error: Null pointer.
- */
-struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
-
-/**
- * @internal
- * Release the specified ethdev port.
- *
- * @param eth_dev
- * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
- * @return
- * - 0 on success, negative on error
- */
-int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
-
/**
* Attach a new Ethernet device specified by arguments.
*
@@ -1990,19 +1943,6 @@ const char *rte_eth_dev_tx_offload_name(uint64_t offload);
int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
-/**
- * @internal
- * Release device queues and clear its configuration to force the user
- * application to reconfigure it. It is for internal use only.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- *
- * @return
- * void
- */
-void _rte_eth_dev_reset(struct rte_eth_dev *dev);
-
/**
* Allocate and set up a receive queue for an Ethernet device.
*
@@ -3587,26 +3527,6 @@ int rte_eth_dev_callback_unregister(uint16_t port_id,
enum rte_eth_event_type event,
rte_eth_dev_cb_fn cb_fn, void *cb_arg);
-/**
- * @internal Executes all the user application registered callbacks for
- * the specific device. It is for DPDK internal user only. User
- * application should not call it directly.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- * @param event
- * Eth device interrupt event type.
- * @param ret_param
- * To pass data back to user application.
- * This allows the user application to decide if a particular function
- * is permitted or not.
- *
- * @return
- * int
- */
-int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
- enum rte_eth_event_type event, void *ret_param);
-
/**
* 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
@@ -4477,30 +4397,6 @@ int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
*/
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
-/**
- * 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);
-
/**
* Config l2 tunnel ether type of an Ethernet device for filtering specific
* tunnel packets by ether type.
diff --git a/lib/librte_ether/rte_ethdev_driver.h b/lib/librte_ether/rte_ethdev_driver.h
new file mode 100644
index 000000000..45f08c65e
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_driver.h
@@ -0,0 +1,132 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
+ */
+
+#ifndef _RTE_ETHDEV_DRIVER_H_
+#define _RTE_ETHDEV_DRIVER_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device PMD API
+ *
+ * These APIs for the use from Ethernet drivers, user applications shouldn't
+ * use them.
+ *
+ */
+
+#include <rte_ethdev.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @internal
+ * Returns a ethdev slot specified by the unique identifier name.
+ *
+ * @param name
+ * The pointer to the Unique identifier name for each Ethernet device
+ * @return
+ * - The pointer to the ethdev slot, on success. NULL on error
+ */
+struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+
+/**
+ * @internal
+ * Allocates a new ethdev slot for an ethernet device and returns the pointer
+ * to that slot for the driver to use.
+ *
+ * @param name Unique identifier name for each Ethernet device
+ * @param type Device type of this Ethernet device
+ * @return
+ * - Slot in the rte_dev_devices array for a new device;
+ */
+struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
+
+/**
+ * @internal
+ * Attach to the ethdev already initialized by the primary
+ * process.
+ *
+ * @param name Ethernet device's name.
+ * @return
+ * - Success: Slot in the rte_dev_devices array for attached
+ * device.
+ * - Error: Null pointer.
+ */
+struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
+
+/**
+ * @internal
+ * Release the specified ethdev port.
+ *
+ * @param eth_dev
+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
+ * @return
+ * - 0 on success, negative on error
+ */
+int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
+
+/**
+ * @internal
+ * Release device queues and clear its configuration to force the user
+ * application to reconfigure it. It is for internal use only.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ *
+ * @return
+ * void
+ */
+void _rte_eth_dev_reset(struct rte_eth_dev *dev);
+
+/**
+ * @internal Executes all the user application registered callbacks for
+ * the specific device. It is for DPDK internal user only. User
+ * application should not call it directly.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ * @param event
+ * Eth device interrupt event type.
+ * @param ret_param
+ * To pass data back to user application.
+ * This allows the user application to decide if a particular function
+ * is permitted or not.
+ *
+ * @return
+ * int
+ */
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+ enum rte_eth_event_type event, void *ret_param);
+
+/**
+ * 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
+
+#endif /* _RTE_ETHDEV_DRIVER_H_ */
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index ad64a169c..897ce5b41 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -38,7 +38,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_config.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Copy pci device info to the Ethernet device data.
diff --git a/lib/librte_ether/rte_ethdev_vdev.h b/lib/librte_ether/rte_ethdev_vdev.h
index feb5a3eb0..259feda3f 100644
--- a/lib/librte_ether/rte_ethdev_vdev.h
+++ b/lib/librte_ether/rte_ethdev_vdev.h
@@ -37,7 +37,7 @@
#include <rte_config.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @internal
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v4 2/4] ethdev: separate internal structures into own header
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
@ 2018-01-20 16:57 ` Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 3/4] ethdev: reorder inline functions Ferruh Yigit
` (3 subsequent siblings)
4 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-20 16:57 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
rte_ethdev_core.h created. Internal data structures are moved here.
These structures are mostly intended to be used by drivers, but they
need to be in the public header file because of the inline functions
in the ethdev.h header, and those inline functions are preferred to
kept because of the performance concerns.
The accessibility of the data structures are not changed, only logically
grouped to show that they are not intended to be used by applications.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.h | 579 +----------------------------------
lib/librte_ether/rte_ethdev_core.h | 602 +++++++++++++++++++++++++++++++++++++
3 files changed, 604 insertions(+), 578 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_core.h
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 48d84f445..34d014e71 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -28,6 +28,7 @@ SRCS-y += ethdev_profile.c
#
SYMLINK-y-include += rte_ethdev.h
SYMLINK-y-include += rte_ethdev_driver.h
+SYMLINK-y-include += rte_ethdev_core.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 523809c3a..80a9ce6fc 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1153,478 +1153,6 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
/**< l2 tunnel forwarding mask */
#define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
-/*
- * Definitions of all functions exported by an Ethernet driver through the
- * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
- * structure associated with an Ethernet device.
- */
-
-typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
-/**< @internal Ethernet device configuration. */
-
-typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to start a configured Ethernet device. */
-
-typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to stop a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link up a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link down a configured Ethernet device. */
-
-typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to close a configured Ethernet device. */
-
-typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
-/** <@internal Function used to reset a configured Ethernet device. */
-
-typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
-
-typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
-
-typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
- int wait_to_complete);
-/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
-
-typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_stats *igb_stats);
-/**< @internal Get global I/O statistics of an Ethernet device. */
-
-typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
-
-typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat *stats, unsigned n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
- const uint64_t *ids,
- uint64_t *values,
- unsigned int n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, unsigned size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
- unsigned int size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
- uint16_t queue_id,
- uint8_t stat_idx,
- uint8_t is_rx);
-/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
-
-typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_dev_info *dev_info);
-/**< @internal Get specific informations of an Ethernet device. */
-
-typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
-/**< @internal Get supported ptypes of an Ethernet device. */
-
-typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Start rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Stop rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- uint16_t nb_rx_desc,
- unsigned int socket_id,
- const struct rte_eth_rxconf *rx_conf,
- struct rte_mempool *mb_pool);
-/**< @internal Set up a receive queue of an Ethernet device. */
-
-typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t tx_queue_id,
- uint16_t nb_tx_desc,
- unsigned int socket_id,
- 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. */
-
-typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id);
-/**< @internal Get number of used descriptors on a receive queue. */
-
-typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
-/**< @internal Check DD bit of specific RX descriptor */
-
-typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
-/**< @internal Check the status of a Rx descriptor */
-
-typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
-/**< @internal Check the status of a Tx descriptor */
-
-typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
- char *fw_version, size_t fw_size);
-/**< @internal Get firmware information of an Ethernet device. */
-
-typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
-/**< @internal Force mbufs to be from TX ring. */
-
-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. */
-
-typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
-
-typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
- enum rte_vlan_type type, uint16_t tpid);
-/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
-
-typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
-/**< @internal set VLAN offload function by an Ethernet device. */
-
-typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal set port based TX VLAN insertion by an Ethernet device. */
-
-typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- int on);
-/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
-
-typedef uint16_t (*eth_rx_burst_t)(void *rxq,
- struct rte_mbuf **rx_pkts,
- uint16_t nb_pkts);
-/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_burst_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Send output packets on a transmit queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_prep_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Prepare output packets on a transmit queue of 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 */
-
-typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_fc_conf *fc_conf);
-/**< @internal Setup flow control parameter on an Ethernet device */
-
-typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_pfc_conf *pfc_conf);
-/**< @internal Setup priority flow control parameter on an Ethernet device */
-
-typedef int (*reta_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Update RSS redirection table on an Ethernet device */
-
-typedef int (*reta_query_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Query RSS redirection table on an Ethernet device */
-
-typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Update RSS hash configuration of an Ethernet device */
-
-typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Get current RSS hash configuration of an Ethernet device */
-
-typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
-/**< @internal Turn on SW controllable LED on an Ethernet device */
-
-typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
-/**< @internal Turn off SW controllable LED on an Ethernet device */
-
-typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
-/**< @internal Remove MAC address from receive address register */
-
-typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint32_t index,
- uint32_t vmdq);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint8_t on);
-/**< @internal Set a Unicast Hash bitmap */
-
-typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
- uint8_t on);
-/**< @internal Set all Unicast Hash bitmap */
-
-typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
- uint16_t queue_idx,
- uint16_t tx_rate);
-/**< @internal Set queue TX rate */
-
-typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
-/**< @internal Add a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
- uint8_t rule_id);
-/**< @internal Remove a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Add tunneling UDP port */
-
-typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Delete tunneling UDP port */
-
-typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-/**< @internal set the list of multicast addresses on an Ethernet device */
-
-typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
- struct timespec *timestamp,
- uint32_t flags);
-/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
-
-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_t)(struct rte_eth_dev *dev,
- struct rte_dev_reg_info *info);
-/**< @internal Retrieve registers */
-
-typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
-/**< @internal Retrieve eeprom size */
-
-typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Retrieve eeprom data */
-
-typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Program eeprom data */
-
-typedef int (*eth_l2_tunnel_eth_type_conf_t)
- (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
-/**< @internal config l2 tunnel ether type */
-
-typedef int (*eth_l2_tunnel_offload_set_t)
- (struct rte_eth_dev *dev,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**< @internal enable/disable the l2 tunnel offload functions */
-
-
-typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
- enum rte_filter_type filter_type,
- enum rte_filter_op filter_op,
- void *arg);
-/**< @internal Take operations to assigned filter type on an Ethernet device */
-
-typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
-
-typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Trafffic Metering and Policing (MTR) operations */
-
-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.
- */
-struct eth_dev_ops {
- eth_dev_configure_t dev_configure; /**< Configure device. */
- eth_dev_start_t dev_start; /**< Start device. */
- eth_dev_stop_t dev_stop; /**< Stop device. */
- eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
- eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
- eth_dev_close_t dev_close; /**< Close device. */
- eth_dev_reset_t dev_reset; /**< Reset device. */
- eth_link_update_t link_update; /**< Get device link state. */
-
- eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
- eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
- eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
- eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
- eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
- eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
- eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
- eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
- mtu_set_t mtu_set; /**< Set MTU. */
-
- eth_stats_get_t stats_get; /**< Get generic device statistics. */
- eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
- eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
- eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
- eth_xstats_get_names_t xstats_get_names;
- /**< Get names of extended statistics. */
- eth_queue_stats_mapping_set_t queue_stats_mapping_set;
- /**< Configure per queue stat counter mapping. */
-
- eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
- eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
- eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
- eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
- eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
- /**< Get packet types supported and identified by device. */
-
- vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
- vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
- vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
- vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
- vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
-
- eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
- eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
- eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
- eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
- eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
- eth_queue_release_t rx_queue_release; /**< Release RX queue. */
- eth_rx_queue_count_t rx_queue_count;
- /**< Get the number of used RX descriptors. */
- eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
- eth_rx_descriptor_status_t rx_descriptor_status;
- /**< Check the status of a Rx descriptor. */
- eth_tx_descriptor_status_t tx_descriptor_status;
- /**< Check the status of a Tx descriptor. */
- eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
- eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
- eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
- eth_queue_release_t tx_queue_release; /**< Release TX queue. */
- eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
-
- eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
- eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
-
- flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
- flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
- priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
-
- eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
- eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
-
- eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
- eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
-
- eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
- eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
- eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
- /** Config ether type of l2 tunnel. */
- eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
- /** Enable/disable l2 tunnel offload functions. */
-
- eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
-
- rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
- rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
- reta_update_t reta_update; /** Update redirection table. */
- reta_query_t reta_query; /** Query redirection table. */
-
- eth_get_reg_t get_reg; /**< Get registers. */
- eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
- eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
- eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
-
-
- eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
-
- eth_get_dcb_info get_dcb_info; /** Get DCB information. */
-
- eth_timesync_enable_t timesync_enable;
- /** Turn IEEE1588/802.1AS timestamping on. */
- eth_timesync_disable_t timesync_disable;
- /** Turn IEEE1588/802.1AS timestamping off. */
- eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
- /** Read the IEEE1588/802.1AS RX timestamp. */
- eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
- /** Read the IEEE1588/802.1AS TX timestamp. */
- eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
- eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
- eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
-
- eth_xstats_get_by_id_t xstats_get_by_id;
- /**< Get extended device statistic values by ID. */
- eth_xstats_get_names_by_id_t xstats_get_names_by_id;
- /**< Get name of extended device statistics by ID. */
-
- eth_tm_ops_get_t tm_ops_get;
- /**< Get Traffic Management (TM) operations. */
-
- eth_mtr_ops_get_t mtr_ops_get;
- /**< Get Traffic Metering and Policing (MTR) operations. */
-
- eth_pool_ops_supported_t pool_ops_supported;
- /**< Test if a port supports specific mempool ops */
-};
-
/**
* Function type used for RX packet processing packet callbacks.
*
@@ -1674,20 +1202,6 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
-/**
- * @internal
- * Structure used to hold information about the callbacks to be called for a
- * queue on RX and TX.
- */
-struct rte_eth_rxtx_callback {
- struct rte_eth_rxtx_callback *next;
- union{
- rte_rx_callback_fn rx;
- rte_tx_callback_fn tx;
- } fn;
- void *param;
-};
-
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1697,40 +1211,6 @@ enum rte_eth_dev_state {
RTE_ETH_DEV_DEFERRED,
};
-/**
- * @internal
- * The generic data structure associated with each ethernet device.
- *
- * Pointers to burst-oriented packet receive and transmit functions are
- * located at the beginning of the structure, along with the pointer to
- * where all the data elements for the particular device are stored in shared
- * memory. This split allows the function pointer and driver data to be per-
- * process, while the actual configuration data for the device is shared.
- */
-struct rte_eth_dev {
- eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
- eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
- eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
- struct rte_eth_dev_data *data; /**< Pointer to device data */
- const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
- struct rte_device *device; /**< Backing device */
- struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
- /** User application callbacks for NIC interrupts */
- struct rte_eth_dev_cb_list link_intr_cbs;
- /**
- * User-supplied functions called from rx_burst to post-process
- * received packets before passing them to the user
- */
- struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- /**
- * User-supplied functions called from tx_burst to pre-process
- * received packets before passing them to the driver for transmission.
- */
- struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- enum rte_eth_dev_state state; /**< Flag indicating the port state */
- void *security_ctx; /**< Context for security ops */
-} __rte_cache_aligned;
-
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
uint8_t nb_q_per_pool; /**< rx queue number per pool */
@@ -1741,57 +1221,7 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-/**
- * @internal
- * The data part, with no function pointers, associated with each ethernet device.
- *
- * This structure is safe to place in shared memory to be common among different
- * processes in a multi-process configuration.
- */
-struct rte_eth_dev_data {
- char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
-
- void **rx_queues; /**< Array of pointers to RX queues. */
- void **tx_queues; /**< Array of pointers to TX queues. */
- uint16_t nb_rx_queues; /**< Number of RX queues. */
- uint16_t nb_tx_queues; /**< Number of TX queues. */
-
- struct rte_eth_dev_sriov sriov; /**< SRIOV data */
-
- void *dev_private; /**< PMD-specific private data */
-
- struct rte_eth_link dev_link;
- /**< Link-level information & status */
-
- struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
- uint16_t mtu; /**< Maximum Transmission Unit. */
-
- uint32_t min_rx_buf_size;
- /**< Common rx buffer size handled by all queues */
-
- uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
- struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
- uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
- /** bitmap array of associating Ethernet MAC addresses to pools */
- struct ether_addr* hash_mac_addrs;
- /** Device Ethernet MAC addresses of hash filtering. */
- uint16_t port_id; /**< Device [external] port identifier. */
- __extension__
- uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
- scattered_rx : 1, /**< RX of scattered packets 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). */
- lro : 1; /**< RX LRO is ON(1) / OFF(0) */
- uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint32_t dev_flags; /**< Capabilities */
- enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
- int numa_node; /**< NUMA node connection */
- struct rte_vlan_filter_conf vlan_filter_conf;
- /**< VLAN filter configuration. */
-};
+#include <rte_ethdev_core.h>
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
@@ -1800,13 +1230,6 @@ struct rte_eth_dev_data {
/** Device supports device removal interrupt */
#define RTE_ETH_DEV_INTR_RMV 0x0008
-/**
- * @internal
- * The pool of *rte_eth_dev* structures. The size of the pool
- * is configured at compile-time in the <rte_ethdev.c> file.
- */
-extern struct rte_eth_dev rte_eth_devices[];
-
/**
* Iterates over valid ethdev ports.
*
diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h
new file mode 100644
index 000000000..65e1b0bc9
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_core.h
@@ -0,0 +1,602 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
+ */
+
+#ifndef _RTE_ETHDEV_CORE_H_
+#define _RTE_ETHDEV_CORE_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device internal header.
+ *
+ * This header contains internal data types. But they are still part of the
+ * public API because they are used by inline functions in the published API.
+ *
+ * Applications should not use these directly.
+ *
+ */
+
+/*
+ * Definitions of all functions exported by an Ethernet driver through the
+ * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
+ * structure associated with an Ethernet device.
+ */
+struct rte_eth_dev;
+
+typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
+/**< @internal Ethernet device configuration. */
+
+typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to start a configured Ethernet device. */
+
+typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to stop a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link up a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link down a configured Ethernet device. */
+
+typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to close a configured Ethernet device. */
+
+typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
+/** <@internal Function used to reset a configured Ethernet device. */
+
+typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
+
+typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
+
+typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
+ int wait_to_complete);
+/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
+
+typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_stats *igb_stats);
+/**< @internal Get global I/O statistics of an Ethernet device. */
+
+typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
+
+typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat *stats, unsigned n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
+ const uint64_t *ids,
+ uint64_t *values,
+ unsigned int n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, unsigned size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+ unsigned int size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id,
+ uint8_t stat_idx,
+ uint8_t is_rx);
+/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
+
+typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_dev_info *dev_info);
+/**< @internal Get specific informations of an Ethernet device. */
+
+typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
+/**< @internal Get supported ptypes of an Ethernet device. */
+
+typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Start rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Stop rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ uint16_t nb_rx_desc,
+ unsigned int socket_id,
+ const struct rte_eth_rxconf *rx_conf,
+ struct rte_mempool *mb_pool);
+/**< @internal Set up a receive queue of an Ethernet device. */
+
+typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t tx_queue_id,
+ uint16_t nb_tx_desc,
+ unsigned int socket_id,
+ 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. */
+
+typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id);
+/**< @internal Get number of used descriptors on a receive queue. */
+
+typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
+/**< @internal Check DD bit of specific RX descriptor */
+
+typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
+/**< @internal Check the status of a Rx descriptor */
+
+typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
+/**< @internal Check the status of a Tx descriptor */
+
+typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size);
+/**< @internal Get firmware information of an Ethernet device. */
+
+typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
+/**< @internal Force mbufs to be from TX ring. */
+
+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. */
+
+typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
+
+typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
+ enum rte_vlan_type type, uint16_t tpid);
+/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
+
+typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
+/**< @internal set VLAN offload function by an Ethernet device. */
+
+typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal set port based TX VLAN insertion by an Ethernet device. */
+
+typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ int on);
+/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
+
+typedef uint16_t (*eth_rx_burst_t)(void *rxq,
+ struct rte_mbuf **rx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_burst_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Send output packets on a transmit queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_prep_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Prepare output packets on a transmit queue of 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 */
+
+typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_fc_conf *fc_conf);
+/**< @internal Setup flow control parameter on an Ethernet device */
+
+typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_pfc_conf *pfc_conf);
+/**< @internal Setup priority flow control parameter on an Ethernet device */
+
+typedef int (*reta_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Update RSS redirection table on an Ethernet device */
+
+typedef int (*reta_query_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Query RSS redirection table on an Ethernet device */
+
+typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Update RSS hash configuration of an Ethernet device */
+
+typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Get current RSS hash configuration of an Ethernet device */
+
+typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
+/**< @internal Turn on SW controllable LED on an Ethernet device */
+
+typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
+/**< @internal Turn off SW controllable LED on an Ethernet device */
+
+typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
+/**< @internal Remove MAC address from receive address register */
+
+typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint32_t index,
+ uint32_t vmdq);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint8_t on);
+/**< @internal Set a Unicast Hash bitmap */
+
+typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
+ uint8_t on);
+/**< @internal Set all Unicast Hash bitmap */
+
+typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
+ uint16_t queue_idx,
+ uint16_t tx_rate);
+/**< @internal Set queue TX rate */
+
+typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
+/**< @internal Add a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
+ uint8_t rule_id);
+/**< @internal Remove a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Add tunneling UDP port */
+
+typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Delete tunneling UDP port */
+
+typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
+/**< @internal set the list of multicast addresses on an Ethernet device */
+
+typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
+ struct timespec *timestamp,
+ uint32_t flags);
+/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
+
+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_t)(struct rte_eth_dev *dev,
+ struct rte_dev_reg_info *info);
+/**< @internal Retrieve registers */
+
+typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
+/**< @internal Retrieve eeprom size */
+
+typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Retrieve eeprom data */
+
+typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Program eeprom data */
+
+typedef int (*eth_l2_tunnel_eth_type_conf_t)
+ (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
+/**< @internal config l2 tunnel ether type */
+
+typedef int (*eth_l2_tunnel_offload_set_t)
+ (struct rte_eth_dev *dev,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
+/**< @internal enable/disable the l2 tunnel offload functions */
+
+
+typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
+ enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op,
+ void *arg);
+/**< @internal Take operations to assigned filter type on an Ethernet device */
+
+typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
+
+typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Trafffic Metering and Policing (MTR) operations */
+
+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.
+ */
+struct eth_dev_ops {
+ eth_dev_configure_t dev_configure; /**< Configure device. */
+ eth_dev_start_t dev_start; /**< Start device. */
+ eth_dev_stop_t dev_stop; /**< Stop device. */
+ eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
+ eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
+ eth_dev_close_t dev_close; /**< Close device. */
+ eth_dev_reset_t dev_reset; /**< Reset device. */
+ eth_link_update_t link_update; /**< Get device link state. */
+
+ eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
+ eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
+ eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
+ eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
+ eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
+ eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
+ eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
+ eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
+ mtu_set_t mtu_set; /**< Set MTU. */
+
+ eth_stats_get_t stats_get; /**< Get generic device statistics. */
+ eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
+ eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
+ eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
+ eth_xstats_get_names_t xstats_get_names;
+ /**< Get names of extended statistics. */
+ eth_queue_stats_mapping_set_t queue_stats_mapping_set;
+ /**< Configure per queue stat counter mapping. */
+
+ eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
+ eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
+ eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
+ eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
+ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
+ /**< Get packet types supported and identified by device. */
+
+ vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
+ vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
+ vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
+ vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
+ vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
+
+ eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
+ eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
+ eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
+ eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
+ eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
+ eth_queue_release_t rx_queue_release; /**< Release RX queue. */
+ eth_rx_queue_count_t rx_queue_count;
+ /**< Get the number of used RX descriptors. */
+ eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
+ eth_rx_descriptor_status_t rx_descriptor_status;
+ /**< Check the status of a Rx descriptor. */
+ eth_tx_descriptor_status_t tx_descriptor_status;
+ /**< Check the status of a Tx descriptor. */
+ eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
+ eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
+ eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
+ eth_queue_release_t tx_queue_release; /**< Release TX queue. */
+ eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
+
+ eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
+ eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
+
+ flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
+ flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
+ priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
+
+ eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
+ eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
+
+ eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
+ eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
+
+ eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
+ eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
+ eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
+ /** Config ether type of l2 tunnel. */
+ eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
+ /** Enable/disable l2 tunnel offload functions. */
+
+ eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
+
+ rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
+ rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
+ reta_update_t reta_update; /** Update redirection table. */
+ reta_query_t reta_query; /** Query redirection table. */
+
+ eth_get_reg_t get_reg; /**< Get registers. */
+ eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
+ eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
+ eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
+
+
+ eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
+
+ eth_get_dcb_info get_dcb_info; /** Get DCB information. */
+
+ eth_timesync_enable_t timesync_enable;
+ /** Turn IEEE1588/802.1AS timestamping on. */
+ eth_timesync_disable_t timesync_disable;
+ /** Turn IEEE1588/802.1AS timestamping off. */
+ eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
+ /** Read the IEEE1588/802.1AS RX timestamp. */
+ eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
+ /** Read the IEEE1588/802.1AS TX timestamp. */
+ eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
+ eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
+ eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
+
+ eth_xstats_get_by_id_t xstats_get_by_id;
+ /**< Get extended device statistic values by ID. */
+ eth_xstats_get_names_by_id_t xstats_get_names_by_id;
+ /**< Get name of extended device statistics by ID. */
+
+ eth_tm_ops_get_t tm_ops_get;
+ /**< Get Traffic Management (TM) operations. */
+
+ eth_mtr_ops_get_t mtr_ops_get;
+ /**< Get Traffic Metering and Policing (MTR) operations. */
+
+ eth_pool_ops_supported_t pool_ops_supported;
+ /**< Test if a port supports specific mempool ops */
+};
+
+/**
+ * @internal
+ * Structure used to hold information about the callbacks to be called for a
+ * queue on RX and TX.
+ */
+struct rte_eth_rxtx_callback {
+ struct rte_eth_rxtx_callback *next;
+ union{
+ rte_rx_callback_fn rx;
+ rte_tx_callback_fn tx;
+ } fn;
+ void *param;
+};
+
+/**
+ * @internal
+ * The generic data structure associated with each ethernet device.
+ *
+ * Pointers to burst-oriented packet receive and transmit functions are
+ * located at the beginning of the structure, along with the pointer to
+ * where all the data elements for the particular device are stored in shared
+ * memory. This split allows the function pointer and driver data to be per-
+ * process, while the actual configuration data for the device is shared.
+ */
+struct rte_eth_dev {
+ eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
+ eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
+ eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
+ struct rte_eth_dev_data *data; /**< Pointer to device data */
+ const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
+ struct rte_device *device; /**< Backing device */
+ struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
+ /** User application callbacks for NIC interrupts */
+ struct rte_eth_dev_cb_list link_intr_cbs;
+ /**
+ * User-supplied functions called from rx_burst to post-process
+ * received packets before passing them to the user
+ */
+ struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ /**
+ * User-supplied functions called from tx_burst to pre-process
+ * received packets before passing them to the driver for transmission.
+ */
+ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ enum rte_eth_dev_state state; /**< Flag indicating the port state */
+ void *security_ctx; /**< Context for security ops */
+} __rte_cache_aligned;
+
+struct rte_eth_dev_sriov;
+
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each ethernet device.
+ *
+ * This structure is safe to place in shared memory to be common among different
+ * processes in a multi-process configuration.
+ */
+struct rte_eth_dev_data {
+ char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
+
+ void **rx_queues; /**< Array of pointers to RX queues. */
+ void **tx_queues; /**< Array of pointers to TX queues. */
+ uint16_t nb_rx_queues; /**< Number of RX queues. */
+ uint16_t nb_tx_queues; /**< Number of TX queues. */
+
+ struct rte_eth_dev_sriov sriov; /**< SRIOV data */
+
+ void *dev_private; /**< PMD-specific private data */
+
+ struct rte_eth_link dev_link;
+ /**< Link-level information & status */
+
+ struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
+ uint16_t mtu; /**< Maximum Transmission Unit. */
+
+ uint32_t min_rx_buf_size;
+ /**< Common rx buffer size handled by all queues */
+
+ uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
+ struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
+ uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
+ /** bitmap array of associating Ethernet MAC addresses to pools */
+ struct ether_addr* hash_mac_addrs;
+ /** Device Ethernet MAC addresses of hash filtering. */
+ uint16_t port_id; /**< Device [external] port identifier. */
+ __extension__
+ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
+ scattered_rx : 1, /**< RX of scattered packets 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). */
+ lro : 1; /**< RX LRO is ON(1) / OFF(0) */
+ uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint32_t dev_flags; /**< Capabilities */
+ enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
+ int numa_node; /**< NUMA node connection */
+ struct rte_vlan_filter_conf vlan_filter_conf;
+ /**< VLAN filter configuration. */
+};
+
+/**
+ * @internal
+ * The pool of *rte_eth_dev* structures. The size of the pool
+ * is configured at compile-time in the <rte_ethdev.c> file.
+ */
+extern struct rte_eth_dev rte_eth_devices[];
+
+#endif /* _RTE_ETHDEV_CORE_H_ */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v4 3/4] ethdev: reorder inline functions
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 2/4] ethdev: separate internal structures into own header Ferruh Yigit
@ 2018-01-20 16:57 ` Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
` (2 subsequent siblings)
4 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-20 16:57 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Move all inline function to the end of the ethdev.h header file and move
the ethdev_core.h just before inline functions.
Since inline functions need data structures in ethdev_core.h, this
reorder is to group them and make it clear where put further inline
functions.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 2694 +++++++++++++++++++++--------------------
1 file changed, 1348 insertions(+), 1346 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 80a9ce6fc..2c90175c6 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1221,8 +1221,6 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-#include <rte_ethdev_core.h>
-
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
/** Device is a bonded slave */
@@ -2167,1784 +2165,1788 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id);
*/
int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
+typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
+ void *userdata);
+
/**
+ * Structure used to buffer packets for future TX
+ * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ */
+struct rte_eth_dev_tx_buffer {
+ buffer_tx_error_fn error_callback;
+ void *error_userdata;
+ uint16_t size; /**< Size of buffer for buffered tx */
+ uint16_t length; /**< Number of packets in the array */
+ struct rte_mbuf *pkts[];
+ /**< Pending packets to be sent on explicit flush or when full */
+};
+
+/**
+ * Calculate the size of the tx buffer.
*
- * Retrieve a burst of input packets from a receive queue of an Ethernet
- * device. The retrieved packets are stored in *rte_mbuf* structures whose
- * pointers are supplied in the *rx_pkts* array.
- *
- * The rte_eth_rx_burst() function loops, parsing the RX ring of the
- * receive queue, up to *nb_pkts* packets, and for each completed RX
- * descriptor in the ring, it performs the following operations:
+ * @param sz
+ * Number of stored packets.
+ */
+#define RTE_ETH_TX_BUFFER_SIZE(sz) \
+ (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+
+/**
+ * Initialize default values for buffered transmitting
*
- * - Initialize the *rte_mbuf* data structure associated with the
- * RX descriptor according to the information provided by the NIC into
- * that RX descriptor.
+ * @param buffer
+ * Tx buffer to be initialized.
+ * @param size
+ * Buffer size
+ * @return
+ * 0 if no error
+ */
+int
+rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+
+/**
+ * Configure a callback for buffered packets which cannot be sent
*
- * - Store the *rte_mbuf* data structure into the next entry of the
- * *rx_pkts* array.
+ * Register a specific callback to be called when an attempt is made to send
+ * all packets buffered on an ethernet port, but not all packets can
+ * successfully be sent. The callback registered here will be called only
+ * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
+ * The default callback configured for each queue by default just frees the
+ * packets back to the calling mempool. If additional behaviour is required,
+ * for example, to count dropped packets, or to retry transmission of packets
+ * which cannot be sent, this function should be used to register a suitable
+ * callback function to implement the desired behaviour.
+ * The example callback "rte_eth_count_unsent_packet_callback()" is also
+ * provided as reference.
*
- * - Replenish the RX descriptor with a new *rte_mbuf* buffer
- * allocated from the memory pool associated with the receive queue at
- * initialization time.
+ * @param buffer
+ * The port identifier of the Ethernet device.
+ * @param callback
+ * The function to be used as the callback.
+ * @param userdata
+ * Arbitrary parameter to be passed to the callback function
+ * @return
+ * 0 on success, or -1 on error with rte_errno set appropriately
+ */
+int
+rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
+ buffer_tx_error_fn callback, void *userdata);
+
+/**
+ * Callback function for silently dropping unsent buffered packets.
*
- * When retrieving an input packet that was scattered by the controller
- * into multiple receive descriptors, the rte_eth_rx_burst() function
- * appends the associated *rte_mbuf* buffers to the first buffer of the
- * packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets silently and is used by tx buffered
+ * operations as default behavior.
*
- * The rte_eth_rx_burst() function returns the number of packets
- * actually retrieved, which is the number of *rte_mbuf* data structures
- * effectively supplied into the *rx_pkts* array.
- * A return value equal to *nb_pkts* indicates that the RX queue contained
- * at least *rx_pkts* packets, and this is likely to signify that other
- * received packets remain in the input queue. Applications implementing
- * a "retrieve as much received packets as possible" policy can check this
- * specific case and keep invoking the rte_eth_rx_burst() function until
- * a value less than *nb_pkts* is returned.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * This receive method has the following advantages:
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * - It allows a run-to-completion network stack engine to retrieve and
- * to immediately process received packets in a fast burst-oriented
- * approach, avoiding the overhead of unnecessary intermediate packet
- * queue/dequeue operations.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Not used
+ */
+void
+rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Callback function for tracking unsent buffered packets.
*
- * - Conversely, it also allows an asynchronous-oriented processing
- * method to retrieve bursts of received packets and to immediately
- * queue them for further parallel processing by another logical core,
- * for instance. However, instead of having received packets being
- * individually queued by the driver, this approach allows the caller
- * of the rte_eth_rx_burst() function to queue a burst of retrieved
- * packets at a time and therefore dramatically reduce the cost of
- * enqueue/dequeue operations per packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets, but also updates a user-supplied counter
+ * to track the overall number of packets dropped. The counter should be an
+ * uint64_t variable.
*
- * - It allows the rte_eth_rx_burst() function of the driver to take
- * advantage of burst-oriented hardware features (CPU cache,
- * prefetch instructions, and so on) to minimize the number of CPU
- * cycles per packet.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * To summarize, the proposed receive API enables many
- * burst-oriented optimizations in both synchronous and asynchronous
- * packet processing environments with no overhead in both cases.
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * The rte_eth_rx_burst() function does not provide any error
- * notification to avoid the corresponding overhead. As a hint, the
- * upper-level application might check the status of the device link once
- * being systematically returned a 0 value for a given number of tries.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Pointer to an uint64_t value, which will be incremented by unsent
+ */
+void
+rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Request the driver to free mbufs currently cached by the driver. The
+ * driver will only free the mbuf if it is no longer in use. It is the
+ * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
+ * called if needed.
*
* @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
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
* to rte_eth_dev_configure().
- * @param rx_pkts
- * The address of an array of pointers to *rte_mbuf* structures that
- * must be large enough to store *nb_pkts* pointers in it.
- * @param nb_pkts
- * The maximum number of packets to retrieve.
+ * @param free_cnt
+ * Maximum number of packets to free. Use 0 to indicate all possible packets
+ * should be freed. Note that a packet may be using multiple mbufs.
* @return
- * The number of packets actually retrieved, which is the number
- * of pointers to *rte_mbuf* structures effectively supplied to the
- * *rx_pkts* array.
+ * Failure: < 0
+ * -ENODEV: Invalid interface
+ * -ENOTSUP: Driver does not support function
+ * Success: >= 0
+ * 0-n: Number of packets freed. More packets may still remain in ring that
+ * are in use.
*/
-static inline uint16_t
-rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+int
+rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
- if (queue_id >= dev->data->nb_rx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
- int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
- rx_pkts, nb_pkts);
+/**
+ * The eth device event type for interrupt, and maybe others in the future.
+ */
+enum rte_eth_event_type {
+ RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
+ RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
+ RTE_ETH_EVENT_QUEUE_STATE,
+ /**< queue state event (enabled/disabled) */
+ RTE_ETH_EVENT_INTR_RESET,
+ /**< reset interrupt event, sent to VF on PF reset */
+ RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
+ RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
+ 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_MAX /**< max value of this enum */
+};
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
+ enum rte_eth_event_type event, void *cb_arg, void *ret_param);
+/**< user application callback to be registered for interrupts */
- if (unlikely(cb != NULL)) {
- do {
- nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
- nb_pkts, cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
- return nb_rx;
-}
/**
- * Get the number of used descriptors of a rx queue
+ * Register a callback function for port event.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
+ * Port id.
+ * RTE_ETH_ALL means register the event for all port ids.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback.
+ *
* @return
- * The number of used descriptors in the specific queue, or:
- * (-EINVAL) if *port_id* or *queue_id* is invalid
- * (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
- dev = &rte_eth_devices[port_id];
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
- if (queue_id >= dev->data->nb_rx_queues)
- return -EINVAL;
-
- return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
-}
+int rte_eth_dev_callback_register(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check if the DD bit of the specific RX descriptor in the queue has been set
+ * Unregister a callback function for port event.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
- * @param offset
- * The offset of the descriptor ID from tail.
+ * Port id.
+ * RTE_ETH_ALL means unregister the event for all port ids.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback. -1 means to
+ * remove all for the same callback address and same event.
+ *
* @return
- * - (1) if the specific DD bit is set.
- * - (0) if the specific DD bit is not set.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
- return (*dev->dev_ops->rx_descriptor_done)( \
- dev->data->rx_queues[queue_id], offset);
-}
-
-#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
-#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
-#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_callback_unregister(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check the status of a Rx descriptor in the queue
- *
- * It should be called in a similar context than the Rx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * 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 packet arrives.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_enable() function enables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Rx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the next
- * packet to be received by the driver).
- *
+ * 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
- * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
- * receive a packet.
- * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
- * not yet processed by the driver (i.e. in the receive queue).
- * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
- * the driver and not yet returned to hw, or reserved by the hw.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-static inline int
-rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
- uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *rxq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_rx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
- rxq = dev->data->rx_queues[queue_id];
-
- return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
-}
-
-#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
-#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
-#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
/**
- * Check the status of a Tx descriptor in the queue.
- *
- * It should be called in a similar context than the Tx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * When lcore wakes up from rx interrupt indicating packet coming, disable rx
+ * interrupt and returns to polling mode.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_disable() function disables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Tx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the place where
- * the next packet will be send).
- *
+ * 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
- * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
- * in the transmit queue.
- * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
- * be reused by the driver.
- * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
- * driver or the hardware.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
- uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *txq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
- txq = dev->data->tx_queues[queue_id];
-
- return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
-}
+int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
/**
- * Send a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_burst() function is invoked to transmit output packets
- * on the output queue *queue_id* of the Ethernet device designated by its
- * *port_id*.
- * The *nb_pkts* parameter is the number of packets to send which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
- * up to the number of transmit descriptors available in the TX ring of the
- * transmit queue.
- * For each packet to send, the rte_eth_tx_burst() function performs
- * the following operations:
- *
- * - Pick up the next available descriptor in the transmit ring.
- *
- * - Free the network buffer previously sent with that descriptor, if any.
- *
- * - Initialize the transmit descriptor with the information provided
- * in the *rte_mbuf data structure.
- *
- * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
- * the rte_eth_tx_burst() function uses several transmit descriptors
- * of the ring.
- *
- * The rte_eth_tx_burst() function returns the number of packets it
- * actually sent. A return value equal to *nb_pkts* means that all packets
- * have been sent, and this is likely to signify that other output packets
- * could be immediately transmitted again. Applications that implement a
- * "send as many packets to transmit as possible" policy can check this
- * specific case and keep invoking the rte_eth_tx_burst() function until
- * a value less than *nb_pkts* is returned.
- *
- * It is the responsibility of the rte_eth_tx_burst() function to
- * transparently free the memory buffers of packets previously sent.
- * This feature is driven by the *tx_free_thresh* value supplied to the
- * rte_eth_dev_configure() function at device configuration time.
- * When the number of free TX descriptors drops below this threshold, the
- * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
- * of those packets whose transmission was effectively completed.
- *
- * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
- * invoke this function concurrently on the same tx queue without SW lock.
- * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
+ * RX Interrupt control per port.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to transmit.
+ * @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
- * The number of output packets actually stored in transmit descriptors of
- * the transmit ring. The return value can be less than the value of the
- * *tx_pkts* parameter when the transmit ring is full or has been filled up.
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline uint16_t
-rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
-
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
-
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
-
- if (unlikely(cb != NULL)) {
- do {
- nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
- cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
-
- return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
-}
+int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
/**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
- * Process a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
- * transmitted on the output queue *queue_id* of the Ethernet device designated
- * by its *port_id*.
- * The *nb_pkts* parameter is the number of packets to be prepared which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * For each packet to send, the rte_eth_tx_prepare() function performs
- * the following operations:
- *
- * - Check if packet meets devices requirements for tx offloads.
- *
- * - Check limitations about number of segments.
- *
- * - Check additional requirements when debug is enabled.
- *
- * - Update and/or reset required checksums when tx offload is set for packet.
- *
- * Since this function can modify packet data, provided mbufs must be safely
- * writable (e.g. modified data cannot be in shared segment).
- *
- * The rte_eth_tx_prepare() function returns the number of packets ready to be
- * sent. A return value equal to *nb_pkts* means that all packets are valid and
- * ready to be sent, otherwise stops processing on the first invalid packet and
- * leaves the rest packets untouched.
- *
- * When this functionality is not implemented in the driver, all packets are
- * are returned untouched.
+ * RX Interrupt control per queue.
*
* @param port_id
* The port identifier of the Ethernet device.
- * The value must be a valid port id.
* @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * 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 tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to process.
+ * @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
- * The number of packets correct and ready to be sent. The return value can be
- * less than the value of the *tx_pkts* parameter when some packet doesn't
- * meet devices requirements with rte_errno set appropriately:
- * - -EINVAL: offload flags are not correctly set
- * - -ENOTSUP: the offload feature is not supported by the hardware
- *
- */
-
-#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
-
-static inline uint16_t
-rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (!rte_eth_dev_is_valid_port(port_id)) {
- RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- if (!dev->tx_pkt_prepare)
- return nb_pkts;
-
- return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
- tx_pkts, nb_pkts);
-}
-
-#else
-
-/*
- * Native NOOP operation for compilation targets which doesn't require any
- * preparations steps, and functional NOOP may introduce unnecessary performance
- * drop.
- *
- * Generally this is not a good idea to turn it on globally and didn't should
- * be used if behavior of tx_preparation can change.
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-
-static inline uint16_t
-rte_eth_tx_prepare(__rte_unused uint16_t port_id,
- __rte_unused uint16_t queue_id,
- __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- return nb_pkts;
-}
-
-#endif
-
-typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
- void *userdata);
+int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
+ int epfd, int op, void *data);
/**
- * Structure used to buffer packets for future TX
- * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ * Turn on the LED on the Ethernet device.
+ * This function turns on the LED on the Ethernet device.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-struct rte_eth_dev_tx_buffer {
- buffer_tx_error_fn error_callback;
- void *error_userdata;
- uint16_t size; /**< Size of buffer for buffered tx */
- uint16_t length; /**< Number of packets in the array */
- struct rte_mbuf *pkts[];
- /**< Pending packets to be sent on explicit flush or when full */
-};
+int rte_eth_led_on(uint16_t port_id);
/**
- * Calculate the size of the tx buffer.
+ * Turn off the LED on the Ethernet device.
+ * This function turns off the LED on the Ethernet device.
*
- * @param sz
- * Number of stored packets.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
*/
-#define RTE_ETH_TX_BUFFER_SIZE(sz) \
- (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+int rte_eth_led_off(uint16_t port_id);
/**
- * Initialize default values for buffered transmitting
+ * Get current status of the Ethernet link flow control for Ethernet device
*
- * @param buffer
- * Tx buffer to be initialized.
- * @param size
- * Buffer size
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure where to store the flow control parameters.
* @return
- * 0 if no error
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control.
+ * - (-ENODEV) if *port_id* invalid.
*/
-int
-rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Send any packets queued up for transmission on a port and HW queue
- *
- * This causes an explicit flush of packets previously buffered via the
- * rte_eth_tx_buffer() function. It returns the number of packets successfully
- * sent to the NIC, and calls the error callback for any unsent packets. Unless
- * explicitly set up otherwise, the default callback simply frees the unsent
- * packets back to the owning mempool.
+ * Configure the Ethernet link flow control for Ethernet device
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer of packets to be transmit.
+ * @param fc_conf
+ * The pointer to the structure of the flow control parameters.
* @return
- * The number of packets successfully sent to the Ethernet device. The error
- * callback is called for any packets which could not be sent.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure
*/
-static inline uint16_t
-rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer)
-{
- uint16_t sent;
- uint16_t to_send = buffer->length;
-
- if (to_send == 0)
- return 0;
-
- sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
-
- buffer->length = 0;
-
- /* All packets sent, or to be dealt with by callback below */
- if (unlikely(sent != to_send))
- buffer->error_callback(&buffer->pkts[sent], to_send - sent,
- buffer->error_userdata);
-
- return sent;
-}
+int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Buffer a single packet for future transmission on a port and queue
- *
- * This function takes a single mbuf/packet and buffers it for later
- * transmission on the particular port and queue specified. Once the buffer is
- * full of packets, an attempt will be made to transmit all the buffered
- * packets. In case of error, where not all packets can be transmitted, a
- * callback is called with the unsent packets as a parameter. If no callback
- * is explicitly set up, the unsent packets are just freed back to the owning
- * mempool. The function returns the number of packets actually sent i.e.
- * 0 if no buffer flush occurred, otherwise the number of packets successfully
- * flushed
+ * Configure the Ethernet priority flow control under DCB environment
+ * for Ethernet device.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer used to collect packets to be sent.
- * @param tx_pkt
- * Pointer to the packet mbuf to be sent.
+ * The port identifier of the Ethernet device.
+ * @param pfc_conf
+ * The pointer to the structure of the priority flow control parameters.
* @return
- * 0 = packet has been buffered for later transmission
- * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
- * causing N packets to be sent, and the error callback to be called for
- * the rest.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure
*/
-static __rte_always_inline uint16_t
-rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
-{
- buffer->pkts[buffer->length++] = tx_pkt;
- if (buffer->length < buffer->size)
- return 0;
-
- return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
-}
+int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_pfc_conf *pfc_conf);
/**
- * Configure a callback for buffered packets which cannot be sent
- *
- * Register a specific callback to be called when an attempt is made to send
- * all packets buffered on an ethernet port, but not all packets can
- * successfully be sent. The callback registered here will be called only
- * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
- * The default callback configured for each queue by default just frees the
- * packets back to the calling mempool. If additional behaviour is required,
- * for example, to count dropped packets, or to retry transmission of packets
- * which cannot be sent, this function should be used to register a suitable
- * callback function to implement the desired behaviour.
- * The example callback "rte_eth_count_unsent_packet_callback()" is also
- * provided as reference.
+ * Add a MAC address to an internal array of addresses used to enable whitelist
+ * filtering to accept packets only if the destination MAC address matches.
*
- * @param buffer
+ * @param port
* The port identifier of the Ethernet device.
- * @param callback
- * The function to be used as the callback.
- * @param userdata
- * Arbitrary parameter to be passed to the callback function
+ * @param mac_addr
+ * The MAC address to add.
+ * @param pool
+ * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
+ * not enabled, this should be set to 0.
* @return
- * 0 on success, or -1 on error with rte_errno set appropriately
+ * - (0) if successfully added or *mac_addr" was already added.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port* is invalid.
+ * - (-ENOSPC) if no more MAC addresses can be added.
+ * - (-EINVAL) if MAC address is invalid.
*/
-int
-rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
- buffer_tx_error_fn callback, void *userdata);
+int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+ uint32_t pool);
/**
- * Callback function for silently dropping unsent buffered packets.
- *
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets silently and is used by tx buffered
- * operations as default behavior.
- *
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
- *
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * Remove a MAC address from the internal array of addresses.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Not used
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param mac_addr
+ * MAC address to remove.
+ * @return
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-void
-rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
/**
- * Callback function for tracking unsent buffered packets.
- *
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets, but also updates a user-supplied counter
- * to track the overall number of packets dropped. The counter should be an
- * uint64_t variable.
- *
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
- *
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * Set the default MAC address.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Pointer to an uint64_t value, which will be incremented by unsent
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param mac_addr
+ * New default MAC address.
+ * @return
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EINVAL) if MAC address is invalid.
*/
-void
-rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_dev_default_mac_addr_set(uint16_t port,
+ struct ether_addr *mac_addr);
/**
- * Request the driver to free mbufs currently cached by the driver. The
- * driver will only free the mbuf if it is no longer in use. It is the
- * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
- * called if needed.
+ * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port_id
+ * @param port
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param free_cnt
- * Maximum number of packets to free. Use 0 to indicate all possible packets
- * should be freed. Note that a packet may be using multiple mbufs.
+ * @param reta_conf
+ * RETA to update.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
* @return
- * Failure: < 0
- * -ENODEV: Invalid interface
- * -ENOTSUP: Driver does not support function
- * Success: >= 0
- * 0-n: Number of packets freed. More packets may still remain in ring that
- * are in use.
- */
-int
-rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
-
-/**
- * The eth device event type for interrupt, and maybe others in the future.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-enum rte_eth_event_type {
- RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
- RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
- RTE_ETH_EVENT_QUEUE_STATE,
- /**< queue state event (enabled/disabled) */
- RTE_ETH_EVENT_INTR_RESET,
- /**< reset interrupt event, sent to VF on PF reset */
- RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
- RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
- 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_MAX /**< max value of this enum */
-};
-
-typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
- enum rte_eth_event_type event, void *cb_arg, void *ret_param);
-/**< user application callback to be registered for interrupts */
-
-
+int rte_eth_dev_rss_reta_update(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
-/**
- * Register a callback function for port event.
- *
- * @param port_id
- * Port id.
- * RTE_ETH_ALL means register the event for all port ids.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback.
+ /**
+ * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to query.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_register(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_dev_rss_reta_query(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
-/**
- * Unregister a callback function for port event.
- *
- * @param port_id
- * Port id.
- * RTE_ETH_ALL means unregister the event for all port ids.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback. -1 means to
- * remove all for the same callback address and same event.
+ /**
+ * Updates unicast hash table for receiving packet with the given destination
+ * MAC address, and the packet is routed to all VFs for which the RX mode is
+ * accept packets that match the unicast hash table.
*
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param addr
+ * Unicast MAC address.
+ * @param on
+ * 1 - Set an unicast hash bit for receiving packets with the MAC address.
+ * 0 - Clear an unicast hash bit.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_unregister(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+ uint8_t on);
-/**
- * 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 packet arrives.
- *
- * The rte_eth_dev_rx_intr_enable() function enables rx queue
- * interrupt on specific rx queue of a port.
+ /**
+ * Updates all unicast hash bitmaps for receiving packet with any Unicast
+ * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
+ * mode is accept packets that match the unicast hash table.
*
- * @param port_id
+ * @param port
* 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 on
+ * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
+ * MAC addresses
+ * 0 - Clear all unicast hash bitmaps
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
/**
- * 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.
+ * Set a traffic mirroring rule on an Ethernet device
*
* @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 mirror_conf
+ * The pointer to the traffic mirroring structure describing the mirroring rule.
+ * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
+ * destination pool and the value of rule if enable vlan or pool mirroring.
+ *
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
+ * @param on
+ * 1 - Enable a mirroring rule.
+ * 0 - Disable a mirroring rule.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if the mr_conf information is not correct.
*/
-int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
+int rte_eth_mirror_rule_set(uint16_t port_id,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
/**
- * RX Interrupt control per port.
+ * Reset a traffic mirroring rule on an Ethernet device.
*
* @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.
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
+int rte_eth_mirror_rule_reset(uint16_t port_id,
+ uint8_t rule_id);
/**
- * RX Interrupt control per queue.
+ * Set the rate limitation for a queue on an Ethernet device.
*
* @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.
+ * @param queue_idx
+ * The queue id.
+ * @param tx_rate
+ * The tx rate in Mbps. Allocated from the total port link speed.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
- int epfd, int op, void *data);
+int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
+ uint16_t tx_rate);
-/**
- * Turn on the LED on the Ethernet device.
- * This function turns on the LED on the Ethernet device.
+ /**
+ * Configuration of Receive Side Scaling hash computation of Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param rss_conf
+ * The new configuration to use for RSS hash computation on the port.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_led_on(uint16_t port_id);
+int rte_eth_dev_rss_hash_update(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * Turn off the LED on the Ethernet device.
- * This function turns off the LED on the Ethernet device.
+ /**
+ * Retrieve current configuration of Receive Side Scaling hash computation
+ * of Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param rss_conf
+ * Where to store the current RSS hash configuration of the Ethernet device.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support RSS.
*/
-int rte_eth_led_off(uint16_t port_id);
+int
+rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * Get current status of the Ethernet link flow control for Ethernet device
+ /**
+ * Add UDP tunneling port for a specific type of tunnel.
+ * The packets with this UDP port will be identified as this type of tunnel.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to change or add more UDP port for the tunnel. So the offloading function
+ * can take effect on the packets with the specific UDP port.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure where to store the flow control parameters.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+int
+rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
-/**
- * Configure the Ethernet link flow control for Ethernet device
+ /**
+ * Delete UDP tunneling port a specific type of tunnel.
+ * The packets with this UDP port will not be identified as this type of tunnel
+ * any more.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to delete a UDP port for the tunnel. So the offloading function will not take
+ * effect on the packets with the specific UDP port.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure of the flow control parameters.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+int
+rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
/**
- * Configure the Ethernet priority flow control under DCB environment
- * for Ethernet device.
+ * Check whether the filter type is supported on an Ethernet device.
+ * All the supported filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param pfc_conf
- * The pointer to the structure of the priority flow control parameters.
+ * The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure
+ * - (-ENOTSUP) if hardware doesn't support this filter type.
+ * - (-ENODEV) if *port_id* invalid.
*/
-int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_pfc_conf *pfc_conf);
+int rte_eth_dev_filter_supported(uint16_t port_id,
+ enum rte_filter_type filter_type);
/**
- * Add a MAC address to an internal array of addresses used to enable whitelist
- * filtering to accept packets only if the destination MAC address matches.
+ * Take operations to assigned filter type on an Ethernet device.
+ * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * The MAC address to add.
- * @param pool
- * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
- * not enabled, this should be set to 0.
+ * @param filter_type
+ * Filter type.
+ * @param filter_op
+ * Type of operation.
+ * @param arg
+ * A pointer to arguments defined specifically for the operation.
* @return
- * - (0) if successfully added or *mac_addr" was already added.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port* is invalid.
- * - (-ENOSPC) if no more MAC addresses can be added.
- * - (-EINVAL) if MAC address is invalid.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
- uint32_t pool);
+int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op, void *arg);
/**
- * Remove a MAC address from the internal array of addresses.
+ * Get DCB information on an Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * MAC address to remove.
+ * @param dcb_info
+ * dcb information.
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_dev_get_dcb_info(uint16_t port_id,
+ struct rte_eth_dcb_info *dcb_info);
+
+struct rte_eth_rxtx_callback;
/**
- * Set the default MAC address.
+ * Add a callback to be called on packet RX on a given port and queue.
*
- * @param port
+ * This API configures a function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * New default MAC address.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EINVAL) if MAC address is invalid.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
- struct ether_addr *mac_addr);
+void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+ * Add a callback that must be called first on packet RX on a given port
+ * and queue.
*
- * @param port
+ * This API configures a first function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to update.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_rss_reta_update(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
- /**
- * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+/**
+ * Add a callback to be called on packet TX on a given port and queue.
*
- * @param port
+ * This API configures a function to be called for each burst of
+ * packets sent on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_tx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to query.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_rss_reta_query(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_tx_callback_fn fn, void *user_param);
- /**
- * Updates unicast hash table for receiving packet with the given destination
- * MAC address, and the packet is routed to all VFs for which the RX mode is
- * accept packets that match the unicast hash table.
+/**
+ * Remove an RX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_rx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param addr
- * Unicast MAC address.
- * @param on
- * 1 - Set an unicast hash bit for receiving packets with the MAC address.
- * 0 - Clear an unicast hash bit.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_rx_callback().
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
- uint8_t on);
+int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
- /**
- * Updates all unicast hash bitmaps for receiving packet with any Unicast
- * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
- * mode is accept packets that match the unicast hash table.
+/**
+ * Remove a TX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_tx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param on
- * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
- * MAC addresses
- * 0 - Clear all unicast hash bitmaps
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_tx_callback().
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Set a traffic mirroring rule on an Ethernet device
+ * Retrieve information about given port's RX queue.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param mirror_conf
- * The pointer to the traffic mirroring structure describing the mirroring rule.
- * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
- * destination pool and the value of rule if enable vlan or pool mirroring.
+ * @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.
*
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
- * @param on
- * 1 - Enable a mirroring rule.
- * 0 - Disable a mirroring rule.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if the mr_conf information is not correct.
+ * - 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_mirror_rule_set(uint16_t port_id,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
+int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
/**
- * Reset a traffic mirroring rule on an Ethernet device.
+ * Retrieve information about given port's TX queue.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - 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_mirror_rule_reset(uint16_t port_id,
- uint8_t rule_id);
+int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
/**
- * Set the rate limitation for a queue on an Ethernet device.
+ * Retrieve device registers and register attributes (number of registers and
+ * register size)
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_idx
- * The queue id.
- * @param tx_rate
- * The tx rate in Mbps. Allocated from the total port link speed.
+ * @param info
+ * Pointer to rte_dev_reg_info structure to fill in. If info->data is
+ * NULL the function fills in the width and length fields. If non-NULL
+ * the registers are put into the buffer pointed at by the data field.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
- uint16_t tx_rate);
+int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
- /**
- * Configuration of Receive Side Scaling hash computation of Ethernet device.
+/**
+ * Retrieve size of device EEPROM
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * The new configuration to use for RSS hash computation on the port.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
+ * - (>=0) EEPROM size if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_rss_hash_update(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_dev_get_eeprom_length(uint16_t port_id);
- /**
- * Retrieve current configuration of Receive Side Scaling hash computation
- * of Ethernet device.
+/**
+ * Retrieve EEPROM and EEPROM attribute
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * Where to store the current RSS hash configuration of the Ethernet device.
+ * @param info
+ * The template includes buffer for return EEPROM data and
+ * EEPROM attributes to be filled.
* @return
* - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support RSS.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int
-rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
- /**
- * Add UDP tunneling port for a specific type of tunnel.
- * The packets with this UDP port will be identified as this type of tunnel.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to change or add more UDP port for the tunnel. So the offloading function
- * can take effect on the packets with the specific UDP port.
+/**
+ * Program EEPROM with provided data
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
- *
+ * @param info
+ * The template includes EEPROM data for programming and
+ * EEPROM attributes to be filled
* @return
* - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - others depends on the specific operations implementation.
*/
-int
-rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
- /**
- * Delete UDP tunneling port a specific type of tunnel.
- * The packets with this UDP port will not be identified as this type of tunnel
- * any more.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to delete a UDP port for the tunnel. So the offloading function will not take
- * effect on the packets with the specific UDP port.
+/**
+ * Set the list of multicast addresses to filter on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
- *
+ * @param mc_addr_set
+ * The array of multicast addresses to set. Equal to NULL when the function
+ * is invoked to flush the set of filtered addresses.
+ * @param nb_mc_addr
+ * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
+ * when the function is invoked to flush the set of filtered addresses.
* @return
* - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
+ * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
*/
-int
-rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
/**
- * Check whether the filter type is supported on an Ethernet device.
- * All the supported filter types are defined in 'rte_eth_ctrl.h'.
+ * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param filter_type
- * Filter type.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this filter type.
- * - (-ENODEV) if *port_id* invalid.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_supported(uint16_t port_id,
- enum rte_filter_type filter_type);
+int rte_eth_timesync_enable(uint16_t port_id);
/**
- * Take operations to assigned filter type on an Ethernet device.
- * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
+ * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param filter_type
- * Filter type.
- * @param filter_op
- * Type of operation.
- * @param arg
- * A pointer to arguments defined specifically for the operation.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
- enum rte_filter_op filter_op, void *arg);
+int rte_eth_timesync_disable(uint16_t port_id);
/**
- * Get DCB information on an Ethernet device.
+ * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param dcb_info
- * dcb information.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ * @param flags
+ * Device specific flags. Used to pass the RX timesync register index to
+ * i40e. Unused in igb/ixgbe, pass 0 instead.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_get_dcb_info(uint16_t port_id,
- struct rte_eth_dcb_info *dcb_info);
+int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
+ struct timespec *timestamp, uint32_t flags);
/**
- * Add a callback to be called on packet RX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param timestamp
+ * Pointer to the timestamp struct.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
+ struct timespec *timestamp);
/**
- * Add a callback that must be called first on packet RX on a given port
- * and queue.
- *
- * This API configures a first function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
+ * Adjust the timesync clock on an Ethernet device.
*
- * Multiple functions are called in the order that they are added.
+ * 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 queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param delta
+ * The adjustment in nanoseconds.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
/**
- * Add a callback to be called on packet TX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets sent on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_tx_callback().
+ * Read the time from the timesync clock on an Ethernet device.
*
- * Multiple functions are called in the order that they are added.
+ * 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 queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - 0: Success.
*/
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
- rte_tx_callback_fn fn, void *user_param);
+int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
/**
- * Remove an RX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_rx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
+ * Set the time of the timesync clock on an Ethernet device.
*
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
+ * 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 queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_rx_callback().
+ * @param time
+ * Pointer to the timespec struct that holds the time.
*
* @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
- */
-int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
-
-/**
- * Remove a TX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_tx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_tx_callback().
- *
- * @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
/**
- * Retrieve information about given port's RX queue.
+ * Config l2 tunnel ether type of an Ethernet device for filtering specific
+ * tunnel packets by ether type.
*
* @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.
+ * @param l2_tunnel
+ * l2 tunnel configuration.
*
* @return
- * - 0: Success
- * - -ENOTSUP: routine is not supported by the device PMD.
- * - -EINVAL: The port_id or the queue_id is out of range.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxq_info *qinfo);
+int
+rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel);
/**
- * Retrieve information about given port's TX queue.
+ * Enable/disable l2 tunnel offload functions. Include,
+ * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
+ * Filtering, forwarding and offloading this type of tunnel packets depend on
+ * this ability.
+ * 2, Stripping the l2 tunnel tag.
+ * 3, Insertion of the l2 tunnel tag.
+ * 4, Forwarding the packets based on the l2 tunnel tag.
*
* @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.
+ * @param l2_tunnel
+ * l2 tunnel parameters.
+ * @param mask
+ * Indicate the offload function.
+ * @param en
+ * Enable or disable this function.
*
* @return
- * - 0: Success
- * - -ENOTSUP: routine is not supported by the device PMD.
- * - -EINVAL: The port_id or the queue_id is out of range.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_txq_info *qinfo);
+int
+rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
/**
- * Retrieve device registers and register attributes (number of registers and
- * register size)
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * Pointer to rte_dev_reg_info structure to fill in. If info->data is
- * NULL the function fills in the width and length fields. If non-NULL
- * the registers are put into the buffer pointed at by the data field.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
+* Get the port id from pci address or device name
+* Ex: 0000:2:00.0 or vdev name net_pcap0
+*
+* @param name
+* pci address or name of the device
+* @param port_id
+* pointer to port identifier of the device
+* @return
+* - (0) if successful and port_id is filled.
+* - (-ENODEV or -EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
/**
- * Retrieve size of device EEPROM
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @return
- * - (>=0) EEPROM size if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_eeprom_length(uint16_t port_id);
+* Get the device name from port id
+*
+* @param port_id
+* pointer to port identifier of the device
+* @param name
+* pci address or name of the device
+* @return
+* - (0) if successful.
+* - (-EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
/**
- * Retrieve EEPROM and EEPROM attribute
+ * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
+ * the ethernet device information, otherwise adjust them to boundaries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param info
- * The template includes buffer for return EEPROM data and
- * EEPROM attributes to be filled.
+ * @param nb_rx_desc
+ * A pointer to a uint16_t where the number of receive
+ * descriptors stored.
+ * @param nb_tx_desc
+ * A pointer to a uint16_t where the number of transmit
+ * descriptors stored.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
*/
-int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
+ uint16_t *nb_rx_desc,
+ uint16_t *nb_tx_desc);
/**
- * Program EEPROM with provided data
+ * Test if a port supports specific mempool ops.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes EEPROM data for programming and
- * EEPROM attributes to be filled
+ * Port identifier of the Ethernet device.
+ * @param [in] pool
+ * The name of the pool operations to test.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - others depends on the specific operations implementation.
+ * - 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_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+int
+rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
/**
- * Set the list of multicast addresses to filter on an Ethernet device.
+ * Get the security context for the Ethernet device.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param mc_addr_set
- * The array of multicast addresses to set. Equal to NULL when the function
- * is invoked to flush the set of filtered addresses.
- * @param nb_mc_addr
- * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
- * when the function is invoked to flush the set of filtered addresses.
+ * Port identifier of the Ethernet device
* @return
- * - (0) if successful.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
- * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
+ * - NULL on error.
+ * - pointer to security context on success.
*/
-int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
+void *
+rte_eth_dev_get_sec_ctx(uint8_t port_id);
+
+
+#include <rte_ethdev_core.h>
/**
- * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
*
- * @param port_id
- * The port identifier of the Ethernet device.
+ * Retrieve a burst of input packets from a receive queue of an Ethernet
+ * device. The retrieved packets are stored in *rte_mbuf* structures whose
+ * pointers are supplied in the *rx_pkts* array.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_enable(uint16_t port_id);
-
-/**
- * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * The rte_eth_rx_burst() function loops, parsing the RX ring of the
+ * receive queue, up to *nb_pkts* packets, and for each completed RX
+ * descriptor in the ring, it performs the following operations:
*
- * @param port_id
- * The port identifier of the Ethernet device.
+ * - Initialize the *rte_mbuf* data structure associated with the
+ * RX descriptor according to the information provided by the NIC into
+ * that RX descriptor.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_disable(uint16_t port_id);
-
-/**
- * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
+ * - Store the *rte_mbuf* data structure into the next entry of the
+ * *rx_pkts* array.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
- * @param flags
- * Device specific flags. Used to pass the RX timesync register index to
- * i40e. Unused in igb/ixgbe, pass 0 instead.
+ * - Replenish the RX descriptor with a new *rte_mbuf* buffer
+ * allocated from the memory pool associated with the receive queue at
+ * initialization 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.
- */
-int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
- struct timespec *timestamp, uint32_t flags);
-
-/**
- * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
+ * When retrieving an input packet that was scattered by the controller
+ * into multiple receive descriptors, the rte_eth_rx_burst() function
+ * appends the associated *rte_mbuf* buffers to the first buffer of the
+ * packet.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
+ * The rte_eth_rx_burst() function returns the number of packets
+ * actually retrieved, which is the number of *rte_mbuf* data structures
+ * effectively supplied into the *rx_pkts* array.
+ * A return value equal to *nb_pkts* indicates that the RX queue contained
+ * at least *rx_pkts* packets, and this is likely to signify that other
+ * received packets remain in the input queue. Applications implementing
+ * a "retrieve as much received packets as possible" policy can check this
+ * specific case and keep invoking the rte_eth_rx_burst() function until
+ * a value less than *nb_pkts* is returned.
*
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
- struct timespec *timestamp);
-
-/**
- * Adjust the timesync clock on an Ethernet device.
+ * This receive method has the following advantages:
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * - It allows a run-to-completion network stack engine to retrieve and
+ * to immediately process received packets in a fast burst-oriented
+ * approach, avoiding the overhead of unnecessary intermediate packet
+ * queue/dequeue operations.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param delta
- * The adjustment in nanoseconds.
+ * - Conversely, it also allows an asynchronous-oriented processing
+ * method to retrieve bursts of received packets and to immediately
+ * queue them for further parallel processing by another logical core,
+ * for instance. However, instead of having received packets being
+ * individually queued by the driver, this approach allows the caller
+ * of the rte_eth_rx_burst() function to queue a burst of retrieved
+ * packets at a time and therefore dramatically reduce the cost of
+ * enqueue/dequeue operations per packet.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
-
-/**
- * Read the time from the timesync clock on an Ethernet device.
+ * - It allows the rte_eth_rx_burst() function of the driver to take
+ * advantage of burst-oriented hardware features (CPU cache,
+ * prefetch instructions, and so on) to minimize the number of CPU
+ * cycles per packet.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * To summarize, the proposed receive API enables many
+ * burst-oriented optimizations in both synchronous and asynchronous
+ * packet processing environments with no overhead in both cases.
+ *
+ * The rte_eth_rx_burst() function does not provide any error
+ * notification to avoid the corresponding overhead. As a hint, the
+ * upper-level application might check the status of the device link once
+ * being systematically returned a 0 value for a given number of tries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
- *
+ * @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 rx_pkts
+ * The address of an array of pointers to *rte_mbuf* structures that
+ * must be large enough to store *nb_pkts* pointers in it.
+ * @param nb_pkts
+ * The maximum number of packets to retrieve.
* @return
- * - 0: Success.
+ * The number of packets actually retrieved, which is the number
+ * of pointers to *rte_mbuf* structures effectively supplied to the
+ * *rx_pkts* array.
*/
-int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
+static inline uint16_t
+rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_rx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+ int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
+ rx_pkts, nb_pkts);
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
+ nb_pkts, cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return nb_rx;
+}
/**
- * 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.
+ * Get the number of used descriptors of a rx queue
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
- *
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
* @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * The number of used descriptors in the specific queue, or:
+ * (-EINVAL) if *port_id* or *queue_id* is invalid
+ * (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
+static inline int
+rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
+ dev = &rte_eth_devices[port_id];
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -EINVAL;
+
+ return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
+}
/**
- * Config l2 tunnel ether type of an Ethernet device for filtering specific
- * tunnel packets by ether type.
+ * Check if the DD bit of the specific RX descriptor in the queue has been set
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel configuration.
- *
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
+ * @param offset
+ * The offset of the descriptor ID from tail.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - (1) if the specific DD bit is set.
+ * - (0) if the specific DD bit is not set.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if the device does not support this function
*/
-int
-rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel);
+static inline int
+rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
+ return (*dev->dev_ops->rx_descriptor_done)( \
+ dev->data->rx_queues[queue_id], offset);
+}
+
+#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
+#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
+#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * Enable/disable l2 tunnel offload functions. Include,
- * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
- * Filtering, forwarding and offloading this type of tunnel packets depend on
- * this ability.
- * 2, Stripping the l2 tunnel tag.
- * 3, Insertion of the l2 tunnel tag.
- * 4, Forwarding the packets based on the l2 tunnel tag.
+ * Check the status of a Rx descriptor in the queue
+ *
+ * It should be called in a similar context than the Rx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
+ *
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
+ *
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel parameters.
- * @param mask
- * Indicate the offload function.
- * @param en
- * Enable or disable this function.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Rx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the next
+ * packet to be received by the driver).
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
+ * receive a packet.
+ * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
+ * not yet processed by the driver (i.e. in the receive queue).
+ * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
+ * the driver and not yet returned to hw, or reserved by the hw.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int
-rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
+static inline int
+rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
+ uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *rxq;
-/**
-* Get the port id from pci address or device name
-* Ex: 0000:2:00.0 or vdev name net_pcap0
-*
-* @param name
-* pci address or name of the device
-* @param port_id
-* pointer to port identifier of the device
-* @return
-* - (0) if successful and port_id is filled.
-* - (-ENODEV or -EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
+ rxq = dev->data->rx_queues[queue_id];
+
+ return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
+}
+
+#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
+#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
+#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
-* Get the device name from port id
-*
-* @param port_id
-* pointer to port identifier of the device
-* @param name
-* pci address or name of the device
-* @return
-* - (0) if successful.
-* - (-EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+ * Check the status of a Tx descriptor in the queue.
+ *
+ * It should be called in a similar context than the Tx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
+ *
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
+ *
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
+ *
+ * @param port_id
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Tx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the place where
+ * the next packet will be send).
+ *
+ * @return
+ * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
+ * in the transmit queue.
+ * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
+ * be reused by the driver.
+ * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
+ * driver or the hardware.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
+ */
+static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
+ uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *txq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
+ txq = dev->data->tx_queues[queue_id];
+
+ return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
+}
/**
- * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
- * the ethernet device information, otherwise adjust them to boundaries.
+ * Send a burst of output packets on a transmit queue of an Ethernet device.
+ *
+ * The rte_eth_tx_burst() function is invoked to transmit output packets
+ * on the output queue *queue_id* of the Ethernet device designated by its
+ * *port_id*.
+ * The *nb_pkts* parameter is the number of packets to send which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
+ * up to the number of transmit descriptors available in the TX ring of the
+ * transmit queue.
+ * For each packet to send, the rte_eth_tx_burst() function performs
+ * the following operations:
+ *
+ * - Pick up the next available descriptor in the transmit ring.
+ *
+ * - Free the network buffer previously sent with that descriptor, if any.
+ *
+ * - Initialize the transmit descriptor with the information provided
+ * in the *rte_mbuf data structure.
+ *
+ * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
+ * the rte_eth_tx_burst() function uses several transmit descriptors
+ * of the ring.
+ *
+ * The rte_eth_tx_burst() function returns the number of packets it
+ * actually sent. A return value equal to *nb_pkts* means that all packets
+ * have been sent, and this is likely to signify that other output packets
+ * could be immediately transmitted again. Applications that implement a
+ * "send as many packets to transmit as possible" policy can check this
+ * specific case and keep invoking the rte_eth_tx_burst() function until
+ * a value less than *nb_pkts* is returned.
+ *
+ * It is the responsibility of the rte_eth_tx_burst() function to
+ * transparently free the memory buffers of packets previously sent.
+ * This feature is driven by the *tx_free_thresh* value supplied to the
+ * rte_eth_dev_configure() function at device configuration time.
+ * When the number of free TX descriptors drops below this threshold, the
+ * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
+ * of those packets whose transmission was effectively completed.
+ *
+ * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
+ * invoke this function concurrently on the same tx queue without SW lock.
+ * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param nb_rx_desc
- * A pointer to a uint16_t where the number of receive
- * descriptors stored.
- * @param nb_tx_desc
- * A pointer to a uint16_t where the number of transmit
- * descriptors stored.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to transmit.
* @return
- * - (0) if successful.
- * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
+ * The number of output packets actually stored in transmit descriptors of
+ * the transmit ring. The return value can be less than the value of the
+ * *tx_pkts* parameter when the transmit ring is full or has been filled up.
*/
-int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
- uint16_t *nb_rx_desc,
- uint16_t *nb_tx_desc);
+static inline uint16_t
+rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
+ cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+ return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
+}
/**
- * Test if a port supports specific mempool ops.
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Process a burst of output packets on a transmit queue of an Ethernet device.
+ *
+ * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
+ * transmitted on the output queue *queue_id* of the Ethernet device designated
+ * by its *port_id*.
+ * The *nb_pkts* parameter is the number of packets to be prepared which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * For each packet to send, the rte_eth_tx_prepare() function performs
+ * the following operations:
+ *
+ * - Check if packet meets devices requirements for tx offloads.
+ *
+ * - Check limitations about number of segments.
+ *
+ * - Check additional requirements when debug is enabled.
+ *
+ * - Update and/or reset required checksums when tx offload is set for packet.
+ *
+ * Since this function can modify packet data, provided mbufs must be safely
+ * writable (e.g. modified data cannot be in shared segment).
+ *
+ * The rte_eth_tx_prepare() function returns the number of packets ready to be
+ * sent. A return value equal to *nb_pkts* means that all packets are valid and
+ * ready to be sent, otherwise stops processing on the first invalid packet and
+ * leaves the rest packets untouched.
+ *
+ * When this functionality is not implemented in the driver, all packets are
+ * are returned untouched.
*
* @param port_id
- * Port identifier of the Ethernet device.
- * @param [in] pool
- * The name of the pool operations to test.
+ * The port identifier of the Ethernet device.
+ * The value must be a valid port id.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to process.
* @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.
+ * The number of packets correct and ready to be sent. The return value can be
+ * less than the value of the *tx_pkts* parameter when some packet doesn't
+ * meet devices requirements with rte_errno set appropriately:
+ * - -EINVAL: offload flags are not correctly set
+ * - -ENOTSUP: the offload feature is not supported by the hardware
+ *
+ */
+
+#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
+
+static inline uint16_t
+rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ if (!dev->tx_pkt_prepare)
+ return nb_pkts;
+
+ return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
+ tx_pkts, nb_pkts);
+}
+
+#else
+
+/*
+ * Native NOOP operation for compilation targets which doesn't require any
+ * preparations steps, and functional NOOP may introduce unnecessary performance
+ * drop.
+ *
+ * Generally this is not a good idea to turn it on globally and didn't should
+ * be used if behavior of tx_preparation can change.
*/
-int
-rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
+
+static inline uint16_t
+rte_eth_tx_prepare(__rte_unused uint16_t port_id,
+ __rte_unused uint16_t queue_id,
+ __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ return nb_pkts;
+}
+
+#endif
/**
- * Get the security context for the Ethernet device.
+ * Send any packets queued up for transmission on a port and HW queue
+ *
+ * This causes an explicit flush of packets previously buffered via the
+ * rte_eth_tx_buffer() function. It returns the number of packets successfully
+ * sent to the NIC, and calls the error callback for any unsent packets. Unless
+ * explicitly set up otherwise, the default callback simply frees the unsent
+ * packets back to the owning mempool.
*
* @param port_id
- * Port identifier of the Ethernet device
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer of packets to be transmit.
* @return
- * - NULL on error.
- * - pointer to security context on success.
+ * The number of packets successfully sent to the Ethernet device. The error
+ * callback is called for any packets which could not be sent.
*/
-void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
+static inline uint16_t
+rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer)
+{
+ uint16_t sent;
+ uint16_t to_send = buffer->length;
+
+ if (to_send == 0)
+ return 0;
+
+ sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
+
+ buffer->length = 0;
+
+ /* All packets sent, or to be dealt with by callback below */
+ if (unlikely(sent != to_send))
+ buffer->error_callback(&buffer->pkts[sent], to_send - sent,
+ buffer->error_userdata);
+
+ return sent;
+}
+
+/**
+ * Buffer a single packet for future transmission on a port and queue
+ *
+ * This function takes a single mbuf/packet and buffers it for later
+ * transmission on the particular port and queue specified. Once the buffer is
+ * full of packets, an attempt will be made to transmit all the buffered
+ * packets. In case of error, where not all packets can be transmitted, a
+ * callback is called with the unsent packets as a parameter. If no callback
+ * is explicitly set up, the unsent packets are just freed back to the owning
+ * mempool. The function returns the number of packets actually sent i.e.
+ * 0 if no buffer flush occurred, otherwise the number of packets successfully
+ * flushed
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer used to collect packets to be sent.
+ * @param tx_pkt
+ * Pointer to the packet mbuf to be sent.
+ * @return
+ * 0 = packet has been buffered for later transmission
+ * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
+ * causing N packets to be sent, and the error callback to be called for
+ * the rest.
+ */
+static __rte_always_inline uint16_t
+rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
+{
+ buffer->pkts[buffer->length++] = tx_pkt;
+ if (buffer->length < buffer->size)
+ return 0;
+
+ return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
+}
#ifdef __cplusplus
}
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v4 4/4] ethdev: rename function parameter for consistency
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 3/4] ethdev: reorder inline functions Ferruh Yigit
@ 2018-01-20 16:57 ` Ferruh Yigit
2018-01-21 23:12 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Thomas Monjalon
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 " Ferruh Yigit
4 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-20 16:57 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Update "port" function argument variable to "port_id" in public
header to be consistent in all APIs.
No functional change.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 2c90175c6..6b60262bb 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1159,7 +1159,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* The callback function is called on RX with a burst of packets that have
* been received on the given port and queue.
*
- * @param port
+ * @param port_id
* The Ethernet port on which RX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to receive the packets.
@@ -1175,7 +1175,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* @return
* The number of packets returned to the user.
*/
-typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
void *user_param);
@@ -1185,7 +1185,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* The callback function is called on TX with a burst of packets immediately
* before the packets are put onto the hardware queue for transmission.
*
- * @param port
+ * @param port_id
* The Ethernet port on which TX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to transmit the packets.
@@ -1199,7 +1199,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* @return
* The number of packets to be written to the NIC.
*/
-typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
/**
@@ -2546,7 +2546,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* Add a MAC address to an internal array of addresses used to enable whitelist
* filtering to accept packets only if the destination MAC address matches.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* The MAC address to add.
@@ -2554,19 +2554,19 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
* not enabled, this should be set to 0.
* @return
- * - (0) if successfully added or *mac_addr" was already added.
+ * - (0) if successfully added or *mac_addr* was already added.
* - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port* is invalid.
* - (-ENOSPC) if no more MAC addresses can be added.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr,
uint32_t pool);
/**
* Remove a MAC address from the internal array of addresses.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* MAC address to remove.
@@ -2576,12 +2576,12 @@ int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
* - (-ENODEV) if *port* invalid.
* - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr);
/**
* Set the default MAC address.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* New default MAC address.
@@ -2591,13 +2591,13 @@ int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
+int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
struct ether_addr *mac_addr);
/**
* Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to update.
@@ -2609,14 +2609,14 @@ int rte_eth_dev_default_mac_addr_set(uint16_t port,
* - (-ENOTSUP) if hardware doesn't support.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rss_reta_update(uint16_t port,
+int rte_eth_dev_rss_reta_update(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
/**
* Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to query.
@@ -2628,7 +2628,7 @@ int rte_eth_dev_rss_reta_update(uint16_t port,
* - (-ENOTSUP) if hardware doesn't support.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rss_reta_query(uint16_t port,
+int rte_eth_dev_rss_reta_query(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
@@ -2637,7 +2637,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* MAC address, and the packet is routed to all VFs for which the RX mode is
* accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param addr
* Unicast MAC address.
@@ -2650,7 +2650,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr,
uint8_t on);
/**
@@ -2658,7 +2658,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* Ethernet MAC addresses,the packet is routed to all VFs for which the RX
* mode is accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param on
* 1 - Set all unicast hash bitmaps for receiving all the Ethernet
@@ -2670,7 +2670,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* - (-ENODEV) if *port_id* invalid.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on);
/**
* Set a traffic mirroring rule on an Ethernet device
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
` (2 preceding siblings ...)
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
@ 2018-01-21 23:12 ` Thomas Monjalon
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 " Ferruh Yigit
4 siblings, 0 replies; 76+ messages in thread
From: Thomas Monjalon @ 2018-01-21 23:12 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
20/01/2018 17:57, Ferruh Yigit:
> Create a rte_ethdev_driver.h file and move PMD specific APIs here.
> Drivers updated to include this new header file.
>
> There is no update in header content and since ethdev.h included by
> ethdev_driver.h, nothing changed from driver point of view, only
> logically grouping of APIs. From applications point of view they can't
> access to driver specific APIs anymore and they shouldn't.
>
> More PMD specific data structures still remain in ethdev.h because of
> inline functions in header use them. Those will be handled separately.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
It is really hard to review, especially patches 2 and 3.
But I really like the idea, so
Series Acked-by: Thomas Monjalon <thomas@monjalon.net>
Let's take this change in 18.02-rc1.
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v5 1/4] ethdev: separate driver APIs
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
` (3 preceding siblings ...)
2018-01-21 23:12 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Thomas Monjalon
@ 2018-01-21 23:35 ` Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 2/4] ethdev: separate internal structures into own header Ferruh Yigit
` (3 more replies)
4 siblings, 4 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-21 23:35 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.
There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.
More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: use SPDX header
v3: rebased on next-net
v4: rebased on next-net
v5: rebased on next-net
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/avf/avf_ethdev.c | 2 +-
drivers/net/avf/avf_rxtx.c | 2 +-
drivers/net/avf/avf_rxtx_vec_common.h | 2 +-
drivers/net/avf/avf_rxtx_vec_sse.c | 2 +-
drivers/net/avf/avf_vchnl.c | 2 +-
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
drivers/net/bonding/rte_eth_bond_private.h | 2 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 2 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa/rte_pmd_dpaa.h | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 2 +-
drivers/net/e1000/igb_flow.c | 2 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 2 +-
drivers/net/enic/enic_clsf.c | 2 +-
drivers/net/enic/enic_ethdev.c | 2 +-
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/failsafe/failsafe.c | 2 +-
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 2 +-
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/rte_pmd_i40e.h | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 2 +-
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +-
drivers/net/kni/rte_eth_kni.c | 2 +-
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 2 +-
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/mlx5.c | 2 +-
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_defs.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
| 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mrvl/mrvl_ethdev.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/null/rte_eth_null.c | 2 +-
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 2 +-
drivers/net/qede/qede_ethdev.h | 2 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 2 +-
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 2 +-
drivers/net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 2 +-
drivers/net/tap/rte_eth_tap.c | 2 +-
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.c | 1 +
lib/librte_ether/rte_ethdev.h | 174 +--------------------
lib/librte_ether/rte_ethdev_driver.h | 193 ++++++++++++++++++++++++
lib/librte_ether/rte_ethdev_pci.h | 2 +-
lib/librte_ether/rte_ethdev_vdev.h | 2 +-
157 files changed, 352 insertions(+), 323 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_driver.h
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 4c2854f09..ba33566c7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_bus.h>
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index da3749044..15bf73a40 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -11,7 +11,7 @@
#include <stdbool.h>
#include <net/if.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <compat.h>
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 8fe08f64e..e9acd3588 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -14,7 +14,7 @@
#include <rte_malloc.h>
#include <rte_devargs.h>
#include <rte_memcpy.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <fslmc_vfio.h>
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 9f28fa0bf..1241295be 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -22,7 +22,7 @@
#include <eal_filesystem.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index ffad0f536..139249c07 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -19,7 +19,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
index f0edaf414..fb28e4970 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 537141d07..eefde1552 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -24,7 +24,7 @@
#include<sys/eventfd.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 1d3e3612e..84ecd1b86 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -26,7 +26,7 @@
#include <rte_memory.h>
#include <rte_pci.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fslmc_vfio.h>
diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
index c949b2db2..f2377b983 100644
--- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
+++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index 748ae5fa5..edac6d4f6 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -8,7 +8,7 @@
#include <rte_debug.h>
#include <rte_dev.h>
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <rte_kvargs.h>
#include <rte_lcore.h>
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 51770d412..afda2c290 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -14,7 +14,7 @@
#include <errno.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index d51540898..ac58ad6b2 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -37,7 +37,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index 3a54a4c91..146787112 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -38,7 +38,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
int eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
diff --git a/drivers/net/ark/ark_ethdev_tx.h b/drivers/net/ark/ark_ethdev_tx.h
index 8aaafc22e..657f895a4 100644
--- a/drivers/net/ark/ark_ethdev_tx.h
+++ b/drivers/net/ark/ark_ethdev_tx.h
@@ -36,7 +36,7 @@
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
uint16_t eth_ark_xmit_pkts_noop(void *vtxq,
diff --git a/drivers/net/ark/ark_ext.h b/drivers/net/ark/ark_ext.h
index d26c8198b..031cfddc3 100644
--- a/drivers/net/ark/ark_ext.h
+++ b/drivers/net/ark/ark_ext.h
@@ -34,7 +34,7 @@
#ifndef _ARK_EXT_H_
#define _ARK_EXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* This is the template file for users who which to define a dynamic
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index aef2cf73b..41eb260e6 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -38,7 +38,7 @@
#include <assert.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 202a1d9be..2cadaab80 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -36,7 +36,7 @@
#include <locale.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktchkr.h"
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index 018f37b69..d3c3dee1e 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -38,7 +38,7 @@
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktgen.h"
diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index b36d31705..cf7bbb2e7 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -19,7 +19,7 @@
#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/avf/avf_rxtx.c b/drivers/net/avf/avf_rxtx.c
index e0c45839e..d276d9752 100644
--- a/drivers/net/avf/avf_rxtx.c
+++ b/drivers/net/avf/avf_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/avf/avf_rxtx_vec_common.h b/drivers/net/avf/avf_rxtx_vec_common.h
index 56a23a732..8057b9682 100644
--- a/drivers/net/avf/avf_rxtx_vec_common.h
+++ b/drivers/net/avf/avf_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _AVF_RXTX_VEC_COMMON_H_
#define _AVF_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "avf.h"
diff --git a/drivers/net/avf/avf_rxtx_vec_sse.c b/drivers/net/avf/avf_rxtx_vec_sse.c
index 8f389f311..8275100f3 100644
--- a/drivers/net/avf/avf_rxtx_vec_sse.c
+++ b/drivers/net/avf/avf_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/avf_prototype.h"
diff --git a/drivers/net/avf/avf_vchnl.c b/drivers/net/avf/avf_vchnl.c
index cc347e6ea..fa71014e1 100644
--- a/drivers/net/avf/avf_vchnl.c
+++ b/drivers/net/avf/avf_vchnl.c
@@ -16,7 +16,7 @@
#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_dev.h>
#include "avf_log.h"
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index deb6f355d..e4ad7b00a 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -36,7 +36,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h
index 967d6dc50..37cac1589 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.h
+++ b/drivers/net/bnx2x/bnx2x_ethdev.h
@@ -33,7 +33,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_eal.h>
#include <rte_mempool.h>
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 7e3d7aefd..cf0b1d27c 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -40,7 +40,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
#include <rte_lcore.h>
#include <rte_spinlock.h>
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 89b63978f..057786a62 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
diff --git a/drivers/net/bnxt/bnxt_stats.h b/drivers/net/bnxt/bnxt_stats.h
index 51d16f5d3..c1c83d57b 100644
--- a/drivers/net/bnxt/bnxt_stats.h
+++ b/drivers/net/bnxt/bnxt_stats.h
@@ -34,7 +34,7 @@
#ifndef _BNXT_STATS_H_
#define _BNXT_STATS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
void bnxt_free_stats(struct bnxt *bp);
int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index e86e670dc..595208997 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -36,7 +36,7 @@
#include <unistd.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h
index f881d30d6..cd7227ac2 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.h
+++ b/drivers/net/bnxt/rte_pmd_bnxt.h
@@ -34,7 +34,7 @@
#ifndef _PMD_BNXT_H_
#define _PMD_BNXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* Response sent back to the caller after callback
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 534a890bf..03b73be03 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 10c1920ae..158f3aa1d 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_tcp.h>
#include <rte_udp.h>
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index e2b717f72..92e15f8cc 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -5,7 +5,7 @@
#ifndef _RTE_ETH_BOND_PRIVATE_H_
#define _RTE_ETH_BOND_PRIVATE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_bitmap.h>
diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 282e2e625..56f38c838 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -44,7 +44,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index dc153c731..5cd260f48 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 5b828c237..28db6c061 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -55,7 +55,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index fc10d9585..3d5aa596f 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 88524a2f0..bf5eb96ed 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -28,7 +28,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 3c9162bf6..92aec253c 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -9,7 +9,7 @@
/* System headers */
#include <stdbool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fsl_usd.h>
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 1976fe5fc..ab2335270 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_ip.h>
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index 9614be84e..2b03d52d4 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -15,7 +15,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @warning
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index f7a8d9f26..b93376de4 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 9a3a4182b..37def4372 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 2f750ad20..3d4566988 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 8bedaf77d..f8ffd6ae9 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index a010b3ab8..02fae100c 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index b02a0e6b4..3a09ffb34 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index b560f16a2..d98bdc844 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 3258f3b5b..b9f2e5391 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -16,7 +16,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index a2abc759f..2f3716724 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 5419e61f3..83e0ae2c9 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -32,7 +32,7 @@
*/
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_tcp.h>
#include <rte_atomic.h>
diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index d52e5e475..3ef1d0832 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -5,7 +5,7 @@
#include <libgen.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_hash.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index d3e98a33f..7d10b70a3 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -9,7 +9,7 @@
#include <rte_dev.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index 9a2bb8ebd..28923b0e2 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -4,7 +4,7 @@
#include <errno.h>
#include <rte_log.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow_driver.h>
#include <rte_ether.h>
#include <rte_ip.h>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 669085156..7e64706d5 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -16,7 +16,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "enic_compat.h"
#include "enic.h"
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index c8ded867d..c99d61837 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -4,7 +4,7 @@
*/
#include "enic_compat.h"
-#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "wq_enet_desc.h"
#include "rq_enet_desc.h"
#include "cq_enet_desc.h"
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index e2002e136..98902caa0 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -4,7 +4,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include "enic_compat.h"
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index b76735261..cb274eb76 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -33,7 +33,7 @@
#include <rte_alarm.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_devargs.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 42aaf9107..946ac98f9 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -36,7 +36,7 @@
#include <rte_debug.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_flow.h>
#include <rte_cycles.h>
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 491636537..7754248ff 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -38,7 +38,7 @@
#include <rte_atomic.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_devargs.h>
#define FAILSAFE_DRIVER_NAME "Fail-safe PMD"
diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c
index 0ebf06a6f..165449411 100644
--- a/drivers/net/failsafe/failsafe_rxtx.c
+++ b/drivers/net/failsafe/failsafe_rxtx.c
@@ -34,7 +34,7 @@
#include <rte_atomic.h>
#include <rte_debug.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "failsafe_private.h"
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index cf8cc6a6e..340f6040f 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2013-2016 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 65956db08..9320748c4 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_net.h>
#include "fm10k.h"
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index 630ca49b9..498a17815 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "fm10k.h"
#include "base/fm10k_type.h"
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 0b102c0de..f6d3984be 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 8e61fa84f..b15e2ead8 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_dev.h>
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index f43cf4aa4..a4320b1b5 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index cd9a9b64b..a74fa08ab 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_eth_ctrl.h>
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index e19917715..dd3962d38 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -14,7 +14,7 @@
#include <rte_string_fns.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index f16944e40..1217e5a61 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index 5e4e472a3..f3fc82672 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index ea6e7715c..dbcb61f38 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -32,7 +32,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index e3faaefd9..3ffedcb9e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _I40E_RXTX_VEC_COMMON_H_
#define _I40E_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "i40e_ethdev.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index b5685e2b9..e549d1e8c 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 1df306122..3b22588c5 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index cfdcae7e5..d248adb1a 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -14,7 +14,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Response sent back to i40e driver from user app after callback
diff --git a/drivers/net/ixgbe/ixgbe_bypass.c b/drivers/net/ixgbe/ixgbe_bypass.c
index 62a550653..ae38ce355 100644
--- a/drivers/net/ixgbe/ixgbe_bypass.c
+++ b/drivers/net/ixgbe/ixgbe_bypass.c
@@ -4,7 +4,7 @@
#include <time.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_bypass_api.h"
#include "rte_pmd_ixgbe.h"
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 2d520446c..45d6e3120 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 236ab8c95..d5e51797c 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -13,7 +13,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_logs.h"
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 0e486c38a..dcbfb38b3 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index 6619c5658..01164734b 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ip.h>
#include <rte_jhash.h>
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index f81dc314d..ea9973711 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 4b382477e..eeff91b0d 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -62,7 +62,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
index df580f39b..414840a2b 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _IXGBE_RXTX_VEC_COMMON_H_
#define _IXGBE_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_rxtx.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index b2a2774da..e0f9998f0 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 0131b06d2..c9ba48246 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index 001a8647e..d8ca8ca31 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "base/ixgbe_api.h"
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 463a78e50..11a9f334b 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -11,7 +11,7 @@
#ifndef _PMD_IXGBE_H_
#define _PMD_IXGBE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Notify VF when PF link status changes.
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index a1df4c6a9..dc4e65f5d 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -6,7 +6,7 @@
#include <pthread.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kni.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 2a5d4f12f..ddbc8c0e0 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -4,7 +4,7 @@
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/base/lio_mbox.c b/drivers/net/liquidio/base/lio_mbox.c
index 3c6379341..112900151 100644
--- a/drivers/net/liquidio/base/lio_mbox.c
+++ b/drivers/net/liquidio/base/lio_mbox.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include "lio_logs.h"
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 9adbcc12c..13e276bf7 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 5d447706a..8d705bfe7 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 703513e79..2a721e7e2 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -57,7 +57,7 @@
#include <rte_common.h>
#include <rte_dev.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 2ab298894..30a544f9a 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_interrupts.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 5318b5637..ca5fadc72 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -63,7 +63,7 @@
#include <rte_bus_pci.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_pci.h>
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 96a6a6fa7..fb84060db 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -57,7 +57,7 @@
#include <rte_byteorder.h>
#include <rte_errno.h>
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index b10c4f552..cd46f860d 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -47,7 +47,7 @@
#endif
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c
index 9becee4a8..2ff72188a 100644
--- a/drivers/net/mlx4/mlx4_intr.c
+++ b/drivers/net/mlx4/mlx4_intr.c
@@ -52,7 +52,7 @@
#include <rte_alarm.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_io.h>
#include <rte_interrupts.h>
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index 98ab1d266..163598765 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -55,7 +55,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h
index 900cab372..6a9fd28a5 100644
--- a/drivers/net/mlx4/mlx4_rxtx.h
+++ b/drivers/net/mlx4/mlx4_rxtx.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c
index 7664c3e1a..2bd4b9cb6 100644
--- a/drivers/net/mlx4/mlx4_txq.c
+++ b/drivers/net/mlx4/mlx4_txq.c
@@ -54,7 +54,7 @@
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index abf026173..9d1de366b 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -51,7 +51,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 259448001..eb0894fa5 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -53,7 +53,7 @@
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_interrupts.h>
#include <rte_errno.h>
diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 64bb0712e..a71db281d 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -34,7 +34,7 @@
#ifndef RTE_PMD_MLX5_DEFS_H_
#define RTE_PMD_MLX5_DEFS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5_autoconf.h"
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 9226f1a5b..6624888c9 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -55,7 +55,7 @@
#include <sys/un.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_bus_pci.h>
#include <rte_mbuf.h>
#include <rte_common.h>
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 4396ea852..13b6483ba 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -44,7 +44,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 9fb5ba5e7..a5e78ec8d 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -52,7 +52,7 @@
#endif
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5.h"
--git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index f47bda667..9e12b51fe 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -48,7 +48,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_defs.h"
diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c
index 6fb245ba1..897695855 100644
--- a/drivers/net/mlx5/mlx5_rxmode.c
+++ b/drivers/net/mlx5/mlx5_rxmode.c
@@ -45,7 +45,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_rxtx.h"
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 950472754..8e4fbbf2a 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -52,7 +52,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_debug.h>
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 4cb6136fc..36234b870 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -34,7 +34,7 @@
#include <linux/sockios.h>
#include <linux/ethtool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 6f5c799b5..61fa2604f 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_interrupts.h>
#include <rte_alarm.h>
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 26db15a4f..49018303e 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -51,7 +51,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 9443e4f03..d51dbe941 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -36,7 +36,7 @@
#include <assert.h>
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 16a964b1f..c327ff27e 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -32,7 +32,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_log.h>
#include <rte_malloc.h>
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 5b886528b..a2c883f0b 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -43,7 +43,7 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_debug.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ether.h>
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 726a5c5e4..7cd5c7163 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -32,7 +32,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h
index 637b92cf4..10e42e142 100644
--- a/drivers/net/octeontx/octeontx_ethdev.h
+++ b/drivers/net/octeontx/octeontx_ethdev.h
@@ -8,7 +8,7 @@
#include <stdbool.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eventdev.h>
#include <rte_mempool.h>
#include <rte_memory.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c
index 2445fae48..2502d90e9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.c
+++ b/drivers/net/octeontx/octeontx_rxtx.c
@@ -9,7 +9,7 @@
#include <rte_atomic.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index e8eed169a..fe3e5ccd9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -5,7 +5,7 @@
#ifndef __OCTEONTX_RXTX_H__
#define __OCTEONTX_RXTX_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#ifndef __hot
#define __hot __attribute__((hot))
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index debb0cec2..c1571e1fe 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -11,7 +11,7 @@
#include <pcap.h>
#include <rte_cycles.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 7cddbe66b..cb9597390 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -13,7 +13,7 @@
#include <sys/queue.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ip.h>
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 48091f459..df13c44be 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -4,7 +4,7 @@
#include "rte_eth_ring.h"
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 3a4f66d60..75575349b 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -14,7 +14,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_spinlock.h>
#include <rte_atomic.h>
diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index 8bfb549e3..be725dcbd 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -11,7 +11,7 @@
#define _SFC_DP_RX_H
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h
index 75d72feb4..0c1aad908 100644
--- a/drivers/net/sfc/sfc_dp_tx.h
+++ b/drivers/net/sfc/sfc_dp_tx.h
@@ -10,7 +10,7 @@
#ifndef _SFC_DP_TX_H
#define _SFC_DP_TX_H
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index a86cff6b1..89a452907 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -8,7 +8,7 @@
*/
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index da2b5c6ef..872f79b91 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -10,7 +10,7 @@
#ifndef _SFC_EV_H_
#define _SFC_EV_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 11ab892ee..93cdf8f4c 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -9,7 +9,7 @@
#include <rte_tailq.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eth_ctrl.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 8c0fa7125..6706ee6fc 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -12,7 +12,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_tx.h b/drivers/net/sfc/sfc_tx.h
index e3c5d517a..c2e5f13e9 100644
--- a/drivers/net/sfc/sfc_tx.h
+++ b/drivers/net/sfc/sfc_tx.h
@@ -11,7 +11,7 @@
#define _SFC_TX_H
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 5c5464c8d..b0c134152 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index 3a1282347..050e3e7e1 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -9,7 +9,7 @@
#include <rte_mbuf.h>
#include <rte_sched.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tm_driver.h>
#include "rte_eth_softnic.h"
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 958c5ccb3..d98dc544c 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -44,7 +44,7 @@
#include <libsze2.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 2eb873406..fd425726a 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -7,7 +7,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index 73c201b93..d4f1e6c55 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -41,7 +41,7 @@
#include <linux/if_tun.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#ifdef IFF_MULTI_QUEUE
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 0076c5ae3..256cd56ca 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -23,7 +23,7 @@
#include <rte_dev.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_interrupts.h>
#include <rte_log.h>
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index da30a9f3c..ea8dccd19 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -5,7 +5,7 @@
#ifndef __THUNDERX_NICVF_ETHDEV_H__
#define __THUNDERX_NICVF_ETHDEV_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define THUNDERX_NICVF_PMD_VERSION "2.0"
#define THUNDERX_REG_BYTES 8
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index aa278afee..72305d9d2 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -13,7 +13,7 @@
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h
index ae6355361..8bdd582ed 100644
--- a/drivers/net/thunderx/nicvf_rxtx.h
+++ b/drivers/net/thunderx/nicvf_rxtx.h
@@ -6,7 +6,7 @@
#define __THUNDERX_NICVF_RXTX_H__
#include <rte_byteorder.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define NICVF_TX_OFFLOAD_MASK (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 6d0a6b245..d4a83c372 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -11,7 +11,7 @@
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
struct nicvf_rbdr {
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 014428580..4e541e3d8 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index dcbbfa90c..bed8998b3 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -8,7 +8,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 9d810a599..a28ba8339 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -9,7 +9,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
struct virtqueue;
struct virtnet_ctl;
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 80e996d06..854af399e 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index 98a9da5d8..7247a0822 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c
index b73867ac7..d6207d7bb 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_neon.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c
@@ -12,7 +12,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c
index 6378b12af..d768d0757 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_sse.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c
@@ -14,7 +14,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index fc495388e..1414f69a4 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
#include <rte_malloc.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index abea641ef..3a8c62fc1 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -32,7 +32,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index ea8cf941a..48d84f445 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -27,6 +27,7 @@ SRCS-y += ethdev_profile.c
# Export include files
#
SYMLINK-y-include += rte_ethdev.h
+SYMLINK-y-include += rte_ethdev_driver.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 39e42b621..344397101 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -38,6 +38,7 @@
#include "rte_ether.h"
#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "ethdev_profile.h"
static const char *MZ_RTE_ETH_DEV_DATA = "rte_eth_dev_data";
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index d34b9a4be..07019ab7a 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -17,10 +17,10 @@
* to get its MAC address, the speed and the status of its physical link,
* to receive and to transmit packets, and so on.
*
- * - The driver-oriented Ethernet API that exports a function allowing
- * an Ethernet Poll Mode Driver (PMD) to simultaneously register itself as
- * an Ethernet device driver and as a PCI driver for a set of matching PCI
- * [Ethernet] devices classes.
+ * - The driver-oriented Ethernet API that exports functions allowing
+ * an Ethernet Poll Mode Driver (PMD) to allocate an Ethernet device instance,
+ * create memzone for HW rings and process registered callbacks, and so on.
+ * PMDs should include rte_ethdev_driver.h instead of this header.
*
* By default, all the functions of the Ethernet Device API exported by a PMD
* are lock-free functions which assume to not be invoked in parallel on
@@ -1846,53 +1846,6 @@ uint16_t rte_eth_find_next(uint16_t port_id);
*/
uint16_t rte_eth_dev_count(void);
-/**
- * @internal
- * Returns a ethdev slot specified by the unique identifier name.
- *
- * @param name
- * The pointer to the Unique identifier name for each Ethernet device
- * @return
- * - The pointer to the ethdev slot, on success. NULL on error
- */
-struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
-
-/**
- * @internal
- * Allocates a new ethdev slot for an ethernet device and returns the pointer
- * to that slot for the driver to use.
- *
- * @param name Unique identifier name for each Ethernet device
- * @param type Device type of this Ethernet device
- * @return
- * - Slot in the rte_dev_devices array for a new device;
- */
-struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
-
-/**
- * @internal
- * Attach to the ethdev already initialized by the primary
- * process.
- *
- * @param name Ethernet device's name.
- * @return
- * - Success: Slot in the rte_dev_devices array for attached
- * device.
- * - Error: Null pointer.
- */
-struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
-
-/**
- * @internal
- * Release the specified ethdev port.
- *
- * @param eth_dev
- * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
- * @return
- * - 0 on success, negative on error
- */
-int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
-
/**
* Attach a new Ethernet device specified by arguments.
*
@@ -1996,19 +1949,6 @@ const char *rte_eth_dev_tx_offload_name(uint64_t offload);
int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
-/**
- * @internal
- * Release device queues and clear its configuration to force the user
- * application to reconfigure it. It is for internal use only.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- *
- * @return
- * void
- */
-void _rte_eth_dev_reset(struct rte_eth_dev *dev);
-
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
@@ -2279,68 +2219,6 @@ int rte_eth_dev_set_link_down(uint16_t port_id);
*/
void rte_eth_dev_close(uint16_t port_id);
-
-/**
- * @internal
- * Atomically set the link status for the specific device.
- * It is for use by DPDK device driver use only.
- * User applications should not call it
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- * @param link
- * New link status value.
- * @return
- * 1 if link status has changed;
- * 0 if link status is unchanged.
- */
-static inline int
-rte_eth_linkstatus_set(struct rte_eth_dev *dev,
- const struct rte_eth_link *new_link)
-{
- volatile uint64_t *dev_link
- = (volatile uint64_t *)&(dev->data->dev_link);
- union {
- uint64_t val64;
- struct rte_eth_link link;
- } orig;
-
- RTE_BUILD_BUG_ON(sizeof(*new_link) != sizeof(uint64_t));
-
- orig.val64 = rte_atomic64_exchange(dev_link,
- *(const uint64_t *)new_link);
-
- return orig.link.link_status != new_link->link_status;
-}
-
-/**
- * @internal
- * Atomically get the link speed and status.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- * @param link
- * link status value.
- */
-static inline void
-rte_eth_linkstatus_get(const struct rte_eth_dev *dev,
- struct rte_eth_link *link)
-{
- volatile uint64_t *src = (uint64_t *)&(dev->data->dev_link);
- uint64_t *dst = (uint64_t *)link;
-
- RTE_BUILD_BUG_ON(sizeof(*link) != sizeof(uint64_t));
-
- /* can't use rte_atomic64_read because it returns signed int */
-#ifdef __LP64__
- *dst = *src;
-#else
- do {
- *dst = *src;
- } while (!rte_atomic64_cmpset(src, *dst, *dst));
-#endif
-}
-
/**
* Reset a Ethernet device and keep its port id.
*
@@ -3681,26 +3559,6 @@ int rte_eth_dev_callback_unregister(uint16_t port_id,
enum rte_eth_event_type event,
rte_eth_dev_cb_fn cb_fn, void *cb_arg);
-/**
- * @internal Executes all the user application registered callbacks for
- * the specific device. It is for DPDK internal user only. User
- * application should not call it directly.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- * @param event
- * Eth device interrupt event type.
- * @param ret_param
- * To pass data back to user application.
- * This allows the user application to decide if a particular function
- * is permitted or not.
- *
- * @return
- * int
- */
-int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
- enum rte_eth_event_type event, void *ret_param);
-
/**
* 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
@@ -4602,30 +4460,6 @@ int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
*/
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
-/**
- * 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);
-
/**
* Config l2 tunnel ether type of an Ethernet device for filtering specific
* tunnel packets by ether type.
diff --git a/lib/librte_ether/rte_ethdev_driver.h b/lib/librte_ether/rte_ethdev_driver.h
new file mode 100644
index 000000000..f001f82b5
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_driver.h
@@ -0,0 +1,193 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
+ */
+
+#ifndef _RTE_ETHDEV_DRIVER_H_
+#define _RTE_ETHDEV_DRIVER_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device PMD API
+ *
+ * These APIs for the use from Ethernet drivers, user applications shouldn't
+ * use them.
+ *
+ */
+
+#include <rte_ethdev.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @internal
+ * Returns a ethdev slot specified by the unique identifier name.
+ *
+ * @param name
+ * The pointer to the Unique identifier name for each Ethernet device
+ * @return
+ * - The pointer to the ethdev slot, on success. NULL on error
+ */
+struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+
+/**
+ * @internal
+ * Allocates a new ethdev slot for an ethernet device and returns the pointer
+ * to that slot for the driver to use.
+ *
+ * @param name Unique identifier name for each Ethernet device
+ * @param type Device type of this Ethernet device
+ * @return
+ * - Slot in the rte_dev_devices array for a new device;
+ */
+struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
+
+/**
+ * @internal
+ * Attach to the ethdev already initialized by the primary
+ * process.
+ *
+ * @param name Ethernet device's name.
+ * @return
+ * - Success: Slot in the rte_dev_devices array for attached
+ * device.
+ * - Error: Null pointer.
+ */
+struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
+
+/**
+ * @internal
+ * Release the specified ethdev port.
+ *
+ * @param eth_dev
+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
+ * @return
+ * - 0 on success, negative on error
+ */
+int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
+
+/**
+ * @internal
+ * Release device queues and clear its configuration to force the user
+ * application to reconfigure it. It is for internal use only.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ *
+ * @return
+ * void
+ */
+void _rte_eth_dev_reset(struct rte_eth_dev *dev);
+
+/**
+ * @internal
+ * Atomically set the link status for the specific device.
+ * It is for use by DPDK device driver use only.
+ * User applications should not call it
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ * @param link
+ * New link status value.
+ * @return
+ * 1 if link status has changed;
+ * 0 if link status is unchanged.
+ */
+static inline int
+rte_eth_linkstatus_set(struct rte_eth_dev *dev,
+ const struct rte_eth_link *new_link)
+{
+ volatile uint64_t *dev_link
+ = (volatile uint64_t *)&(dev->data->dev_link);
+ union {
+ uint64_t val64;
+ struct rte_eth_link link;
+ } orig;
+
+ RTE_BUILD_BUG_ON(sizeof(*new_link) != sizeof(uint64_t));
+
+ orig.val64 = rte_atomic64_exchange(dev_link,
+ *(const uint64_t *)new_link);
+
+ return orig.link.link_status != new_link->link_status;
+}
+
+/**
+ * @internal
+ * Atomically get the link speed and status.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ * @param link
+ * link status value.
+ */
+static inline void
+rte_eth_linkstatus_get(const struct rte_eth_dev *dev,
+ struct rte_eth_link *link)
+{
+ volatile uint64_t *src = (uint64_t *)&(dev->data->dev_link);
+ uint64_t *dst = (uint64_t *)link;
+
+ RTE_BUILD_BUG_ON(sizeof(*link) != sizeof(uint64_t));
+
+ /* can't use rte_atomic64_read because it returns signed int */
+#ifdef __LP64__
+ *dst = *src;
+#else
+ do {
+ *dst = *src;
+ } while (!rte_atomic64_cmpset(src, *dst, *dst));
+#endif
+}
+
+/**
+ * @internal Executes all the user application registered callbacks for
+ * the specific device. It is for DPDK internal user only. User
+ * application should not call it directly.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ * @param event
+ * Eth device interrupt event type.
+ * @param ret_param
+ * To pass data back to user application.
+ * This allows the user application to decide if a particular function
+ * is permitted or not.
+ *
+ * @return
+ * int
+ */
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+ enum rte_eth_event_type event, void *ret_param);
+
+/**
+ * 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
+
+#endif /* _RTE_ETHDEV_DRIVER_H_ */
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index ad64a169c..897ce5b41 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -38,7 +38,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_config.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Copy pci device info to the Ethernet device data.
diff --git a/lib/librte_ether/rte_ethdev_vdev.h b/lib/librte_ether/rte_ethdev_vdev.h
index feb5a3eb0..259feda3f 100644
--- a/lib/librte_ether/rte_ethdev_vdev.h
+++ b/lib/librte_ether/rte_ethdev_vdev.h
@@ -37,7 +37,7 @@
#include <rte_config.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @internal
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v5 2/4] ethdev: separate internal structures into own header
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 " Ferruh Yigit
@ 2018-01-21 23:35 ` Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 3/4] ethdev: reorder inline functions Ferruh Yigit
` (2 subsequent siblings)
3 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-21 23:35 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
rte_ethdev_core.h created. Internal data structures are moved here.
These structures are mostly intended to be used by drivers, but they
need to be in the public header file because of the inline functions
in the ethdev.h header, and those inline functions are preferred to
kept because of the performance concerns.
The accessibility of the data structures are not changed, only logically
grouped to show that they are not intended to be used by applications.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.h | 584 +----------------------------------
lib/librte_ether/rte_ethdev_core.h | 607 +++++++++++++++++++++++++++++++++++++
3 files changed, 609 insertions(+), 583 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_core.h
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 48d84f445..34d014e71 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -28,6 +28,7 @@ SRCS-y += ethdev_profile.c
#
SYMLINK-y-include += rte_ethdev.h
SYMLINK-y-include += rte_ethdev_driver.h
+SYMLINK-y-include += rte_ethdev_core.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 07019ab7a..1e40d62c4 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1153,483 +1153,6 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
/**< l2 tunnel forwarding mask */
#define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
-/*
- * Definitions of all functions exported by an Ethernet driver through the
- * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
- * structure associated with an Ethernet device.
- */
-
-typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
-/**< @internal Ethernet device configuration. */
-
-typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to start a configured Ethernet device. */
-
-typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to stop a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link up a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link down a configured Ethernet device. */
-
-typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to close a configured Ethernet device. */
-
-typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
-/** <@internal Function used to reset a configured Ethernet device. */
-
-typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to detect an Ethernet device removal. */
-
-typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
-
-typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
-
-typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
- int wait_to_complete);
-/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
-
-typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_stats *igb_stats);
-/**< @internal Get global I/O statistics of an Ethernet device. */
-
-typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
-
-typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat *stats, unsigned n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
- const uint64_t *ids,
- uint64_t *values,
- unsigned int n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, unsigned size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
- unsigned int size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
- uint16_t queue_id,
- uint8_t stat_idx,
- uint8_t is_rx);
-/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
-
-typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_dev_info *dev_info);
-/**< @internal Get specific informations of an Ethernet device. */
-
-typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
-/**< @internal Get supported ptypes of an Ethernet device. */
-
-typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Start rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Stop rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- uint16_t nb_rx_desc,
- unsigned int socket_id,
- const struct rte_eth_rxconf *rx_conf,
- struct rte_mempool *mb_pool);
-/**< @internal Set up a receive queue of an Ethernet device. */
-
-typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t tx_queue_id,
- uint16_t nb_tx_desc,
- unsigned int socket_id,
- 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. */
-
-typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id);
-/**< @internal Get number of used descriptors on a receive queue. */
-
-typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
-/**< @internal Check DD bit of specific RX descriptor */
-
-typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
-/**< @internal Check the status of a Rx descriptor */
-
-typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
-/**< @internal Check the status of a Tx descriptor */
-
-typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
- char *fw_version, size_t fw_size);
-/**< @internal Get firmware information of an Ethernet device. */
-
-typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
-/**< @internal Force mbufs to be from TX ring. */
-
-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. */
-
-typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
-
-typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
- enum rte_vlan_type type, uint16_t tpid);
-/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
-
-typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
-/**< @internal set VLAN offload function by an Ethernet device. */
-
-typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal set port based TX VLAN insertion by an Ethernet device. */
-
-typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- int on);
-/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
-
-typedef uint16_t (*eth_rx_burst_t)(void *rxq,
- struct rte_mbuf **rx_pkts,
- uint16_t nb_pkts);
-/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_burst_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Send output packets on a transmit queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_prep_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Prepare output packets on a transmit queue of 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 */
-
-typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_fc_conf *fc_conf);
-/**< @internal Setup flow control parameter on an Ethernet device */
-
-typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_pfc_conf *pfc_conf);
-/**< @internal Setup priority flow control parameter on an Ethernet device */
-
-typedef int (*reta_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Update RSS redirection table on an Ethernet device */
-
-typedef int (*reta_query_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Query RSS redirection table on an Ethernet device */
-
-typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Update RSS hash configuration of an Ethernet device */
-
-typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Get current RSS hash configuration of an Ethernet device */
-
-typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
-/**< @internal Turn on SW controllable LED on an Ethernet device */
-
-typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
-/**< @internal Turn off SW controllable LED on an Ethernet device */
-
-typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
-/**< @internal Remove MAC address from receive address register */
-
-typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint32_t index,
- uint32_t vmdq);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint8_t on);
-/**< @internal Set a Unicast Hash bitmap */
-
-typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
- uint8_t on);
-/**< @internal Set all Unicast Hash bitmap */
-
-typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
- uint16_t queue_idx,
- uint16_t tx_rate);
-/**< @internal Set queue TX rate */
-
-typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
-/**< @internal Add a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
- uint8_t rule_id);
-/**< @internal Remove a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Add tunneling UDP port */
-
-typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Delete tunneling UDP port */
-
-typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-/**< @internal set the list of multicast addresses on an Ethernet device */
-
-typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
- struct timespec *timestamp,
- uint32_t flags);
-/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
-
-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_t)(struct rte_eth_dev *dev,
- struct rte_dev_reg_info *info);
-/**< @internal Retrieve registers */
-
-typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
-/**< @internal Retrieve eeprom size */
-
-typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Retrieve eeprom data */
-
-typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Program eeprom data */
-
-typedef int (*eth_l2_tunnel_eth_type_conf_t)
- (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
-/**< @internal config l2 tunnel ether type */
-
-typedef int (*eth_l2_tunnel_offload_set_t)
- (struct rte_eth_dev *dev,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**< @internal enable/disable the l2 tunnel offload functions */
-
-
-typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
- enum rte_filter_type filter_type,
- enum rte_filter_op filter_op,
- void *arg);
-/**< @internal Take operations to assigned filter type on an Ethernet device */
-
-typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
-
-typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Trafffic Metering and Policing (MTR) operations */
-
-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.
- */
-struct eth_dev_ops {
- eth_dev_configure_t dev_configure; /**< Configure device. */
- eth_dev_start_t dev_start; /**< Start device. */
- eth_dev_stop_t dev_stop; /**< Stop device. */
- eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
- eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
- eth_dev_close_t dev_close; /**< Close device. */
- eth_dev_reset_t dev_reset; /**< Reset device. */
- eth_link_update_t link_update; /**< Get device link state. */
- eth_is_removed_t is_removed;
- /**< Check if the device was physically removed. */
-
- eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
- eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
- eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
- eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
- eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
- eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
- eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
- eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
- mtu_set_t mtu_set; /**< Set MTU. */
-
- eth_stats_get_t stats_get; /**< Get generic device statistics. */
- eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
- eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
- eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
- eth_xstats_get_names_t xstats_get_names;
- /**< Get names of extended statistics. */
- eth_queue_stats_mapping_set_t queue_stats_mapping_set;
- /**< Configure per queue stat counter mapping. */
-
- eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
- eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
- eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
- eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
- eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
- /**< Get packet types supported and identified by device. */
-
- vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
- vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
- vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
- vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
- vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
-
- eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
- eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
- eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
- eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
- eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
- eth_queue_release_t rx_queue_release; /**< Release RX queue. */
- eth_rx_queue_count_t rx_queue_count;
- /**< Get the number of used RX descriptors. */
- eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
- eth_rx_descriptor_status_t rx_descriptor_status;
- /**< Check the status of a Rx descriptor. */
- eth_tx_descriptor_status_t tx_descriptor_status;
- /**< Check the status of a Tx descriptor. */
- eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
- eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
- eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
- eth_queue_release_t tx_queue_release; /**< Release TX queue. */
- eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
-
- eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
- eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
-
- flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
- flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
- priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
-
- eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
- eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
-
- eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
- eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
-
- eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
- eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
- eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
- /** Config ether type of l2 tunnel. */
- eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
- /** Enable/disable l2 tunnel offload functions. */
-
- eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
-
- rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
- rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
- reta_update_t reta_update; /** Update redirection table. */
- reta_query_t reta_query; /** Query redirection table. */
-
- eth_get_reg_t get_reg; /**< Get registers. */
- eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
- eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
- eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
-
-
- eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
-
- eth_get_dcb_info get_dcb_info; /** Get DCB information. */
-
- eth_timesync_enable_t timesync_enable;
- /** Turn IEEE1588/802.1AS timestamping on. */
- eth_timesync_disable_t timesync_disable;
- /** Turn IEEE1588/802.1AS timestamping off. */
- eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
- /** Read the IEEE1588/802.1AS RX timestamp. */
- eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
- /** Read the IEEE1588/802.1AS TX timestamp. */
- eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
- eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
- eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
-
- eth_xstats_get_by_id_t xstats_get_by_id;
- /**< Get extended device statistic values by ID. */
- eth_xstats_get_names_by_id_t xstats_get_names_by_id;
- /**< Get name of extended device statistics by ID. */
-
- eth_tm_ops_get_t tm_ops_get;
- /**< Get Traffic Management (TM) operations. */
-
- eth_mtr_ops_get_t mtr_ops_get;
- /**< Get Traffic Metering and Policing (MTR) operations. */
-
- eth_pool_ops_supported_t pool_ops_supported;
- /**< Test if a port supports specific mempool ops */
-};
-
/**
* Function type used for RX packet processing packet callbacks.
*
@@ -1679,20 +1202,6 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
-/**
- * @internal
- * Structure used to hold information about the callbacks to be called for a
- * queue on RX and TX.
- */
-struct rte_eth_rxtx_callback {
- struct rte_eth_rxtx_callback *next;
- union{
- rte_rx_callback_fn rx;
- rte_tx_callback_fn tx;
- } fn;
- void *param;
-};
-
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1703,40 +1212,6 @@ enum rte_eth_dev_state {
RTE_ETH_DEV_REMOVED,
};
-/**
- * @internal
- * The generic data structure associated with each ethernet device.
- *
- * Pointers to burst-oriented packet receive and transmit functions are
- * located at the beginning of the structure, along with the pointer to
- * where all the data elements for the particular device are stored in shared
- * memory. This split allows the function pointer and driver data to be per-
- * process, while the actual configuration data for the device is shared.
- */
-struct rte_eth_dev {
- eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
- eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
- eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
- struct rte_eth_dev_data *data; /**< Pointer to device data */
- const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
- struct rte_device *device; /**< Backing device */
- struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
- /** User application callbacks for NIC interrupts */
- struct rte_eth_dev_cb_list link_intr_cbs;
- /**
- * User-supplied functions called from rx_burst to post-process
- * received packets before passing them to the user
- */
- struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- /**
- * User-supplied functions called from tx_burst to pre-process
- * received packets before passing them to the driver for transmission.
- */
- struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- enum rte_eth_dev_state state; /**< Flag indicating the port state */
- void *security_ctx; /**< Context for security ops */
-} __rte_cache_aligned;
-
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
uint8_t nb_q_per_pool; /**< rx queue number per pool */
@@ -1747,57 +1222,7 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-/**
- * @internal
- * The data part, with no function pointers, associated with each ethernet device.
- *
- * This structure is safe to place in shared memory to be common among different
- * processes in a multi-process configuration.
- */
-struct rte_eth_dev_data {
- char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
-
- void **rx_queues; /**< Array of pointers to RX queues. */
- void **tx_queues; /**< Array of pointers to TX queues. */
- uint16_t nb_rx_queues; /**< Number of RX queues. */
- uint16_t nb_tx_queues; /**< Number of TX queues. */
-
- struct rte_eth_dev_sriov sriov; /**< SRIOV data */
-
- void *dev_private; /**< PMD-specific private data */
-
- struct rte_eth_link dev_link;
- /**< Link-level information & status */
-
- struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
- uint16_t mtu; /**< Maximum Transmission Unit. */
-
- uint32_t min_rx_buf_size;
- /**< Common rx buffer size handled by all queues */
-
- uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
- struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
- uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
- /** bitmap array of associating Ethernet MAC addresses to pools */
- struct ether_addr* hash_mac_addrs;
- /** Device Ethernet MAC addresses of hash filtering. */
- uint16_t port_id; /**< Device [external] port identifier. */
- __extension__
- uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
- scattered_rx : 1, /**< RX of scattered packets 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). */
- lro : 1; /**< RX LRO is ON(1) / OFF(0) */
- uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint32_t dev_flags; /**< Capabilities */
- enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
- int numa_node; /**< NUMA node connection */
- struct rte_vlan_filter_conf vlan_filter_conf;
- /**< VLAN filter configuration. */
-};
+#include <rte_ethdev_core.h>
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
@@ -1806,13 +1231,6 @@ struct rte_eth_dev_data {
/** Device supports device removal interrupt */
#define RTE_ETH_DEV_INTR_RMV 0x0008
-/**
- * @internal
- * The pool of *rte_eth_dev* structures. The size of the pool
- * is configured at compile-time in the <rte_ethdev.c> file.
- */
-extern struct rte_eth_dev rte_eth_devices[];
-
/**
* Iterates over valid ethdev ports.
*
diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h
new file mode 100644
index 000000000..f44b40e1e
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_core.h
@@ -0,0 +1,607 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
+ */
+
+#ifndef _RTE_ETHDEV_CORE_H_
+#define _RTE_ETHDEV_CORE_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device internal header.
+ *
+ * This header contains internal data types. But they are still part of the
+ * public API because they are used by inline functions in the published API.
+ *
+ * Applications should not use these directly.
+ *
+ */
+
+/*
+ * Definitions of all functions exported by an Ethernet driver through the
+ * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
+ * structure associated with an Ethernet device.
+ */
+struct rte_eth_dev;
+
+typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
+/**< @internal Ethernet device configuration. */
+
+typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to start a configured Ethernet device. */
+
+typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to stop a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link up a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link down a configured Ethernet device. */
+
+typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to close a configured Ethernet device. */
+
+typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
+/** <@internal Function used to reset a configured Ethernet device. */
+
+typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to detect an Ethernet device removal. */
+
+typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
+
+typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
+
+typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
+ int wait_to_complete);
+/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
+
+typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_stats *igb_stats);
+/**< @internal Get global I/O statistics of an Ethernet device. */
+
+typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
+
+typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat *stats, unsigned n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
+ const uint64_t *ids,
+ uint64_t *values,
+ unsigned int n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, unsigned size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+ unsigned int size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id,
+ uint8_t stat_idx,
+ uint8_t is_rx);
+/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
+
+typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_dev_info *dev_info);
+/**< @internal Get specific informations of an Ethernet device. */
+
+typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
+/**< @internal Get supported ptypes of an Ethernet device. */
+
+typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Start rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Stop rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ uint16_t nb_rx_desc,
+ unsigned int socket_id,
+ const struct rte_eth_rxconf *rx_conf,
+ struct rte_mempool *mb_pool);
+/**< @internal Set up a receive queue of an Ethernet device. */
+
+typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t tx_queue_id,
+ uint16_t nb_tx_desc,
+ unsigned int socket_id,
+ 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. */
+
+typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id);
+/**< @internal Get number of used descriptors on a receive queue. */
+
+typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
+/**< @internal Check DD bit of specific RX descriptor */
+
+typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
+/**< @internal Check the status of a Rx descriptor */
+
+typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
+/**< @internal Check the status of a Tx descriptor */
+
+typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size);
+/**< @internal Get firmware information of an Ethernet device. */
+
+typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
+/**< @internal Force mbufs to be from TX ring. */
+
+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. */
+
+typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
+
+typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
+ enum rte_vlan_type type, uint16_t tpid);
+/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
+
+typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
+/**< @internal set VLAN offload function by an Ethernet device. */
+
+typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal set port based TX VLAN insertion by an Ethernet device. */
+
+typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ int on);
+/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
+
+typedef uint16_t (*eth_rx_burst_t)(void *rxq,
+ struct rte_mbuf **rx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_burst_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Send output packets on a transmit queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_prep_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Prepare output packets on a transmit queue of 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 */
+
+typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_fc_conf *fc_conf);
+/**< @internal Setup flow control parameter on an Ethernet device */
+
+typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_pfc_conf *pfc_conf);
+/**< @internal Setup priority flow control parameter on an Ethernet device */
+
+typedef int (*reta_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Update RSS redirection table on an Ethernet device */
+
+typedef int (*reta_query_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Query RSS redirection table on an Ethernet device */
+
+typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Update RSS hash configuration of an Ethernet device */
+
+typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Get current RSS hash configuration of an Ethernet device */
+
+typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
+/**< @internal Turn on SW controllable LED on an Ethernet device */
+
+typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
+/**< @internal Turn off SW controllable LED on an Ethernet device */
+
+typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
+/**< @internal Remove MAC address from receive address register */
+
+typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint32_t index,
+ uint32_t vmdq);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint8_t on);
+/**< @internal Set a Unicast Hash bitmap */
+
+typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
+ uint8_t on);
+/**< @internal Set all Unicast Hash bitmap */
+
+typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
+ uint16_t queue_idx,
+ uint16_t tx_rate);
+/**< @internal Set queue TX rate */
+
+typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
+/**< @internal Add a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
+ uint8_t rule_id);
+/**< @internal Remove a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Add tunneling UDP port */
+
+typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Delete tunneling UDP port */
+
+typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
+/**< @internal set the list of multicast addresses on an Ethernet device */
+
+typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
+ struct timespec *timestamp,
+ uint32_t flags);
+/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
+
+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_t)(struct rte_eth_dev *dev,
+ struct rte_dev_reg_info *info);
+/**< @internal Retrieve registers */
+
+typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
+/**< @internal Retrieve eeprom size */
+
+typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Retrieve eeprom data */
+
+typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Program eeprom data */
+
+typedef int (*eth_l2_tunnel_eth_type_conf_t)
+ (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
+/**< @internal config l2 tunnel ether type */
+
+typedef int (*eth_l2_tunnel_offload_set_t)
+ (struct rte_eth_dev *dev,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
+/**< @internal enable/disable the l2 tunnel offload functions */
+
+
+typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
+ enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op,
+ void *arg);
+/**< @internal Take operations to assigned filter type on an Ethernet device */
+
+typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
+
+typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Trafffic Metering and Policing (MTR) operations */
+
+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.
+ */
+struct eth_dev_ops {
+ eth_dev_configure_t dev_configure; /**< Configure device. */
+ eth_dev_start_t dev_start; /**< Start device. */
+ eth_dev_stop_t dev_stop; /**< Stop device. */
+ eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
+ eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
+ eth_dev_close_t dev_close; /**< Close device. */
+ eth_dev_reset_t dev_reset; /**< Reset device. */
+ eth_link_update_t link_update; /**< Get device link state. */
+ eth_is_removed_t is_removed;
+ /**< Check if the device was physically removed. */
+
+ eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
+ eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
+ eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
+ eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
+ eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
+ eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
+ eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
+ eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
+ mtu_set_t mtu_set; /**< Set MTU. */
+
+ eth_stats_get_t stats_get; /**< Get generic device statistics. */
+ eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
+ eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
+ eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
+ eth_xstats_get_names_t xstats_get_names;
+ /**< Get names of extended statistics. */
+ eth_queue_stats_mapping_set_t queue_stats_mapping_set;
+ /**< Configure per queue stat counter mapping. */
+
+ eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
+ eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
+ eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
+ eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
+ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
+ /**< Get packet types supported and identified by device. */
+
+ vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
+ vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
+ vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
+ vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
+ vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
+
+ eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
+ eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
+ eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
+ eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
+ eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
+ eth_queue_release_t rx_queue_release; /**< Release RX queue. */
+ eth_rx_queue_count_t rx_queue_count;
+ /**< Get the number of used RX descriptors. */
+ eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
+ eth_rx_descriptor_status_t rx_descriptor_status;
+ /**< Check the status of a Rx descriptor. */
+ eth_tx_descriptor_status_t tx_descriptor_status;
+ /**< Check the status of a Tx descriptor. */
+ eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
+ eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
+ eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
+ eth_queue_release_t tx_queue_release; /**< Release TX queue. */
+ eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
+
+ eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
+ eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
+
+ flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
+ flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
+ priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
+
+ eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
+ eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
+
+ eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
+ eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
+
+ eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
+ eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
+ eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
+ /** Config ether type of l2 tunnel. */
+ eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
+ /** Enable/disable l2 tunnel offload functions. */
+
+ eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
+
+ rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
+ rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
+ reta_update_t reta_update; /** Update redirection table. */
+ reta_query_t reta_query; /** Query redirection table. */
+
+ eth_get_reg_t get_reg; /**< Get registers. */
+ eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
+ eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
+ eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
+
+
+ eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
+
+ eth_get_dcb_info get_dcb_info; /** Get DCB information. */
+
+ eth_timesync_enable_t timesync_enable;
+ /** Turn IEEE1588/802.1AS timestamping on. */
+ eth_timesync_disable_t timesync_disable;
+ /** Turn IEEE1588/802.1AS timestamping off. */
+ eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
+ /** Read the IEEE1588/802.1AS RX timestamp. */
+ eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
+ /** Read the IEEE1588/802.1AS TX timestamp. */
+ eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
+ eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
+ eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
+
+ eth_xstats_get_by_id_t xstats_get_by_id;
+ /**< Get extended device statistic values by ID. */
+ eth_xstats_get_names_by_id_t xstats_get_names_by_id;
+ /**< Get name of extended device statistics by ID. */
+
+ eth_tm_ops_get_t tm_ops_get;
+ /**< Get Traffic Management (TM) operations. */
+
+ eth_mtr_ops_get_t mtr_ops_get;
+ /**< Get Traffic Metering and Policing (MTR) operations. */
+
+ eth_pool_ops_supported_t pool_ops_supported;
+ /**< Test if a port supports specific mempool ops */
+};
+
+/**
+ * @internal
+ * Structure used to hold information about the callbacks to be called for a
+ * queue on RX and TX.
+ */
+struct rte_eth_rxtx_callback {
+ struct rte_eth_rxtx_callback *next;
+ union{
+ rte_rx_callback_fn rx;
+ rte_tx_callback_fn tx;
+ } fn;
+ void *param;
+};
+
+/**
+ * @internal
+ * The generic data structure associated with each ethernet device.
+ *
+ * Pointers to burst-oriented packet receive and transmit functions are
+ * located at the beginning of the structure, along with the pointer to
+ * where all the data elements for the particular device are stored in shared
+ * memory. This split allows the function pointer and driver data to be per-
+ * process, while the actual configuration data for the device is shared.
+ */
+struct rte_eth_dev {
+ eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
+ eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
+ eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
+ struct rte_eth_dev_data *data; /**< Pointer to device data */
+ const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
+ struct rte_device *device; /**< Backing device */
+ struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
+ /** User application callbacks for NIC interrupts */
+ struct rte_eth_dev_cb_list link_intr_cbs;
+ /**
+ * User-supplied functions called from rx_burst to post-process
+ * received packets before passing them to the user
+ */
+ struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ /**
+ * User-supplied functions called from tx_burst to pre-process
+ * received packets before passing them to the driver for transmission.
+ */
+ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ enum rte_eth_dev_state state; /**< Flag indicating the port state */
+ void *security_ctx; /**< Context for security ops */
+} __rte_cache_aligned;
+
+struct rte_eth_dev_sriov;
+
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each ethernet device.
+ *
+ * This structure is safe to place in shared memory to be common among different
+ * processes in a multi-process configuration.
+ */
+struct rte_eth_dev_data {
+ char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
+
+ void **rx_queues; /**< Array of pointers to RX queues. */
+ void **tx_queues; /**< Array of pointers to TX queues. */
+ uint16_t nb_rx_queues; /**< Number of RX queues. */
+ uint16_t nb_tx_queues; /**< Number of TX queues. */
+
+ struct rte_eth_dev_sriov sriov; /**< SRIOV data */
+
+ void *dev_private; /**< PMD-specific private data */
+
+ struct rte_eth_link dev_link;
+ /**< Link-level information & status */
+
+ struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
+ uint16_t mtu; /**< Maximum Transmission Unit. */
+
+ uint32_t min_rx_buf_size;
+ /**< Common rx buffer size handled by all queues */
+
+ uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
+ struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
+ uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
+ /** bitmap array of associating Ethernet MAC addresses to pools */
+ struct ether_addr* hash_mac_addrs;
+ /** Device Ethernet MAC addresses of hash filtering. */
+ uint16_t port_id; /**< Device [external] port identifier. */
+ __extension__
+ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
+ scattered_rx : 1, /**< RX of scattered packets 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). */
+ lro : 1; /**< RX LRO is ON(1) / OFF(0) */
+ uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint32_t dev_flags; /**< Capabilities */
+ enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
+ int numa_node; /**< NUMA node connection */
+ struct rte_vlan_filter_conf vlan_filter_conf;
+ /**< VLAN filter configuration. */
+};
+
+/**
+ * @internal
+ * The pool of *rte_eth_dev* structures. The size of the pool
+ * is configured at compile-time in the <rte_ethdev.c> file.
+ */
+extern struct rte_eth_dev rte_eth_devices[];
+
+#endif /* _RTE_ETHDEV_CORE_H_ */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v5 3/4] ethdev: reorder inline functions
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 " Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 2/4] ethdev: separate internal structures into own header Ferruh Yigit
@ 2018-01-21 23:35 ` Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Ferruh Yigit
3 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-21 23:35 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Move all inline function to the end of the ethdev.h header file and move
the ethdev_core.h just before inline functions.
Since inline functions need data structures in ethdev_core.h, this
reorder is to group them and make it clear where put further inline
functions.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_ether/rte_ethdev.h | 2769 ++++++++++++++++++++---------------------
1 file changed, 1382 insertions(+), 1387 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 1e40d62c4..d097e528d 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -454,7 +454,6 @@ struct rte_eth_rss_conf {
ETH_RSS_GENEVE | \
ETH_RSS_NVGRE)
-
/**< Mask of valid RSS hash protocols */
#define ETH_RSS_PROTO_MASK ( \
ETH_RSS_IPV4 | \
@@ -1222,8 +1221,6 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-#include <rte_ethdev_core.h>
-
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
/** Device is a bonded slave */
@@ -1249,7 +1246,6 @@ uint16_t rte_eth_find_next(uint16_t port_id);
(unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \
p = rte_eth_find_next(p + 1))
-
/**
* Get the total number of Ethernet devices that have been successfully
* initialized by the matching Ethernet driver during the PCI probing phase
@@ -1573,8 +1569,6 @@ int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id);
*/
int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id);
-
-
/**
* Start an Ethernet device.
*
@@ -1601,7 +1595,6 @@ int rte_eth_dev_start(uint16_t port_id);
*/
void rte_eth_dev_stop(uint16_t port_id);
-
/**
* Link up an Ethernet device.
*
@@ -2193,1818 +2186,1820 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id);
*/
int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
+typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
+ void *userdata);
+
/**
+ * Structure used to buffer packets for future TX
+ * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ */
+struct rte_eth_dev_tx_buffer {
+ buffer_tx_error_fn error_callback;
+ void *error_userdata;
+ uint16_t size; /**< Size of buffer for buffered tx */
+ uint16_t length; /**< Number of packets in the array */
+ struct rte_mbuf *pkts[];
+ /**< Pending packets to be sent on explicit flush or when full */
+};
+
+/**
+ * Calculate the size of the tx buffer.
*
- * Retrieve a burst of input packets from a receive queue of an Ethernet
- * device. The retrieved packets are stored in *rte_mbuf* structures whose
- * pointers are supplied in the *rx_pkts* array.
- *
- * The rte_eth_rx_burst() function loops, parsing the RX ring of the
- * receive queue, up to *nb_pkts* packets, and for each completed RX
- * descriptor in the ring, it performs the following operations:
+ * @param sz
+ * Number of stored packets.
+ */
+#define RTE_ETH_TX_BUFFER_SIZE(sz) \
+ (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+
+/**
+ * Initialize default values for buffered transmitting
*
- * - Initialize the *rte_mbuf* data structure associated with the
- * RX descriptor according to the information provided by the NIC into
- * that RX descriptor.
+ * @param buffer
+ * Tx buffer to be initialized.
+ * @param size
+ * Buffer size
+ * @return
+ * 0 if no error
+ */
+int
+rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+
+/**
+ * Configure a callback for buffered packets which cannot be sent
*
- * - Store the *rte_mbuf* data structure into the next entry of the
- * *rx_pkts* array.
+ * Register a specific callback to be called when an attempt is made to send
+ * all packets buffered on an ethernet port, but not all packets can
+ * successfully be sent. The callback registered here will be called only
+ * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
+ * The default callback configured for each queue by default just frees the
+ * packets back to the calling mempool. If additional behaviour is required,
+ * for example, to count dropped packets, or to retry transmission of packets
+ * which cannot be sent, this function should be used to register a suitable
+ * callback function to implement the desired behaviour.
+ * The example callback "rte_eth_count_unsent_packet_callback()" is also
+ * provided as reference.
*
- * - Replenish the RX descriptor with a new *rte_mbuf* buffer
- * allocated from the memory pool associated with the receive queue at
- * initialization time.
+ * @param buffer
+ * The port identifier of the Ethernet device.
+ * @param callback
+ * The function to be used as the callback.
+ * @param userdata
+ * Arbitrary parameter to be passed to the callback function
+ * @return
+ * 0 on success, or -1 on error with rte_errno set appropriately
+ */
+int
+rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
+ buffer_tx_error_fn callback, void *userdata);
+
+/**
+ * Callback function for silently dropping unsent buffered packets.
*
- * When retrieving an input packet that was scattered by the controller
- * into multiple receive descriptors, the rte_eth_rx_burst() function
- * appends the associated *rte_mbuf* buffers to the first buffer of the
- * packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets silently and is used by tx buffered
+ * operations as default behavior.
*
- * The rte_eth_rx_burst() function returns the number of packets
- * actually retrieved, which is the number of *rte_mbuf* data structures
- * effectively supplied into the *rx_pkts* array.
- * A return value equal to *nb_pkts* indicates that the RX queue contained
- * at least *rx_pkts* packets, and this is likely to signify that other
- * received packets remain in the input queue. Applications implementing
- * a "retrieve as much received packets as possible" policy can check this
- * specific case and keep invoking the rte_eth_rx_burst() function until
- * a value less than *nb_pkts* is returned.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * This receive method has the following advantages:
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * - It allows a run-to-completion network stack engine to retrieve and
- * to immediately process received packets in a fast burst-oriented
- * approach, avoiding the overhead of unnecessary intermediate packet
- * queue/dequeue operations.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Not used
+ */
+void
+rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Callback function for tracking unsent buffered packets.
*
- * - Conversely, it also allows an asynchronous-oriented processing
- * method to retrieve bursts of received packets and to immediately
- * queue them for further parallel processing by another logical core,
- * for instance. However, instead of having received packets being
- * individually queued by the driver, this approach allows the caller
- * of the rte_eth_rx_burst() function to queue a burst of retrieved
- * packets at a time and therefore dramatically reduce the cost of
- * enqueue/dequeue operations per packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets, but also updates a user-supplied counter
+ * to track the overall number of packets dropped. The counter should be an
+ * uint64_t variable.
*
- * - It allows the rte_eth_rx_burst() function of the driver to take
- * advantage of burst-oriented hardware features (CPU cache,
- * prefetch instructions, and so on) to minimize the number of CPU
- * cycles per packet.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * To summarize, the proposed receive API enables many
- * burst-oriented optimizations in both synchronous and asynchronous
- * packet processing environments with no overhead in both cases.
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * The rte_eth_rx_burst() function does not provide any error
- * notification to avoid the corresponding overhead. As a hint, the
- * upper-level application might check the status of the device link once
- * being systematically returned a 0 value for a given number of tries.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Pointer to an uint64_t value, which will be incremented by unsent
+ */
+void
+rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Request the driver to free mbufs currently cached by the driver. The
+ * driver will only free the mbuf if it is no longer in use. It is the
+ * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
+ * called if needed.
*
* @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
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
* to rte_eth_dev_configure().
- * @param rx_pkts
- * The address of an array of pointers to *rte_mbuf* structures that
- * must be large enough to store *nb_pkts* pointers in it.
- * @param nb_pkts
- * The maximum number of packets to retrieve.
+ * @param free_cnt
+ * Maximum number of packets to free. Use 0 to indicate all possible packets
+ * should be freed. Note that a packet may be using multiple mbufs.
* @return
- * The number of packets actually retrieved, which is the number
- * of pointers to *rte_mbuf* structures effectively supplied to the
- * *rx_pkts* array.
+ * Failure: < 0
+ * -ENODEV: Invalid interface
+ * -EIO: device is removed
+ * -ENOTSUP: Driver does not support function
+ * Success: >= 0
+ * 0-n: Number of packets freed. More packets may still remain in ring that
+ * are in use.
*/
-static inline uint16_t
-rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
-
- if (queue_id >= dev->data->nb_rx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
- int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
- rx_pkts, nb_pkts);
-
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+int
+rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
- if (unlikely(cb != NULL)) {
- do {
- nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
- nb_pkts, cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
+/**
+ * The eth device event type for interrupt, and maybe others in the future.
+ */
+enum rte_eth_event_type {
+ RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
+ RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
+ RTE_ETH_EVENT_QUEUE_STATE,
+ /**< queue state event (enabled/disabled) */
+ RTE_ETH_EVENT_INTR_RESET,
+ /**< reset interrupt event, sent to VF on PF reset */
+ RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
+ RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
+ 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_MAX /**< max value of this enum */
+};
- return nb_rx;
-}
+typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
+ enum rte_eth_event_type event, void *cb_arg, void *ret_param);
+/**< user application callback to be registered for interrupts */
/**
- * Get the number of used descriptors of a rx queue
+ * Register a callback function for port event.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
- * @return
- * The number of used descriptors in the specific queue, or:
- * (-EINVAL) if *port_id* or *queue_id* is invalid
- * (-ENOTSUP) if the device does not support this function
- */
-static inline int
-rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
- dev = &rte_eth_devices[port_id];
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
- if (queue_id >= dev->data->nb_rx_queues)
- return -EINVAL;
-
- return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
-}
-
-/**
- * Check if the DD bit of the specific RX descriptor in the queue has been set
+ * Port id.
+ * RTE_ETH_ALL means register the event for all port ids.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
- * @param offset
- * The offset of the descriptor ID from tail.
* @return
- * - (1) if the specific DD bit is set.
- * - (0) if the specific DD bit is not set.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
- return (*dev->dev_ops->rx_descriptor_done)( \
- dev->data->rx_queues[queue_id], offset);
-}
-
-#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
-#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
-#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_callback_register(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check the status of a Rx descriptor in the queue
- *
- * It should be called in a similar context than the Rx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
- *
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * Unregister a callback function for port event.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
- * @param queue_id
- * A valid Rx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the next
- * packet to be received by the driver).
+ * Port id.
+ * RTE_ETH_ALL means unregister the event for all port ids.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback. -1 means to
+ * remove all for the same callback address and same event.
*
* @return
- * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
- * receive a packet.
- * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
- * not yet processed by the driver (i.e. in the receive queue).
- * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
- * the driver and not yet returned to hw, or reserved by the hw.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
- uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *rxq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_rx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
- rxq = dev->data->rx_queues[queue_id];
-
- return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
-}
-
-#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
-#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
-#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_callback_unregister(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check the status of a Tx descriptor in the queue.
- *
- * It should be called in a similar context than the Tx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * 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 packet arrives.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_enable() function enables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Tx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the place where
- * the next packet will be send).
- *
+ * 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
- * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
- * in the transmit queue.
- * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
- * be reused by the driver.
- * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
- * driver or the hardware.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
- uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *txq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
- txq = dev->data->tx_queues[queue_id];
-
- return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
-}
+int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
/**
- * Send a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_burst() function is invoked to transmit output packets
- * on the output queue *queue_id* of the Ethernet device designated by its
- * *port_id*.
- * The *nb_pkts* parameter is the number of packets to send which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
- * up to the number of transmit descriptors available in the TX ring of the
- * transmit queue.
- * For each packet to send, the rte_eth_tx_burst() function performs
- * the following operations:
- *
- * - Pick up the next available descriptor in the transmit ring.
- *
- * - Free the network buffer previously sent with that descriptor, if any.
- *
- * - Initialize the transmit descriptor with the information provided
- * in the *rte_mbuf data structure.
- *
- * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
- * the rte_eth_tx_burst() function uses several transmit descriptors
- * of the ring.
- *
- * The rte_eth_tx_burst() function returns the number of packets it
- * actually sent. A return value equal to *nb_pkts* means that all packets
- * have been sent, and this is likely to signify that other output packets
- * could be immediately transmitted again. Applications that implement a
- * "send as many packets to transmit as possible" policy can check this
- * specific case and keep invoking the rte_eth_tx_burst() function until
- * a value less than *nb_pkts* is returned.
- *
- * It is the responsibility of the rte_eth_tx_burst() function to
- * transparently free the memory buffers of packets previously sent.
- * This feature is driven by the *tx_free_thresh* value supplied to the
- * rte_eth_dev_configure() function at device configuration time.
- * When the number of free TX descriptors drops below this threshold, the
- * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
- * of those packets whose transmission was effectively completed.
+ * When lcore wakes up from rx interrupt indicating packet coming, disable rx
+ * interrupt and returns to polling mode.
*
- * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
- * invoke this function concurrently on the same tx queue without SW lock.
- * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
+ * 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 transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * 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 tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to transmit.
* @return
- * The number of output packets actually stored in transmit descriptors of
- * the transmit ring. The return value can be less than the value of the
- * *tx_pkts* parameter when the transmit ring is full or has been filled up.
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-static inline uint16_t
-rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
-
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
-
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
-
- if (unlikely(cb != NULL)) {
- do {
- nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
- cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
-
- return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
-}
+int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
/**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
- * Process a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
- * transmitted on the output queue *queue_id* of the Ethernet device designated
- * by its *port_id*.
- * The *nb_pkts* parameter is the number of packets to be prepared which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * For each packet to send, the rte_eth_tx_prepare() function performs
- * the following operations:
- *
- * - Check if packet meets devices requirements for tx offloads.
- *
- * - Check limitations about number of segments.
- *
- * - Check additional requirements when debug is enabled.
- *
- * - Update and/or reset required checksums when tx offload is set for packet.
- *
- * Since this function can modify packet data, provided mbufs must be safely
- * writable (e.g. modified data cannot be in shared segment).
- *
- * The rte_eth_tx_prepare() function returns the number of packets ready to be
- * sent. A return value equal to *nb_pkts* means that all packets are valid and
- * ready to be sent, otherwise stops processing on the first invalid packet and
- * leaves the rest packets untouched.
+ * RX Interrupt control per port.
*
- * When this functionality is not implemented in the driver, all packets are
- * are returned untouched.
+ * @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(uint16_t port_id, int epfd, int op, void *data);
+
+/**
+ * RX Interrupt control per queue.
*
* @param port_id
* The port identifier of the Ethernet device.
- * The value must be a valid port id.
* @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * 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 tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to process.
+ * @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
- * The number of packets correct and ready to be sent. The return value can be
- * less than the value of the *tx_pkts* parameter when some packet doesn't
- * meet devices requirements with rte_errno set appropriately:
- * - -EINVAL: offload flags are not correctly set
- * - -ENOTSUP: the offload feature is not supported by the hardware
- *
+ * - On success, zero.
+ * - On failure, a negative value.
*/
+int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
+ int epfd, int op, void *data);
-#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
-
-static inline uint16_t
-rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (!rte_eth_dev_is_valid_port(port_id)) {
- RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- if (!dev->tx_pkt_prepare)
- return nb_pkts;
-
- return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
- tx_pkts, nb_pkts);
-}
-
-#else
-
-/*
- * Native NOOP operation for compilation targets which doesn't require any
- * preparations steps, and functional NOOP may introduce unnecessary performance
- * drop.
+/**
+ * Turn on the LED on the Ethernet device.
+ * This function turns on the LED on the Ethernet device.
*
- * Generally this is not a good idea to turn it on globally and didn't should
- * be used if behavior of tx_preparation can change.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-
-static inline uint16_t
-rte_eth_tx_prepare(__rte_unused uint16_t port_id,
- __rte_unused uint16_t queue_id,
- __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- return nb_pkts;
-}
-
-#endif
-
-typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
- void *userdata);
+int rte_eth_led_on(uint16_t port_id);
/**
- * Structure used to buffer packets for future TX
- * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ * Turn off the LED on the Ethernet device.
+ * This function turns off the LED on the Ethernet device.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-struct rte_eth_dev_tx_buffer {
- buffer_tx_error_fn error_callback;
- void *error_userdata;
- uint16_t size; /**< Size of buffer for buffered tx */
- uint16_t length; /**< Number of packets in the array */
- struct rte_mbuf *pkts[];
- /**< Pending packets to be sent on explicit flush or when full */
-};
+int rte_eth_led_off(uint16_t port_id);
/**
- * Calculate the size of the tx buffer.
+ * Get current status of the Ethernet link flow control for Ethernet device
*
- * @param sz
- * Number of stored packets.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure where to store the flow control parameters.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-#define RTE_ETH_TX_BUFFER_SIZE(sz) \
- (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Initialize default values for buffered transmitting
+ * Configure the Ethernet link flow control for Ethernet device
*
- * @param buffer
- * Tx buffer to be initialized.
- * @param size
- * Buffer size
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure of the flow control parameters.
* @return
- * 0 if no error
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure or device is removed.
*/
-int
-rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Send any packets queued up for transmission on a port and HW queue
- *
- * This causes an explicit flush of packets previously buffered via the
- * rte_eth_tx_buffer() function. It returns the number of packets successfully
- * sent to the NIC, and calls the error callback for any unsent packets. Unless
- * explicitly set up otherwise, the default callback simply frees the unsent
- * packets back to the owning mempool.
+ * Configure the Ethernet priority flow control under DCB environment
+ * for Ethernet device.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer of packets to be transmit.
+ * The port identifier of the Ethernet device.
+ * @param pfc_conf
+ * The pointer to the structure of the priority flow control parameters.
* @return
- * The number of packets successfully sent to the Ethernet device. The error
- * callback is called for any packets which could not be sent.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure or device is removed.
*/
-static inline uint16_t
-rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer)
-{
- uint16_t sent;
- uint16_t to_send = buffer->length;
-
- if (to_send == 0)
- return 0;
-
- sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
-
- buffer->length = 0;
-
- /* All packets sent, or to be dealt with by callback below */
- if (unlikely(sent != to_send))
- buffer->error_callback(&buffer->pkts[sent], to_send - sent,
- buffer->error_userdata);
-
- return sent;
-}
+int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_pfc_conf *pfc_conf);
/**
- * Buffer a single packet for future transmission on a port and queue
- *
- * This function takes a single mbuf/packet and buffers it for later
- * transmission on the particular port and queue specified. Once the buffer is
- * full of packets, an attempt will be made to transmit all the buffered
- * packets. In case of error, where not all packets can be transmitted, a
- * callback is called with the unsent packets as a parameter. If no callback
- * is explicitly set up, the unsent packets are just freed back to the owning
- * mempool. The function returns the number of packets actually sent i.e.
- * 0 if no buffer flush occurred, otherwise the number of packets successfully
- * flushed
+ * Add a MAC address to an internal array of addresses used to enable whitelist
+ * filtering to accept packets only if the destination MAC address matches.
*
- * @param port_id
+ * @param port
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer used to collect packets to be sent.
- * @param tx_pkt
- * Pointer to the packet mbuf to be sent.
+ * @param mac_addr
+ * The MAC address to add.
+ * @param pool
+ * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
+ * not enabled, this should be set to 0.
* @return
- * 0 = packet has been buffered for later transmission
- * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
- * causing N packets to be sent, and the error callback to be called for
- * the rest.
+ * - (0) if successfully added or *mac_addr" was already added.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port* is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOSPC) if no more MAC addresses can be added.
+ * - (-EINVAL) if MAC address is invalid.
*/
-static __rte_always_inline uint16_t
-rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
-{
- buffer->pkts[buffer->length++] = tx_pkt;
- if (buffer->length < buffer->size)
- return 0;
-
- return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
-}
+int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+ uint32_t pool);
/**
- * Configure a callback for buffered packets which cannot be sent
+ * Remove a MAC address from the internal array of addresses.
*
- * Register a specific callback to be called when an attempt is made to send
- * all packets buffered on an ethernet port, but not all packets can
- * successfully be sent. The callback registered here will be called only
- * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
- * The default callback configured for each queue by default just frees the
- * packets back to the calling mempool. If additional behaviour is required,
- * for example, to count dropped packets, or to retry transmission of packets
- * which cannot be sent, this function should be used to register a suitable
- * callback function to implement the desired behaviour.
- * The example callback "rte_eth_count_unsent_packet_callback()" is also
- * provided as reference.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param mac_addr
+ * MAC address to remove.
+ * @return
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EADDRINUSE) if attempting to remove the default MAC address
+ */
+int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+
+/**
+ * Set the default MAC address.
*
- * @param buffer
+ * @param port
* The port identifier of the Ethernet device.
- * @param callback
- * The function to be used as the callback.
- * @param userdata
- * Arbitrary parameter to be passed to the callback function
+ * @param mac_addr
+ * New default MAC address.
* @return
- * 0 on success, or -1 on error with rte_errno set appropriately
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EINVAL) if MAC address is invalid.
*/
-int
-rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
- buffer_tx_error_fn callback, void *userdata);
+int rte_eth_dev_default_mac_addr_set(uint16_t port,
+ struct ether_addr *mac_addr);
/**
- * Callback function for silently dropping unsent buffered packets.
+ * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets silently and is used by tx buffered
- * operations as default behavior.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to update.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
+ * - (-EIO) if device is removed.
+ */
+int rte_eth_dev_rss_reta_update(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+
+ /**
+ * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to query.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
+ * - (-EIO) if device is removed.
+ */
+int rte_eth_dev_rss_reta_query(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+
+ /**
+ * Updates unicast hash table for receiving packet with the given destination
+ * MAC address, and the packet is routed to all VFs for which the RX mode is
+ * accept packets that match the unicast hash table.
*
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param addr
+ * Unicast MAC address.
+ * @param on
+ * 1 - Set an unicast hash bit for receiving packets with the MAC address.
+ * 0 - Clear an unicast hash bit.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+ uint8_t on);
+
+ /**
+ * Updates all unicast hash bitmaps for receiving packet with any Unicast
+ * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
+ * mode is accept packets that match the unicast hash table.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Not used
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param on
+ * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
+ * MAC addresses
+ * 0 - Clear all unicast hash bitmaps
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if bad parameter.
*/
-void
-rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
/**
- * Callback function for tracking unsent buffered packets.
- *
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets, but also updates a user-supplied counter
- * to track the overall number of packets dropped. The counter should be an
- * uint64_t variable.
- *
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
+ * Set a traffic mirroring rule on an Ethernet device
*
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param mirror_conf
+ * The pointer to the traffic mirroring structure describing the mirroring rule.
+ * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
+ * destination pool and the value of rule if enable vlan or pool mirroring.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Pointer to an uint64_t value, which will be incremented by unsent
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
+ * @param on
+ * 1 - Enable a mirroring rule.
+ * 0 - Disable a mirroring rule.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if the mr_conf information is not correct.
*/
-void
-rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_mirror_rule_set(uint16_t port_id,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
/**
- * Request the driver to free mbufs currently cached by the driver. The
- * driver will only free the mbuf if it is no longer in use. It is the
- * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
- * called if needed.
+ * Reset a traffic mirroring rule on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param free_cnt
- * Maximum number of packets to free. Use 0 to indicate all possible packets
- * should be freed. Note that a packet may be using multiple mbufs.
- * @return
- * Failure: < 0
- * -ENODEV: Invalid interface
- * -EIO: device is removed
- * -ENOTSUP: Driver does not support function
- * Success: >= 0
- * 0-n: Number of packets freed. More packets may still remain in ring that
- * are in use.
- */
-int
-rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
-
-/**
- * The eth device event type for interrupt, and maybe others in the future.
- */
-enum rte_eth_event_type {
- RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
- RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
- RTE_ETH_EVENT_QUEUE_STATE,
- /**< queue state event (enabled/disabled) */
- RTE_ETH_EVENT_INTR_RESET,
- /**< reset interrupt event, sent to VF on PF reset */
- RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
- RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
- 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_MAX /**< max value of this enum */
-};
-
-typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
- enum rte_eth_event_type event, void *cb_arg, void *ret_param);
-/**< user application callback to be registered for interrupts */
-
-
-
-/**
- * Register a callback function for port event.
- *
- * @param port_id
- * Port id.
- * RTE_ETH_ALL means register the event for all port ids.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback.
- *
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_register(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_mirror_rule_reset(uint16_t port_id,
+ uint8_t rule_id);
/**
- * Unregister a callback function for port event.
+ * Set the rate limitation for a queue on an Ethernet device.
*
* @param port_id
- * Port id.
- * RTE_ETH_ALL means unregister the event for all port ids.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback. -1 means to
- * remove all for the same callback address and same event.
- *
+ * The port identifier of the Ethernet device.
+ * @param queue_idx
+ * The queue id.
+ * @param tx_rate
+ * The tx rate in Mbps. Allocated from the total port link speed.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_unregister(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
+ uint16_t tx_rate);
-/**
- * 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 packet arrives.
- *
- * The rte_eth_dev_rx_intr_enable() function enables rx queue
- * interrupt on specific rx queue of a port.
+ /**
+ * Configuration of Receive Side Scaling hash computation of Ethernet device.
*
* @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 rss_conf
+ * The new configuration to use for RSS hash computation on the port.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
* - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
+int rte_eth_dev_rss_hash_update(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * 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.
+ /**
+ * Retrieve current configuration of Receive Side Scaling hash computation
+ * of Ethernet device.
*
* @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 rss_conf
+ * Where to store the current RSS hash configuration of the Ethernet device.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
* - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support RSS.
*/
-int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
+int
+rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * RX Interrupt control per port.
+ /**
+ * Add UDP tunneling port for a specific type of tunnel.
+ * The packets with this UDP port will be identified as this type of tunnel.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to change or add more UDP port for the tunnel. So the offloading function
+ * can take effect on the packets with the specific UDP 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.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
+int
+rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
-/**
- * RX Interrupt control per queue.
+ /**
+ * Delete UDP tunneling port a specific type of tunnel.
+ * The packets with this UDP port will not be identified as this type of tunnel
+ * any more.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to delete a UDP port for the tunnel. So the offloading function will not take
+ * effect on the packets with the specific UDP 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().
- * @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.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
- int epfd, int op, void *data);
+int
+rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
/**
- * Turn on the LED on the Ethernet device.
- * This function turns on the LED on the Ethernet device.
+ * Check whether the filter type is supported on an Ethernet device.
+ * All the supported filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support this filter type.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
*/
-int rte_eth_led_on(uint16_t port_id);
+int rte_eth_dev_filter_supported(uint16_t port_id,
+ enum rte_filter_type filter_type);
/**
- * Turn off the LED on the Ethernet device.
- * This function turns off the LED on the Ethernet device.
+ * Take operations to assigned filter type on an Ethernet device.
+ * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
+ * @param filter_op
+ * Type of operation.
+ * @param arg
+ * A pointer to arguments defined specifically for the operation.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_led_off(uint16_t port_id);
+int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op, void *arg);
/**
- * Get current status of the Ethernet link flow control for Ethernet device
+ * Get DCB information on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure where to store the flow control parameters.
+ * @param dcb_info
+ * dcb information.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support.
*/
-int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+int rte_eth_dev_get_dcb_info(uint16_t port_id,
+ struct rte_eth_dcb_info *dcb_info);
/**
- * Configure the Ethernet link flow control for Ethernet device
+ * Add a callback to be called on packet RX on a given port and queue.
+ *
+ * This API configures a function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure of the flow control parameters.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure or device is removed.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Configure the Ethernet priority flow control under DCB environment
- * for Ethernet device.
+ * Add a callback that must be called first on packet RX on a given port
+ * and queue.
+ *
+ * This API configures a first function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param pfc_conf
- * The pointer to the structure of the priority flow control parameters.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure or device is removed.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_pfc_conf *pfc_conf);
+void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Add a MAC address to an internal array of addresses used to enable whitelist
- * filtering to accept packets only if the destination MAC address matches.
+ * Add a callback to be called on packet TX on a given port and queue.
*
- * @param port
+ * This API configures a function to be called for each burst of
+ * packets sent on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_tx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * The MAC address to add.
- * @param pool
- * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
- * not enabled, this should be set to 0.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successfully added or *mac_addr" was already added.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port* is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOSPC) if no more MAC addresses can be added.
- * - (-EINVAL) if MAC address is invalid.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
- uint32_t pool);
+void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_tx_callback_fn fn, void *user_param);
+
+struct rte_eth_rxtx_callback;
/**
- * Remove a MAC address from the internal array of addresses.
+ * Remove an RX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_rx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * MAC address to remove.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_rx_callback().
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EADDRINUSE) if attempting to remove the default MAC address
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Set the default MAC address.
+ * Remove a TX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_tx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * New default MAC address.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_tx_callback().
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EINVAL) if MAC address is invalid.
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
- struct ether_addr *mac_addr);
+int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+ * Retrieve information about given port's RX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to update.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
- * - (-EIO) if device is removed.
+ * - 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_dev_rss_reta_update(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
- /**
- * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+/**
+ * Retrieve information about given port's TX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to query.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
- * - (-EIO) if device is removed.
+ * - 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_dev_rss_reta_query(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
- /**
- * Updates unicast hash table for receiving packet with the given destination
- * MAC address, and the packet is routed to all VFs for which the RX mode is
- * accept packets that match the unicast hash table.
+/**
+ * Retrieve device registers and register attributes (number of registers and
+ * register size)
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param addr
- * Unicast MAC address.
- * @param on
- * 1 - Set an unicast hash bit for receiving packets with the MAC address.
- * 0 - Clear an unicast hash bit.
+ * @param info
+ * Pointer to rte_dev_reg_info structure to fill in. If info->data is
+ * NULL the function fills in the width and length fields. If non-NULL
+ * the registers are put into the buffer pointed at by the data field.
* @return
* - (0) if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
- uint8_t on);
+int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
- /**
- * Updates all unicast hash bitmaps for receiving packet with any Unicast
- * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
- * mode is accept packets that match the unicast hash table.
+/**
+ * Retrieve size of device EEPROM
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param on
- * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
- * MAC addresses
- * 0 - Clear all unicast hash bitmaps
* @return
- * - (0) if successful.
+ * - (>=0) EEPROM size if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_get_eeprom_length(uint16_t port_id);
/**
- * Set a traffic mirroring rule on an Ethernet device
+ * Retrieve EEPROM and EEPROM attribute
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param mirror_conf
- * The pointer to the traffic mirroring structure describing the mirroring rule.
- * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
- * destination pool and the value of rule if enable vlan or pool mirroring.
- *
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
- * @param on
- * 1 - Enable a mirroring rule.
- * 0 - Disable a mirroring rule.
+ * @param info
+ * The template includes buffer for return EEPROM data and
+ * EEPROM attributes to be filled.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if the mr_conf information is not correct.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_set(uint16_t port_id,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
+int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
- * Reset a traffic mirroring rule on an Ethernet device.
+ * Program EEPROM with provided data
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
+ * @param info
+ * The template includes EEPROM data for programming and
+ * EEPROM attributes to be filled
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_reset(uint16_t port_id,
- uint8_t rule_id);
+int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
- * Set the rate limitation for a queue on an Ethernet device.
+ * Set the list of multicast addresses to filter on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_idx
- * The queue id.
- * @param tx_rate
- * The tx rate in Mbps. Allocated from the total port link speed.
+ * @param mc_addr_set
+ * The array of multicast addresses to set. Equal to NULL when the function
+ * is invoked to flush the set of filtered addresses.
+ * @param nb_mc_addr
+ * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
+ * when the function is invoked to flush the set of filtered addresses.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if bad parameter.
+ * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
+ * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
*/
-int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
- uint16_t tx_rate);
+int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
- /**
- * Configuration of Receive Side Scaling hash computation of Ethernet device.
+/**
+ * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * The new configuration to use for RSS hash computation on the port.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_rss_hash_update(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_timesync_enable(uint16_t port_id);
- /**
- * Retrieve current configuration of Receive Side Scaling hash computation
- * of Ethernet device.
+/**
+ * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * Where to store the current RSS hash configuration of the Ethernet device.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support RSS.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_timesync_disable(uint16_t port_id);
- /**
- * Add UDP tunneling port for a specific type of tunnel.
- * The packets with this UDP port will be identified as this type of tunnel.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to change or add more UDP port for the tunnel. So the offloading function
- * can take effect on the packets with the specific UDP port.
+/**
+ * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ * @param flags
+ * Device specific flags. Used to pass the RX timesync register index to
+ * i40e. Unused in igb/ixgbe, pass 0 instead.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
+ struct timespec *timestamp, uint32_t flags);
- /**
- * Delete UDP tunneling port a specific type of tunnel.
- * The packets with this UDP port will not be identified as this type of tunnel
- * any more.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to delete a UDP port for the tunnel. So the offloading function will not take
- * effect on the packets with the specific UDP port.
+/**
+ * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
+ * @param timestamp
+ * Pointer to the timestamp struct.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
+ struct timespec *timestamp);
/**
- * Check whether the filter type is supported on an Ethernet device.
- * All the supported filter types are defined in 'rte_eth_ctrl.h'.
+ * 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 filter_type
- * Filter type.
+ * @param delta
+ * The adjustment in nanoseconds.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this filter type.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_supported(uint16_t port_id,
- enum rte_filter_type filter_type);
+int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
/**
- * Take operations to assigned filter type on an Ethernet device.
- * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
+ * 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 filter_type
- * Filter type.
- * @param filter_op
- * Type of operation.
- * @param arg
- * A pointer to arguments defined specifically for the operation.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
+ * - 0: Success.
*/
-int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
- enum rte_filter_op filter_op, void *arg);
+int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
/**
- * Get DCB information on an Ethernet device.
+ * 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 dcb_info
- * dcb information.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_get_dcb_info(uint16_t port_id,
- struct rte_eth_dcb_info *dcb_info);
+int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
/**
- * Add a callback to be called on packet RX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Config l2 tunnel ether type of an Ethernet device for filtering specific
+ * tunnel packets by ether type.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param l2_tunnel
+ * l2 tunnel configuration.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int
+rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel);
/**
- * Add a callback that must be called first on packet RX on a given port
- * and queue.
- *
- * This API configures a first function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Enable/disable l2 tunnel offload functions. Include,
+ * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
+ * Filtering, forwarding and offloading this type of tunnel packets depend on
+ * this ability.
+ * 2, Stripping the l2 tunnel tag.
+ * 3, Insertion of the l2 tunnel tag.
+ * 4, Forwarding the packets based on the l2 tunnel tag.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param l2_tunnel
+ * l2 tunnel parameters.
+ * @param mask
+ * Indicate the offload function.
+ * @param en
+ * Enable or disable this function.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int
+rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
/**
- * Add a callback to be called on packet TX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets sent on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_tx_callback().
- *
- * Multiple functions are called in the order that they are added.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
- *
- * @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
- */
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
- rte_tx_callback_fn fn, void *user_param);
+* Get the port id from pci address or device name
+* Ex: 0000:2:00.0 or vdev name net_pcap0
+*
+* @param name
+* pci address or name of the device
+* @param port_id
+* pointer to port identifier of the device
+* @return
+* - (0) if successful and port_id is filled.
+* - (-ENODEV or -EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
/**
- * Remove an RX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_rx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_rx_callback().
- *
- * @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
- */
-int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+* Get the device name from port id
+*
+* @param port_id
+* pointer to port identifier of the device
+* @param name
+* pci address or name of the device
+* @return
+* - (0) if successful.
+* - (-EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
/**
- * Remove a TX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_tx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
+ * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
+ * the ethernet device information, otherwise adjust them to boundaries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_tx_callback().
- *
+ * @param nb_rx_desc
+ * A pointer to a uint16_t where the number of receive
+ * descriptors stored.
+ * @param nb_tx_desc
+ * A pointer to a uint16_t where the number of transmit
+ * descriptors stored.
* @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
+ * - (0) if successful.
+ * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
*/
-int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
+ uint16_t *nb_rx_desc,
+ uint16_t *nb_tx_desc);
/**
- * Retrieve information about given port's RX queue.
+ * Test if a port supports specific mempool ops.
*
* @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.
- *
+ * Port identifier of the Ethernet device.
+ * @param [in] pool
+ * The name of the pool operations to test.
* @return
- * - 0: Success
- * - -ENOTSUP: routine is not supported by the device PMD.
- * - -EINVAL: The port_id or the queue_id is out of range.
+ * - 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_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxq_info *qinfo);
+int
+rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
/**
- * Retrieve information about given port's TX queue.
+ * Get the security context for the Ethernet device.
*
* @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.
- *
+ * Port identifier 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.
+ * - NULL on error.
+ * - pointer to security context on success.
*/
-int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_txq_info *qinfo);
+void *
+rte_eth_dev_get_sec_ctx(uint8_t port_id);
-/**
- * Retrieve device registers and register attributes (number of registers and
- * register size)
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * Pointer to rte_dev_reg_info structure to fill in. If info->data is
- * NULL the function fills in the width and length fields. If non-NULL
- * the registers are put into the buffer pointed at by the data field.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
-/**
- * Retrieve size of device EEPROM
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @return
- * - (>=0) EEPROM size if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_eeprom_length(uint16_t port_id);
+#include <rte_ethdev_core.h>
/**
- * Retrieve EEPROM and EEPROM attribute
+ *
+ * Retrieve a burst of input packets from a receive queue of an Ethernet
+ * device. The retrieved packets are stored in *rte_mbuf* structures whose
+ * pointers are supplied in the *rx_pkts* array.
+ *
+ * The rte_eth_rx_burst() function loops, parsing the RX ring of the
+ * receive queue, up to *nb_pkts* packets, and for each completed RX
+ * descriptor in the ring, it performs the following operations:
+ *
+ * - Initialize the *rte_mbuf* data structure associated with the
+ * RX descriptor according to the information provided by the NIC into
+ * that RX descriptor.
+ *
+ * - Store the *rte_mbuf* data structure into the next entry of the
+ * *rx_pkts* array.
+ *
+ * - Replenish the RX descriptor with a new *rte_mbuf* buffer
+ * allocated from the memory pool associated with the receive queue at
+ * initialization time.
+ *
+ * When retrieving an input packet that was scattered by the controller
+ * into multiple receive descriptors, the rte_eth_rx_burst() function
+ * appends the associated *rte_mbuf* buffers to the first buffer of the
+ * packet.
+ *
+ * The rte_eth_rx_burst() function returns the number of packets
+ * actually retrieved, which is the number of *rte_mbuf* data structures
+ * effectively supplied into the *rx_pkts* array.
+ * A return value equal to *nb_pkts* indicates that the RX queue contained
+ * at least *rx_pkts* packets, and this is likely to signify that other
+ * received packets remain in the input queue. Applications implementing
+ * a "retrieve as much received packets as possible" policy can check this
+ * specific case and keep invoking the rte_eth_rx_burst() function until
+ * a value less than *nb_pkts* is returned.
+ *
+ * This receive method has the following advantages:
+ *
+ * - It allows a run-to-completion network stack engine to retrieve and
+ * to immediately process received packets in a fast burst-oriented
+ * approach, avoiding the overhead of unnecessary intermediate packet
+ * queue/dequeue operations.
+ *
+ * - Conversely, it also allows an asynchronous-oriented processing
+ * method to retrieve bursts of received packets and to immediately
+ * queue them for further parallel processing by another logical core,
+ * for instance. However, instead of having received packets being
+ * individually queued by the driver, this approach allows the caller
+ * of the rte_eth_rx_burst() function to queue a burst of retrieved
+ * packets at a time and therefore dramatically reduce the cost of
+ * enqueue/dequeue operations per packet.
+ *
+ * - It allows the rte_eth_rx_burst() function of the driver to take
+ * advantage of burst-oriented hardware features (CPU cache,
+ * prefetch instructions, and so on) to minimize the number of CPU
+ * cycles per packet.
+ *
+ * To summarize, the proposed receive API enables many
+ * burst-oriented optimizations in both synchronous and asynchronous
+ * packet processing environments with no overhead in both cases.
+ *
+ * The rte_eth_rx_burst() function does not provide any error
+ * notification to avoid the corresponding overhead. As a hint, the
+ * upper-level application might check the status of the device link once
+ * being systematically returned a 0 value for a given number of tries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param info
- * The template includes buffer for return EEPROM data and
- * EEPROM attributes to be filled.
+ * @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 rx_pkts
+ * The address of an array of pointers to *rte_mbuf* structures that
+ * must be large enough to store *nb_pkts* pointers in it.
+ * @param nb_pkts
+ * The maximum number of packets to retrieve.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
+ * The number of packets actually retrieved, which is the number
+ * of pointers to *rte_mbuf* structures effectively supplied to the
+ * *rx_pkts* array.
*/
-int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+static inline uint16_t
+rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_rx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+ int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
+ rx_pkts, nb_pkts);
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
+ nb_pkts, cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return nb_rx;
+}
/**
- * Program EEPROM with provided data
+ * Get the number of used descriptors of a rx queue
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes EEPROM data for programming and
- * EEPROM attributes to be filled
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
+ * The number of used descriptors in the specific queue, or:
+ * (-EINVAL) if *port_id* or *queue_id* is invalid
+ * (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+static inline int
+rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
+ dev = &rte_eth_devices[port_id];
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -EINVAL;
+
+ return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
+}
/**
- * Set the list of multicast addresses to filter on an Ethernet device.
+ * Check if the DD bit of the specific RX descriptor in the queue has been set
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param mc_addr_set
- * The array of multicast addresses to set. Equal to NULL when the function
- * is invoked to flush the set of filtered addresses.
- * @param nb_mc_addr
- * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
- * when the function is invoked to flush the set of filtered addresses.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
+ * @param offset
+ * The offset of the descriptor ID from tail.
* @return
- * - (0) if successful.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
- * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
+ * - (1) if the specific DD bit is set.
+ * - (0) if the specific DD bit is not set.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
+static inline int
+rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
+ return (*dev->dev_ops->rx_descriptor_done)( \
+ dev->data->rx_queues[queue_id], offset);
+}
+
+#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
+#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
+#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * Check the status of a Rx descriptor in the queue
*
- * @param port_id
- * The port identifier of the Ethernet device.
+ * It should be called in a similar context than the Rx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_enable(uint16_t port_id);
-
-/**
- * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
+ *
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Rx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the next
+ * packet to be received by the driver).
*
* @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
+ * receive a packet.
+ * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
+ * not yet processed by the driver (i.e. in the receive queue).
+ * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
+ * the driver and not yet returned to hw, or reserved by the hw.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int rte_eth_timesync_disable(uint16_t port_id);
+static inline int
+rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
+ uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *rxq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
+ rxq = dev->data->rx_queues[queue_id];
+
+ return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
+}
+
+#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
+#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
+#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
+ * Check the status of a Tx descriptor in the queue.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
- * @param flags
- * Device specific flags. Used to pass the RX timesync register index to
- * i40e. Unused in igb/ixgbe, pass 0 instead.
+ * It should be called in a similar context than the Tx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
*
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
- struct timespec *timestamp, uint32_t flags);
-
-/**
- * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
+ *
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Tx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the place where
+ * the next packet will be send).
*
* @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
+ * in the transmit queue.
+ * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
+ * be reused by the driver.
+ * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
+ * driver or the hardware.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
- struct timespec *timestamp);
+static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
+ uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *txq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
+ txq = dev->data->tx_queues[queue_id];
+
+ return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
+}
/**
- * Adjust the timesync clock on an Ethernet device.
+ * Send a burst of output packets on a transmit queue of 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.
+ * The rte_eth_tx_burst() function is invoked to transmit output packets
+ * on the output queue *queue_id* of the Ethernet device designated by its
+ * *port_id*.
+ * The *nb_pkts* parameter is the number of packets to send which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
+ * up to the number of transmit descriptors available in the TX ring of the
+ * transmit queue.
+ * For each packet to send, the rte_eth_tx_burst() function performs
+ * the following operations:
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param delta
- * The adjustment in nanoseconds.
+ * - Pick up the next available descriptor in the transmit ring.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
-
-/**
- * Read the time from the timesync clock on an Ethernet device.
+ * - Free the network buffer previously sent with that descriptor, if any.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * - Initialize the transmit descriptor with the information provided
+ * in the *rte_mbuf data structure.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
+ * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
+ * the rte_eth_tx_burst() function uses several transmit descriptors
+ * of the ring.
*
- * @return
- * - 0: Success.
- */
-int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
-
-/**
- * Set the time of the timesync clock on an Ethernet device.
+ * The rte_eth_tx_burst() function returns the number of packets it
+ * actually sent. A return value equal to *nb_pkts* means that all packets
+ * have been sent, and this is likely to signify that other output packets
+ * could be immediately transmitted again. Applications that implement a
+ * "send as many packets to transmit as possible" policy can check this
+ * specific case and keep invoking the rte_eth_tx_burst() function until
+ * a value less than *nb_pkts* is returned.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * It is the responsibility of the rte_eth_tx_burst() function to
+ * transparently free the memory buffers of packets previously sent.
+ * This feature is driven by the *tx_free_thresh* value supplied to the
+ * rte_eth_dev_configure() function at device configuration time.
+ * When the number of free TX descriptors drops below this threshold, the
+ * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
+ * of those packets whose transmission was effectively completed.
+ *
+ * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
+ * invoke this function concurrently on the same tx queue without SW lock.
+ * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
- *
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to transmit.
* @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * The number of output packets actually stored in transmit descriptors of
+ * the transmit ring. The return value can be less than the value of the
+ * *tx_pkts* parameter when the transmit ring is full or has been filled up.
*/
-int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
+static inline uint16_t
+rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
+ cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
+}
/**
- * Config l2 tunnel ether type of an Ethernet device for filtering specific
- * tunnel packets by ether type.
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel configuration.
+ * Process a burst of output packets on a transmit queue of an Ethernet device.
*
- * @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
- */
-int
-rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel);
-
-/**
- * Enable/disable l2 tunnel offload functions. Include,
- * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
- * Filtering, forwarding and offloading this type of tunnel packets depend on
- * this ability.
- * 2, Stripping the l2 tunnel tag.
- * 3, Insertion of the l2 tunnel tag.
- * 4, Forwarding the packets based on the l2 tunnel tag.
+ * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
+ * transmitted on the output queue *queue_id* of the Ethernet device designated
+ * by its *port_id*.
+ * The *nb_pkts* parameter is the number of packets to be prepared which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * For each packet to send, the rte_eth_tx_prepare() function performs
+ * the following operations:
+ *
+ * - Check if packet meets devices requirements for tx offloads.
+ *
+ * - Check limitations about number of segments.
+ *
+ * - Check additional requirements when debug is enabled.
+ *
+ * - Update and/or reset required checksums when tx offload is set for packet.
+ *
+ * Since this function can modify packet data, provided mbufs must be safely
+ * writable (e.g. modified data cannot be in shared segment).
+ *
+ * The rte_eth_tx_prepare() function returns the number of packets ready to be
+ * sent. A return value equal to *nb_pkts* means that all packets are valid and
+ * ready to be sent, otherwise stops processing on the first invalid packet and
+ * leaves the rest packets untouched.
+ *
+ * When this functionality is not implemented in the driver, all packets are
+ * are returned untouched.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel parameters.
- * @param mask
- * Indicate the offload function.
- * @param en
- * Enable or disable this function.
- *
+ * The value must be a valid port id.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to process.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * The number of packets correct and ready to be sent. The return value can be
+ * less than the value of the *tx_pkts* parameter when some packet doesn't
+ * meet devices requirements with rte_errno set appropriately:
+ * - -EINVAL: offload flags are not correctly set
+ * - -ENOTSUP: the offload feature is not supported by the hardware
+ *
*/
-int
-rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**
-* Get the port id from pci address or device name
-* Ex: 0000:2:00.0 or vdev name net_pcap0
-*
-* @param name
-* pci address or name of the device
-* @param port_id
-* pointer to port identifier of the device
-* @return
-* - (0) if successful and port_id is filled.
-* - (-ENODEV or -EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
+#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
-/**
-* Get the device name from port id
-*
-* @param port_id
-* pointer to port identifier of the device
-* @param name
-* pci address or name of the device
-* @return
-* - (0) if successful.
-* - (-EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+static inline uint16_t
+rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev;
-/**
- * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
- * the ethernet device information, otherwise adjust them to boundaries.
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ if (!dev->tx_pkt_prepare)
+ return nb_pkts;
+
+ return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
+ tx_pkts, nb_pkts);
+}
+
+#else
+
+/*
+ * Native NOOP operation for compilation targets which doesn't require any
+ * preparations steps, and functional NOOP may introduce unnecessary performance
+ * drop.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param nb_rx_desc
- * A pointer to a uint16_t where the number of receive
- * descriptors stored.
- * @param nb_tx_desc
- * A pointer to a uint16_t where the number of transmit
- * descriptors stored.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
+ * Generally this is not a good idea to turn it on globally and didn't should
+ * be used if behavior of tx_preparation can change.
*/
-int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
- uint16_t *nb_rx_desc,
- uint16_t *nb_tx_desc);
+static inline uint16_t
+rte_eth_tx_prepare(__rte_unused uint16_t port_id,
+ __rte_unused uint16_t queue_id,
+ __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ return nb_pkts;
+}
+
+#endif
/**
- * Test if a port supports specific mempool ops.
+ * Send any packets queued up for transmission on a port and HW queue
+ *
+ * This causes an explicit flush of packets previously buffered via the
+ * rte_eth_tx_buffer() function. It returns the number of packets successfully
+ * sent to the NIC, and calls the error callback for any unsent packets. Unless
+ * explicitly set up otherwise, the default callback simply frees the unsent
+ * packets back to the owning mempool.
*
* @param port_id
- * Port identifier of the Ethernet device.
- * @param [in] pool
- * The name of the pool operations to test.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer of packets to be transmit.
* @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.
+ * The number of packets successfully sent to the Ethernet device. The error
+ * callback is called for any packets which could not be sent.
*/
-int
-rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
+static inline uint16_t
+rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer)
+{
+ uint16_t sent;
+ uint16_t to_send = buffer->length;
+
+ if (to_send == 0)
+ return 0;
+
+ sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
+
+ buffer->length = 0;
+
+ /* All packets sent, or to be dealt with by callback below */
+ if (unlikely(sent != to_send))
+ buffer->error_callback(&buffer->pkts[sent], to_send - sent,
+ buffer->error_userdata);
+
+ return sent;
+}
/**
- * Get the security context for the Ethernet device.
+ * Buffer a single packet for future transmission on a port and queue
+ *
+ * This function takes a single mbuf/packet and buffers it for later
+ * transmission on the particular port and queue specified. Once the buffer is
+ * full of packets, an attempt will be made to transmit all the buffered
+ * packets. In case of error, where not all packets can be transmitted, a
+ * callback is called with the unsent packets as a parameter. If no callback
+ * is explicitly set up, the unsent packets are just freed back to the owning
+ * mempool. The function returns the number of packets actually sent i.e.
+ * 0 if no buffer flush occurred, otherwise the number of packets successfully
+ * flushed
*
* @param port_id
- * Port identifier of the Ethernet device
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer used to collect packets to be sent.
+ * @param tx_pkt
+ * Pointer to the packet mbuf to be sent.
* @return
- * - NULL on error.
- * - pointer to security context on success.
+ * 0 = packet has been buffered for later transmission
+ * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
+ * causing N packets to be sent, and the error callback to be called for
+ * the rest.
*/
-void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
+static __rte_always_inline uint16_t
+rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
+{
+ buffer->pkts[buffer->length++] = tx_pkt;
+ if (buffer->length < buffer->size)
+ return 0;
+
+ return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
+}
#ifdef __cplusplus
}
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v5 4/4] ethdev: rename function parameter for consistency
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 " Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 3/4] ethdev: reorder inline functions Ferruh Yigit
@ 2018-01-21 23:35 ` Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Ferruh Yigit
3 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-21 23:35 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Update "port" function argument variable to "port_id" in public
header to be consistent in all APIs.
No functional change.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index d097e528d..ccf4a15f2 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1158,7 +1158,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* The callback function is called on RX with a burst of packets that have
* been received on the given port and queue.
*
- * @param port
+ * @param port_id
* The Ethernet port on which RX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to receive the packets.
@@ -1174,7 +1174,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* @return
* The number of packets returned to the user.
*/
-typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
void *user_param);
@@ -1184,7 +1184,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* The callback function is called on TX with a burst of packets immediately
* before the packets are put onto the hardware queue for transmission.
*
- * @param port
+ * @param port_id
* The Ethernet port on which TX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to transmit the packets.
@@ -1198,7 +1198,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* @return
* The number of packets to be written to the NIC.
*/
-typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
/**
@@ -2571,7 +2571,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* Add a MAC address to an internal array of addresses used to enable whitelist
* filtering to accept packets only if the destination MAC address matches.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* The MAC address to add.
@@ -2579,20 +2579,20 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
* not enabled, this should be set to 0.
* @return
- * - (0) if successfully added or *mac_addr" was already added.
+ * - (0) if successfully added or *mac_addr* was already added.
* - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port* is invalid.
* - (-EIO) if device is removed.
* - (-ENOSPC) if no more MAC addresses can be added.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr,
uint32_t pool);
/**
* Remove a MAC address from the internal array of addresses.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* MAC address to remove.
@@ -2602,12 +2602,12 @@ int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
* - (-ENODEV) if *port* invalid.
* - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr);
/**
* Set the default MAC address.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* New default MAC address.
@@ -2617,13 +2617,13 @@ int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
+int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
struct ether_addr *mac_addr);
/**
* Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to update.
@@ -2636,14 +2636,14 @@ int rte_eth_dev_default_mac_addr_set(uint16_t port,
* - (-EINVAL) if bad parameter.
* - (-EIO) if device is removed.
*/
-int rte_eth_dev_rss_reta_update(uint16_t port,
+int rte_eth_dev_rss_reta_update(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
/**
* Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to query.
@@ -2656,7 +2656,7 @@ int rte_eth_dev_rss_reta_update(uint16_t port,
* - (-EINVAL) if bad parameter.
* - (-EIO) if device is removed.
*/
-int rte_eth_dev_rss_reta_query(uint16_t port,
+int rte_eth_dev_rss_reta_query(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
@@ -2665,7 +2665,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* MAC address, and the packet is routed to all VFs for which the RX mode is
* accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param addr
* Unicast MAC address.
@@ -2679,7 +2679,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* - (-EIO) if device is removed.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr,
uint8_t on);
/**
@@ -2687,7 +2687,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* Ethernet MAC addresses,the packet is routed to all VFs for which the RX
* mode is accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param on
* 1 - Set all unicast hash bitmaps for receiving all the Ethernet
@@ -2700,7 +2700,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* - (-EIO) if device is removed.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on);
/**
* Set a traffic mirroring rule on an Ethernet device
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 " Ferruh Yigit
` (2 preceding siblings ...)
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
@ 2018-01-22 0:16 ` Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 2/4] ethdev: separate internal structures into own header Ferruh Yigit
` (3 more replies)
3 siblings, 4 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-22 0:16 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.
There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.
More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: use SPDX header
v3: rebased on next-net
v4: rebased on next-net
v5: rebased on next-net
v6: rebased on next-net
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/avf/avf_ethdev.c | 2 +-
drivers/net/avf/avf_rxtx.c | 2 +-
drivers/net/avf/avf_rxtx_vec_common.h | 2 +-
drivers/net/avf/avf_rxtx_vec_sse.c | 2 +-
drivers/net/avf/avf_vchnl.c | 2 +-
drivers/net/avp/avp_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
drivers/net/bonding/rte_eth_bond_private.h | 2 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 2 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa/rte_pmd_dpaa.h | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 2 +-
drivers/net/e1000/igb_flow.c | 2 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 2 +-
drivers/net/enic/enic_clsf.c | 2 +-
drivers/net/enic/enic_ethdev.c | 2 +-
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/failsafe/failsafe.c | 2 +-
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 2 +-
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 2 +-
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/rte_pmd_i40e.h | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 2 +-
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +-
drivers/net/kni/rte_eth_kni.c | 2 +-
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 2 +-
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/mlx5.c | 2 +-
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_defs.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
| 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mrvl/mrvl_ethdev.c | 2 +-
drivers/net/nfp/nfp_net.c | 2 +-
drivers/net/null/rte_eth_null.c | 2 +-
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 2 +-
drivers/net/qede/qede_ethdev.h | 2 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 2 +-
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 2 +-
drivers/net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 2 +-
drivers/net/tap/rte_eth_tap.c | 2 +-
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.c | 1 +
lib/librte_ether/rte_ethdev.h | 112 +-------------------
lib/librte_ether/rte_ethdev_driver.h | 132 ++++++++++++++++++++++++
lib/librte_ether/rte_ethdev_pci.h | 2 +-
lib/librte_ether/rte_ethdev_vdev.h | 2 +-
157 files changed, 291 insertions(+), 261 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_driver.h
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 4c2854f09..ba33566c7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_bus.h>
diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h
index da3749044..15bf73a40 100644
--- a/drivers/bus/dpaa/include/fman.h
+++ b/drivers/bus/dpaa/include/fman.h
@@ -11,7 +11,7 @@
#include <stdbool.h>
#include <net/if.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <compat.h>
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 8fe08f64e..e9acd3588 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -14,7 +14,7 @@
#include <rte_malloc.h>
#include <rte_devargs.h>
#include <rte_memcpy.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_fslmc.h>
#include <fslmc_vfio.h>
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 9f28fa0bf..1241295be 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -22,7 +22,7 @@
#include <eal_filesystem.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index ffad0f536..139249c07 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -19,7 +19,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
index f0edaf414..fb28e4970 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 537141d07..eefde1552 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -24,7 +24,7 @@
#include<sys/eventfd.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 1d3e3612e..84ecd1b86 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -26,7 +26,7 @@
#include <rte_memory.h>
#include <rte_pci.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fslmc_vfio.h>
diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
index c949b2db2..f2377b983 100644
--- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
+++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
@@ -18,7 +18,7 @@
#include <rte_cycles.h>
#include <rte_kvargs.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <fslmc_logs.h>
#include <rte_fslmc.h>
diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
index 748ae5fa5..edac6d4f6 100644
--- a/drivers/event/octeontx/ssovf_evdev.c
+++ b/drivers/event/octeontx/ssovf_evdev.c
@@ -8,7 +8,7 @@
#include <rte_debug.h>
#include <rte_dev.h>
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <rte_kvargs.h>
#include <rte_lcore.h>
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 51770d412..afda2c290 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -14,7 +14,7 @@
#include <errno.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index d51540898..ac58ad6b2 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -37,7 +37,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h
index 3a54a4c91..146787112 100644
--- a/drivers/net/ark/ark_ethdev_rx.h
+++ b/drivers/net/ark/ark_ethdev_rx.h
@@ -38,7 +38,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
int eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
diff --git a/drivers/net/ark/ark_ethdev_tx.h b/drivers/net/ark/ark_ethdev_tx.h
index 8aaafc22e..657f895a4 100644
--- a/drivers/net/ark/ark_ethdev_tx.h
+++ b/drivers/net/ark/ark_ethdev_tx.h
@@ -36,7 +36,7 @@
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
uint16_t eth_ark_xmit_pkts_noop(void *vtxq,
diff --git a/drivers/net/ark/ark_ext.h b/drivers/net/ark/ark_ext.h
index d26c8198b..031cfddc3 100644
--- a/drivers/net/ark/ark_ext.h
+++ b/drivers/net/ark/ark_ext.h
@@ -34,7 +34,7 @@
#ifndef _ARK_EXT_H_
#define _ARK_EXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* This is the template file for users who which to define a dynamic
diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h
index aef2cf73b..41eb260e6 100644
--- a/drivers/net/ark/ark_global.h
+++ b/drivers/net/ark/ark_global.h
@@ -38,7 +38,7 @@
#include <assert.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 202a1d9be..2cadaab80 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -36,7 +36,7 @@
#include <locale.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktchkr.h"
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index 018f37b69..d3c3dee1e 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -38,7 +38,7 @@
#include <rte_eal.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ark_pktgen.h"
diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index b36d31705..cf7bbb2e7 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -19,7 +19,7 @@
#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/avf/avf_rxtx.c b/drivers/net/avf/avf_rxtx.c
index e0c45839e..d276d9752 100644
--- a/drivers/net/avf/avf_rxtx.c
+++ b/drivers/net/avf/avf_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/avf/avf_rxtx_vec_common.h b/drivers/net/avf/avf_rxtx_vec_common.h
index 56a23a732..8057b9682 100644
--- a/drivers/net/avf/avf_rxtx_vec_common.h
+++ b/drivers/net/avf/avf_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _AVF_RXTX_VEC_COMMON_H_
#define _AVF_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "avf.h"
diff --git a/drivers/net/avf/avf_rxtx_vec_sse.c b/drivers/net/avf/avf_rxtx_vec_sse.c
index 8f389f311..8275100f3 100644
--- a/drivers/net/avf/avf_rxtx_vec_sse.c
+++ b/drivers/net/avf/avf_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/avf_prototype.h"
diff --git a/drivers/net/avf/avf_vchnl.c b/drivers/net/avf/avf_vchnl.c
index cc347e6ea..fa71014e1 100644
--- a/drivers/net/avf/avf_vchnl.c
+++ b/drivers/net/avf/avf_vchnl.c
@@ -16,7 +16,7 @@
#include <rte_atomic.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_dev.h>
#include "avf_log.h"
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index deb6f355d..e4ad7b00a 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -36,7 +36,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h
index 967d6dc50..37cac1589 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.h
+++ b/drivers/net/bnx2x/bnx2x_ethdev.h
@@ -33,7 +33,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_eal.h>
#include <rte_mempool.h>
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 7e3d7aefd..cf0b1d27c 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -40,7 +40,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
#include <rte_lcore.h>
#include <rte_spinlock.h>
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 89b63978f..057786a62 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
diff --git a/drivers/net/bnxt/bnxt_stats.h b/drivers/net/bnxt/bnxt_stats.h
index 51d16f5d3..c1c83d57b 100644
--- a/drivers/net/bnxt/bnxt_stats.h
+++ b/drivers/net/bnxt/bnxt_stats.h
@@ -34,7 +34,7 @@
#ifndef _BNXT_STATS_H_
#define _BNXT_STATS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
void bnxt_free_stats(struct bnxt *bp);
int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index e86e670dc..595208997 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -36,7 +36,7 @@
#include <unistd.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h
index f881d30d6..cd7227ac2 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.h
+++ b/drivers/net/bnxt/rte_pmd_bnxt.h
@@ -34,7 +34,7 @@
#ifndef _PMD_BNXT_H_
#define _PMD_BNXT_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/*
* Response sent back to the caller after callback
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 534a890bf..03b73be03 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_bus_vdev.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 10c1920ae..158f3aa1d 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -6,7 +6,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_tcp.h>
#include <rte_udp.h>
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index e2b717f72..92e15f8cc 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -5,7 +5,7 @@
#ifndef _RTE_ETH_BOND_PRIVATE_H_
#define _RTE_ETH_BOND_PRIVATE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_bitmap.h>
diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 282e2e625..56f38c838 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -44,7 +44,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index dc153c731..5cd260f48 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 5b828c237..28db6c061 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -55,7 +55,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index fc10d9585..3d5aa596f 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -56,7 +56,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 88524a2f0..bf5eb96ed 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -28,7 +28,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h
index 3c9162bf6..92aec253c 100644
--- a/drivers/net/dpaa/dpaa_ethdev.h
+++ b/drivers/net/dpaa/dpaa_ethdev.h
@@ -9,7 +9,7 @@
/* System headers */
#include <stdbool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_event_eth_rx_adapter.h>
#include <fsl_usd.h>
diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 1976fe5fc..ab2335270 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_ring.h>
#include <rte_ip.h>
diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
index 9614be84e..2b03d52d4 100644
--- a/drivers/net/dpaa/rte_pmd_dpaa.h
+++ b/drivers/net/dpaa/rte_pmd_dpaa.h
@@ -15,7 +15,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @warning
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index f7a8d9f26..b93376de4 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index a0a3d5264..09a11d65a 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 2f750ad20..3d4566988 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -9,7 +9,7 @@
#include <net/if.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index dcffb0797..07ee25f84 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index a010b3ab8..02fae100c 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 077e09400..53b8ffa45 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index b560f16a2..d98bdc844 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memory.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index 3258f3b5b..b9f2e5391 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -16,7 +16,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index a2abc759f..2f3716724 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -31,7 +31,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 5419e61f3..83e0ae2c9 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -32,7 +32,7 @@
*/
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_tcp.h>
#include <rte_atomic.h>
diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index d52e5e475..3ef1d0832 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -5,7 +5,7 @@
#include <libgen.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_hash.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index ad7a4e306..e1ff9dcbd 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -9,7 +9,7 @@
#include <rte_dev.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c
index 9a2bb8ebd..28923b0e2 100644
--- a/drivers/net/enic/enic_flow.c
+++ b/drivers/net/enic/enic_flow.c
@@ -4,7 +4,7 @@
#include <errno.h>
#include <rte_log.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow_driver.h>
#include <rte_ether.h>
#include <rte_ip.h>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 9bbe054b3..9274defd9 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -16,7 +16,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "enic_compat.h"
#include "enic.h"
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index c8ded867d..c99d61837 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -4,7 +4,7 @@
*/
#include "enic_compat.h"
-#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "wq_enet_desc.h"
#include "rq_enet_desc.h"
#include "cq_enet_desc.h"
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index e2002e136..98902caa0 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -4,7 +4,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include "enic_compat.h"
diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index b76735261..cb274eb76 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -33,7 +33,7 @@
#include <rte_alarm.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_devargs.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 42aaf9107..946ac98f9 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -36,7 +36,7 @@
#include <rte_debug.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_flow.h>
#include <rte_cycles.h>
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index 491636537..7754248ff 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -38,7 +38,7 @@
#include <rte_atomic.h>
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_devargs.h>
#define FAILSAFE_DRIVER_NAME "Fail-safe PMD"
diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c
index 0ebf06a6f..165449411 100644
--- a/drivers/net/failsafe/failsafe_rxtx.c
+++ b/drivers/net/failsafe/failsafe_rxtx.c
@@ -34,7 +34,7 @@
#include <rte_atomic.h>
#include <rte_debug.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "failsafe_private.h"
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index cf8cc6a6e..340f6040f 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2013-2016 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 65956db08..9320748c4 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_net.h>
#include "fm10k.h"
diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c
index 630ca49b9..498a17815 100644
--- a/drivers/net/fm10k/fm10k_rxtx_vec.c
+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c
@@ -4,7 +4,7 @@
#include <inttypes.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "fm10k.h"
#include "base/fm10k_type.h"
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5ea9f9917..c4df65df0 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -16,7 +16,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0cca0d324..6ac3f8c04 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_dev.h>
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index f43cf4aa4..a4320b1b5 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index cd9a9b64b..a74fa08ab 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -11,7 +11,7 @@
#include <stdarg.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_eth_ctrl.h>
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index e19917715..dd3962d38 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -14,7 +14,7 @@
#include <rte_string_fns.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index f16944e40..1217e5a61 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -17,7 +17,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tcp.h>
#include <rte_sctp.h>
#include <rte_udp.h>
diff --git a/drivers/net/i40e/i40e_rxtx_vec_altivec.c b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
index 5e4e472a3..f3fc82672 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_altivec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_altivec.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index ea6e7715c..dbcb61f38 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -32,7 +32,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index e3faaefd9..3ffedcb9e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _I40E_RXTX_VEC_COMMON_H_
#define _I40E_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "i40e_ethdev.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_neon.c b/drivers/net/i40e/i40e_rxtx_vec_neon.c
index b5685e2b9..e549d1e8c 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_neon.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_neon.c
@@ -33,7 +33,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 1df306122..3b22588c5 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "base/i40e_prototype.h"
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index cfdcae7e5..d248adb1a 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -14,7 +14,7 @@
*
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Response sent back to i40e driver from user app after callback
diff --git a/drivers/net/ixgbe/ixgbe_bypass.c b/drivers/net/ixgbe/ixgbe_bypass.c
index 62a550653..ae38ce355 100644
--- a/drivers/net/ixgbe/ixgbe_bypass.c
+++ b/drivers/net/ixgbe/ixgbe_bypass.c
@@ -4,7 +4,7 @@
#include <time.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_bypass_api.h"
#include "rte_pmd_ixgbe.h"
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4f4334df2..58217680c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -26,7 +26,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 236ab8c95..d5e51797c 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -13,7 +13,7 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_logs.h"
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 0e486c38a..dcbfb38b3 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -25,7 +25,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_dev.h>
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index 6619c5658..01164734b 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ip.h>
#include <rte_jhash.h>
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index f81dc314d..ea9973711 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -15,7 +15,7 @@
#include <rte_debug.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 4b382477e..eeff91b0d 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -62,7 +62,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_udp.h>
#include <rte_tcp.h>
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
index df580f39b..414840a2b 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_common.h
@@ -5,7 +5,7 @@
#ifndef _IXGBE_RXTX_VEC_COMMON_H_
#define _IXGBE_RXTX_VEC_COMMON_H_
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "ixgbe_ethdev.h"
#include "ixgbe_rxtx.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
index b2a2774da..e0f9998f0 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
index 0131b06d2..c9ba48246 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
@@ -3,7 +3,7 @@
*/
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index 001a8647e..d8ca8ca31 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -2,7 +2,7 @@
* Copyright(c) 2010-2017 Intel Corporation
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "base/ixgbe_api.h"
#include "ixgbe_ethdev.h"
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index 463a78e50..11a9f334b 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -11,7 +11,7 @@
#ifndef _PMD_IXGBE_H_
#define _PMD_IXGBE_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Notify VF when PF link status changes.
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index a1df4c6a9..dc4e65f5d 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -6,7 +6,7 @@
#include <pthread.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kni.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/liquidio/base/lio_23xx_vf.c b/drivers/net/liquidio/base/lio_23xx_vf.c
index 2a5d4f12f..ddbc8c0e0 100644
--- a/drivers/net/liquidio/base/lio_23xx_vf.c
+++ b/drivers/net/liquidio/base/lio_23xx_vf.c
@@ -4,7 +4,7 @@
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/base/lio_mbox.c b/drivers/net/liquidio/base/lio_mbox.c
index 3c6379341..112900151 100644
--- a/drivers/net/liquidio/base/lio_mbox.c
+++ b/drivers/net/liquidio/base/lio_mbox.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include "lio_logs.h"
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 8f6ef6381..843d02338 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index 5d447706a..8d705bfe7 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -2,7 +2,7 @@
* Copyright(c) 2017 Cavium, Inc
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 703513e79..2a721e7e2 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -57,7 +57,7 @@
#include <rte_common.h>
#include <rte_dev.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 2ab298894..30a544f9a 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_interrupts.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 5318b5637..ca5fadc72 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -63,7 +63,7 @@
#include <rte_bus_pci.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_pci.h>
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 96a6a6fa7..fb84060db 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -57,7 +57,7 @@
#include <rte_byteorder.h>
#include <rte_errno.h>
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index b10c4f552..cd46f860d 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -47,7 +47,7 @@
#endif
#include <rte_eth_ctrl.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_byteorder.h>
diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c
index 9becee4a8..2ff72188a 100644
--- a/drivers/net/mlx4/mlx4_intr.c
+++ b/drivers/net/mlx4/mlx4_intr.c
@@ -52,7 +52,7 @@
#include <rte_alarm.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_io.h>
#include <rte_interrupts.h>
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index 98ab1d266..163598765 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -55,7 +55,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h
index 900cab372..6a9fd28a5 100644
--- a/drivers/net/mlx4/mlx4_rxtx.h
+++ b/drivers/net/mlx4/mlx4_rxtx.h
@@ -47,7 +47,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c
index 7664c3e1a..2bd4b9cb6 100644
--- a/drivers/net/mlx4/mlx4_txq.c
+++ b/drivers/net/mlx4/mlx4_txq.c
@@ -54,7 +54,7 @@
#include <rte_common.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_mempool.h>
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index abf026173..9d1de366b 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -51,7 +51,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 259448001..eb0894fa5 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -53,7 +53,7 @@
#include <rte_pci.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_spinlock.h>
#include <rte_interrupts.h>
#include <rte_errno.h>
diff --git a/drivers/net/mlx5/mlx5_defs.h b/drivers/net/mlx5/mlx5_defs.h
index 64bb0712e..a71db281d 100644
--- a/drivers/net/mlx5/mlx5_defs.h
+++ b/drivers/net/mlx5/mlx5_defs.h
@@ -34,7 +34,7 @@
#ifndef RTE_PMD_MLX5_DEFS_H_
#define RTE_PMD_MLX5_DEFS_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5_autoconf.h"
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 9226f1a5b..6624888c9 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -55,7 +55,7 @@
#include <sys/un.h>
#include <rte_atomic.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_bus_pci.h>
#include <rte_mbuf.h>
#include <rte_common.h>
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 4396ea852..13b6483ba 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -44,7 +44,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 9fb5ba5e7..a5e78ec8d 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -52,7 +52,7 @@
#endif
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5.h"
--git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index f47bda667..9e12b51fe 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -48,7 +48,7 @@
#endif
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_defs.h"
diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c
index 6fb245ba1..897695855 100644
--- a/drivers/net/mlx5/mlx5_rxmode.c
+++ b/drivers/net/mlx5/mlx5_rxmode.c
@@ -45,7 +45,7 @@
#pragma GCC diagnostic error "-Wpedantic"
#endif
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "mlx5.h"
#include "mlx5_rxtx.h"
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 950472754..8e4fbbf2a 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -52,7 +52,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_interrupts.h>
#include <rte_debug.h>
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 4cb6136fc..36234b870 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -34,7 +34,7 @@
#include <linux/sockios.h>
#include <linux/ethtool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include <rte_malloc.h>
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 6f5c799b5..61fa2604f 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_interrupts.h>
#include <rte_alarm.h>
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 26db15a4f..49018303e 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -51,7 +51,7 @@
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 9443e4f03..d51dbe941 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -36,7 +36,7 @@
#include <assert.h>
#include <stdint.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_common.h>
#include "mlx5_utils.h"
diff --git a/drivers/net/mrvl/mrvl_ethdev.c b/drivers/net/mrvl/mrvl_ethdev.c
index 16a964b1f..c327ff27e 100644
--- a/drivers/net/mrvl/mrvl_ethdev.c
+++ b/drivers/net/mrvl/mrvl_ethdev.c
@@ -32,7 +32,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_log.h>
#include <rte_malloc.h>
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index d14f2442b..004469923 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -43,7 +43,7 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_debug.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ether.h>
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 726a5c5e4..7cd5c7163 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -32,7 +32,7 @@
*/
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h
index 637b92cf4..10e42e142 100644
--- a/drivers/net/octeontx/octeontx_ethdev.h
+++ b/drivers/net/octeontx/octeontx_ethdev.h
@@ -8,7 +8,7 @@
#include <stdbool.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eventdev.h>
#include <rte_mempool.h>
#include <rte_memory.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_rxtx.c
index 2445fae48..2502d90e9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.c
+++ b/drivers/net/octeontx/octeontx_rxtx.c
@@ -9,7 +9,7 @@
#include <rte_atomic.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index e8eed169a..fe3e5ccd9 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -5,7 +5,7 @@
#ifndef __OCTEONTX_RXTX_H__
#define __OCTEONTX_RXTX_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#ifndef __hot
#define __hot __attribute__((hot))
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index debb0cec2..c1571e1fe 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -11,7 +11,7 @@
#include <pcap.h>
#include <rte_cycles.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_kvargs.h>
#include <rte_malloc.h>
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 7cddbe66b..cb9597390 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -13,7 +13,7 @@
#include <sys/queue.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_dev.h>
#include <rte_ip.h>
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 48091f459..df13c44be 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -4,7 +4,7 @@
#include "rte_eth_ring.h"
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index 3a4f66d60..75575349b 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -14,7 +14,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_kvargs.h>
#include <rte_spinlock.h>
#include <rte_atomic.h>
diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index 8bfb549e3..be725dcbd 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -11,7 +11,7 @@
#define _SFC_DP_RX_H
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_dp_tx.h b/drivers/net/sfc/sfc_dp_tx.h
index 75d72feb4..0c1aad908 100644
--- a/drivers/net/sfc/sfc_dp_tx.h
+++ b/drivers/net/sfc/sfc_dp_tx.h
@@ -10,7 +10,7 @@
#ifndef _SFC_DP_TX_H
#define _SFC_DP_TX_H
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "sfc_dp.h"
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index a86cff6b1..89a452907 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -8,7 +8,7 @@
*/
#include <rte_dev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
diff --git a/drivers/net/sfc/sfc_ev.h b/drivers/net/sfc/sfc_ev.h
index da2b5c6ef..872f79b91 100644
--- a/drivers/net/sfc/sfc_ev.h
+++ b/drivers/net/sfc/sfc_ev.h
@@ -10,7 +10,7 @@
#ifndef _SFC_EV_H_
#define _SFC_EV_H_
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 11ab892ee..93cdf8f4c 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -9,7 +9,7 @@
#include <rte_tailq.h>
#include <rte_common.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_eth_ctrl.h>
#include <rte_ether.h>
#include <rte_flow.h>
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 8c0fa7125..6706ee6fc 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -12,7 +12,7 @@
#include <rte_mbuf.h>
#include <rte_mempool.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/sfc/sfc_tx.h b/drivers/net/sfc/sfc_tx.h
index e3c5d517a..c2e5f13e9 100644
--- a/drivers/net/sfc/sfc_tx.h
+++ b/drivers/net/sfc/sfc_tx.h
@@ -11,7 +11,7 @@
#define _SFC_TX_H
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include "efx.h"
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 5c5464c8d..b0c134152 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -6,7 +6,7 @@
#include <stdlib.h>
#include <string.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index 3a1282347..050e3e7e1 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -9,7 +9,7 @@
#include <rte_mbuf.h>
#include <rte_sched.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_tm_driver.h>
#include "rte_eth_softnic.h"
diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 45aebed33..e53c738db 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -44,7 +44,7 @@
#include <libsze2.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 2eb873406..fd425726a 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -7,7 +7,7 @@
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index 73c201b93..d4f1e6c55 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -41,7 +41,7 @@
#include <linux/if_tun.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#ifdef IFF_MULTI_QUEUE
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index c42ba30a4..d34938c64 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -24,7 +24,7 @@
#include <rte_dev.h>
#include <rte_eal.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_interrupts.h>
#include <rte_log.h>
diff --git a/drivers/net/thunderx/nicvf_ethdev.h b/drivers/net/thunderx/nicvf_ethdev.h
index da30a9f3c..ea8dccd19 100644
--- a/drivers/net/thunderx/nicvf_ethdev.h
+++ b/drivers/net/thunderx/nicvf_ethdev.h
@@ -5,7 +5,7 @@
#ifndef __THUNDERX_NICVF_ETHDEV_H__
#define __THUNDERX_NICVF_ETHDEV_H__
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define THUNDERX_NICVF_PMD_VERSION "2.0"
#define THUNDERX_REG_BYTES 8
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index aa278afee..72305d9d2 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -13,7 +13,7 @@
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_errno.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ether.h>
#include <rte_log.h>
#include <rte_mbuf.h>
diff --git a/drivers/net/thunderx/nicvf_rxtx.h b/drivers/net/thunderx/nicvf_rxtx.h
index ae6355361..8bdd582ed 100644
--- a/drivers/net/thunderx/nicvf_rxtx.h
+++ b/drivers/net/thunderx/nicvf_rxtx.h
@@ -6,7 +6,7 @@
#define __THUNDERX_NICVF_RXTX_H__
#include <rte_byteorder.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#define NICVF_TX_OFFLOAD_MASK (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)
diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h
index 6d0a6b245..d4a83c372 100644
--- a/drivers/net/thunderx/nicvf_struct.h
+++ b/drivers/net/thunderx/nicvf_struct.h
@@ -11,7 +11,7 @@
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_memory.h>
struct nicvf_rbdr {
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 014428580..4e541e3d8 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -35,7 +35,7 @@
#include <stdbool.h>
#include <rte_mbuf.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_vdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 17ac04931..65cb71fa6 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -8,7 +8,7 @@
#include <errno.h>
#include <unistd.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 9d810a599..a28ba8339 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -9,7 +9,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
struct virtqueue;
struct virtnet_ctl;
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 80e996d06..854af399e 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index 98a9da5d8..7247a0822 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -15,7 +15,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_neon.c b/drivers/net/virtio/virtio_rxtx_simple_neon.c
index b73867ac7..d6207d7bb 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_neon.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_neon.c
@@ -12,7 +12,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/virtio/virtio_rxtx_simple_sse.c b/drivers/net/virtio/virtio_rxtx_simple_sse.c
index 6378b12af..d768d0757 100644
--- a/drivers/net/virtio/virtio_rxtx_simple_sse.c
+++ b/drivers/net/virtio/virtio_rxtx_simple_sse.c
@@ -14,7 +14,7 @@
#include <rte_branch_prediction.h>
#include <rte_cycles.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_errno.h>
#include <rte_memory.h>
#include <rte_mempool.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index d3b704b40..a2fb93cc9 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -27,7 +27,7 @@
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_ethdev_pci.h>
#include <rte_string_fns.h>
#include <rte_malloc.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index abea641ef..3a8c62fc1 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -32,7 +32,7 @@
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
#include <rte_prefetch.h>
#include <rte_ip.h>
#include <rte_udp.h>
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index ea8cf941a..48d84f445 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -27,6 +27,7 @@ SRCS-y += ethdev_profile.c
# Export include files
#
SYMLINK-y-include += rte_ethdev.h
+SYMLINK-y-include += rte_ethdev_driver.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 8debd7e98..f285ba278 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -38,6 +38,7 @@
#include "rte_ether.h"
#include "rte_ethdev.h"
+#include "rte_ethdev_driver.h"
#include "ethdev_profile.h"
static const char *MZ_RTE_ETH_DEV_DATA = "rte_eth_dev_data";
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index d170358b7..07019ab7a 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -17,10 +17,10 @@
* to get its MAC address, the speed and the status of its physical link,
* to receive and to transmit packets, and so on.
*
- * - The driver-oriented Ethernet API that exports a function allowing
- * an Ethernet Poll Mode Driver (PMD) to simultaneously register itself as
- * an Ethernet device driver and as a PCI driver for a set of matching PCI
- * [Ethernet] devices classes.
+ * - The driver-oriented Ethernet API that exports functions allowing
+ * an Ethernet Poll Mode Driver (PMD) to allocate an Ethernet device instance,
+ * create memzone for HW rings and process registered callbacks, and so on.
+ * PMDs should include rte_ethdev_driver.h instead of this header.
*
* By default, all the functions of the Ethernet Device API exported by a PMD
* are lock-free functions which assume to not be invoked in parallel on
@@ -1846,53 +1846,6 @@ uint16_t rte_eth_find_next(uint16_t port_id);
*/
uint16_t rte_eth_dev_count(void);
-/**
- * @internal
- * Returns a ethdev slot specified by the unique identifier name.
- *
- * @param name
- * The pointer to the Unique identifier name for each Ethernet device
- * @return
- * - The pointer to the ethdev slot, on success. NULL on error
- */
-struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
-
-/**
- * @internal
- * Allocates a new ethdev slot for an ethernet device and returns the pointer
- * to that slot for the driver to use.
- *
- * @param name Unique identifier name for each Ethernet device
- * @param type Device type of this Ethernet device
- * @return
- * - Slot in the rte_dev_devices array for a new device;
- */
-struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
-
-/**
- * @internal
- * Attach to the ethdev already initialized by the primary
- * process.
- *
- * @param name Ethernet device's name.
- * @return
- * - Success: Slot in the rte_dev_devices array for attached
- * device.
- * - Error: Null pointer.
- */
-struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
-
-/**
- * @internal
- * Release the specified ethdev port.
- *
- * @param eth_dev
- * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
- * @return
- * - 0 on success, negative on error
- */
-int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
-
/**
* Attach a new Ethernet device specified by arguments.
*
@@ -1996,19 +1949,6 @@ const char *rte_eth_dev_tx_offload_name(uint64_t offload);
int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
-/**
- * @internal
- * Release device queues and clear its configuration to force the user
- * application to reconfigure it. It is for internal use only.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- *
- * @return
- * void
- */
-void _rte_eth_dev_reset(struct rte_eth_dev *dev);
-
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice.
@@ -3619,26 +3559,6 @@ int rte_eth_dev_callback_unregister(uint16_t port_id,
enum rte_eth_event_type event,
rte_eth_dev_cb_fn cb_fn, void *cb_arg);
-/**
- * @internal Executes all the user application registered callbacks for
- * the specific device. It is for DPDK internal user only. User
- * application should not call it directly.
- *
- * @param dev
- * Pointer to struct rte_eth_dev.
- * @param event
- * Eth device interrupt event type.
- * @param ret_param
- * To pass data back to user application.
- * This allows the user application to decide if a particular function
- * is permitted or not.
- *
- * @return
- * int
- */
-int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
- enum rte_eth_event_type event, void *ret_param);
-
/**
* 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
@@ -4540,30 +4460,6 @@ int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
*/
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
-/**
- * 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);
-
/**
* Config l2 tunnel ether type of an Ethernet device for filtering specific
* tunnel packets by ether type.
diff --git a/lib/librte_ether/rte_ethdev_driver.h b/lib/librte_ether/rte_ethdev_driver.h
new file mode 100644
index 000000000..45f08c65e
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_driver.h
@@ -0,0 +1,132 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
+ */
+
+#ifndef _RTE_ETHDEV_DRIVER_H_
+#define _RTE_ETHDEV_DRIVER_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device PMD API
+ *
+ * These APIs for the use from Ethernet drivers, user applications shouldn't
+ * use them.
+ *
+ */
+
+#include <rte_ethdev.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @internal
+ * Returns a ethdev slot specified by the unique identifier name.
+ *
+ * @param name
+ * The pointer to the Unique identifier name for each Ethernet device
+ * @return
+ * - The pointer to the ethdev slot, on success. NULL on error
+ */
+struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+
+/**
+ * @internal
+ * Allocates a new ethdev slot for an ethernet device and returns the pointer
+ * to that slot for the driver to use.
+ *
+ * @param name Unique identifier name for each Ethernet device
+ * @param type Device type of this Ethernet device
+ * @return
+ * - Slot in the rte_dev_devices array for a new device;
+ */
+struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
+
+/**
+ * @internal
+ * Attach to the ethdev already initialized by the primary
+ * process.
+ *
+ * @param name Ethernet device's name.
+ * @return
+ * - Success: Slot in the rte_dev_devices array for attached
+ * device.
+ * - Error: Null pointer.
+ */
+struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
+
+/**
+ * @internal
+ * Release the specified ethdev port.
+ *
+ * @param eth_dev
+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
+ * @return
+ * - 0 on success, negative on error
+ */
+int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
+
+/**
+ * @internal
+ * Release device queues and clear its configuration to force the user
+ * application to reconfigure it. It is for internal use only.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ *
+ * @return
+ * void
+ */
+void _rte_eth_dev_reset(struct rte_eth_dev *dev);
+
+/**
+ * @internal Executes all the user application registered callbacks for
+ * the specific device. It is for DPDK internal user only. User
+ * application should not call it directly.
+ *
+ * @param dev
+ * Pointer to struct rte_eth_dev.
+ * @param event
+ * Eth device interrupt event type.
+ * @param ret_param
+ * To pass data back to user application.
+ * This allows the user application to decide if a particular function
+ * is permitted or not.
+ *
+ * @return
+ * int
+ */
+int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
+ enum rte_eth_event_type event, void *ret_param);
+
+/**
+ * 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
+
+#endif /* _RTE_ETHDEV_DRIVER_H_ */
diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h
index ad64a169c..897ce5b41 100644
--- a/lib/librte_ether/rte_ethdev_pci.h
+++ b/lib/librte_ether/rte_ethdev_pci.h
@@ -38,7 +38,7 @@
#include <rte_pci.h>
#include <rte_bus_pci.h>
#include <rte_config.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* Copy pci device info to the Ethernet device data.
diff --git a/lib/librte_ether/rte_ethdev_vdev.h b/lib/librte_ether/rte_ethdev_vdev.h
index feb5a3eb0..259feda3f 100644
--- a/lib/librte_ether/rte_ethdev_vdev.h
+++ b/lib/librte_ether/rte_ethdev_vdev.h
@@ -37,7 +37,7 @@
#include <rte_config.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
-#include <rte_ethdev.h>
+#include <rte_ethdev_driver.h>
/**
* @internal
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v6 2/4] ethdev: separate internal structures into own header
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Ferruh Yigit
@ 2018-01-22 0:16 ` Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 3/4] ethdev: reorder inline functions Ferruh Yigit
` (2 subsequent siblings)
3 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-22 0:16 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
rte_ethdev_core.h created. Internal data structures are moved here.
These structures are mostly intended to be used by drivers, but they
need to be in the public header file because of the inline functions
in the ethdev.h header, and those inline functions are preferred to
kept because of the performance concerns.
The accessibility of the data structures are not changed, only logically
grouped to show that they are not intended to be used by applications.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_ether/Makefile | 1 +
lib/librte_ether/rte_ethdev.h | 584 +----------------------------------
lib/librte_ether/rte_ethdev_core.h | 607 +++++++++++++++++++++++++++++++++++++
3 files changed, 609 insertions(+), 583 deletions(-)
create mode 100644 lib/librte_ether/rte_ethdev_core.h
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 48d84f445..34d014e71 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -28,6 +28,7 @@ SRCS-y += ethdev_profile.c
#
SYMLINK-y-include += rte_ethdev.h
SYMLINK-y-include += rte_ethdev_driver.h
+SYMLINK-y-include += rte_ethdev_core.h
SYMLINK-y-include += rte_ethdev_pci.h
SYMLINK-y-include += rte_ethdev_vdev.h
SYMLINK-y-include += rte_eth_ctrl.h
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 07019ab7a..1e40d62c4 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1153,483 +1153,6 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
/**< l2 tunnel forwarding mask */
#define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
-/*
- * Definitions of all functions exported by an Ethernet driver through the
- * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
- * structure associated with an Ethernet device.
- */
-
-typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
-/**< @internal Ethernet device configuration. */
-
-typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to start a configured Ethernet device. */
-
-typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to stop a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link up a configured Ethernet device. */
-
-typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to link down a configured Ethernet device. */
-
-typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to close a configured Ethernet device. */
-
-typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
-/** <@internal Function used to reset a configured Ethernet device. */
-
-typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to detect an Ethernet device removal. */
-
-typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
-
-typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
-
-typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
-
-typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
- int wait_to_complete);
-/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
-
-typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_stats *igb_stats);
-/**< @internal Get global I/O statistics of an Ethernet device. */
-
-typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
-
-typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat *stats, unsigned n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
- const uint64_t *ids,
- uint64_t *values,
- unsigned int n);
-/**< @internal Get extended stats of an Ethernet device. */
-
-typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
-/**< @internal Reset extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, unsigned size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
- struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
- unsigned int size);
-/**< @internal Get names of extended stats of an Ethernet device. */
-
-typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
- uint16_t queue_id,
- uint8_t stat_idx,
- uint8_t is_rx);
-/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
-
-typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_dev_info *dev_info);
-/**< @internal Get specific informations of an Ethernet device. */
-
-typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
-/**< @internal Get supported ptypes of an Ethernet device. */
-
-typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Start rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
- uint16_t queue_id);
-/**< @internal Stop rx and tx of a queue of an Ethernet device. */
-
-typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- uint16_t nb_rx_desc,
- unsigned int socket_id,
- const struct rte_eth_rxconf *rx_conf,
- struct rte_mempool *mb_pool);
-/**< @internal Set up a receive queue of an Ethernet device. */
-
-typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
- uint16_t tx_queue_id,
- uint16_t nb_tx_desc,
- unsigned int socket_id,
- 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. */
-
-typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id);
-/**< @internal Get number of used descriptors on a receive queue. */
-
-typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
-/**< @internal Check DD bit of specific RX descriptor */
-
-typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
-/**< @internal Check the status of a Rx descriptor */
-
-typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
-/**< @internal Check the status of a Tx descriptor */
-
-typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
- char *fw_version, size_t fw_size);
-/**< @internal Get firmware information of an Ethernet device. */
-
-typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
-/**< @internal Force mbufs to be from TX ring. */
-
-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. */
-
-typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
-
-typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
- enum rte_vlan_type type, uint16_t tpid);
-/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
-
-typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
-/**< @internal set VLAN offload function by an Ethernet device. */
-
-typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
- uint16_t vlan_id,
- int on);
-/**< @internal set port based TX VLAN insertion by an Ethernet device. */
-
-typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
- uint16_t rx_queue_id,
- int on);
-/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
-
-typedef uint16_t (*eth_rx_burst_t)(void *rxq,
- struct rte_mbuf **rx_pkts,
- uint16_t nb_pkts);
-/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_burst_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Send output packets on a transmit queue of an Ethernet device. */
-
-typedef uint16_t (*eth_tx_prep_t)(void *txq,
- struct rte_mbuf **tx_pkts,
- uint16_t nb_pkts);
-/**< @internal Prepare output packets on a transmit queue of 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 */
-
-typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_fc_conf *fc_conf);
-/**< @internal Setup flow control parameter on an Ethernet device */
-
-typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_pfc_conf *pfc_conf);
-/**< @internal Setup priority flow control parameter on an Ethernet device */
-
-typedef int (*reta_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Update RSS redirection table on an Ethernet device */
-
-typedef int (*reta_query_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
-/**< @internal Query RSS redirection table on an Ethernet device */
-
-typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Update RSS hash configuration of an Ethernet device */
-
-typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
- struct rte_eth_rss_conf *rss_conf);
-/**< @internal Get current RSS hash configuration of an Ethernet device */
-
-typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
-/**< @internal Turn on SW controllable LED on an Ethernet device */
-
-typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
-/**< @internal Turn off SW controllable LED on an Ethernet device */
-
-typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
-/**< @internal Remove MAC address from receive address register */
-
-typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint32_t index,
- uint32_t vmdq);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr);
-/**< @internal Set a MAC address into Receive Address Address Register */
-
-typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
- uint8_t on);
-/**< @internal Set a Unicast Hash bitmap */
-
-typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
- uint8_t on);
-/**< @internal Set all Unicast Hash bitmap */
-
-typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
- uint16_t queue_idx,
- uint16_t tx_rate);
-/**< @internal Set queue TX rate */
-
-typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
-/**< @internal Add a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
- uint8_t rule_id);
-/**< @internal Remove a traffic mirroring rule on an Ethernet device */
-
-typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Add tunneling UDP port */
-
-typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
- struct rte_eth_udp_tunnel *tunnel_udp);
-/**< @internal Delete tunneling UDP port */
-
-typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
-/**< @internal set the list of multicast addresses on an Ethernet device */
-
-typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
-/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
-
-typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
- struct timespec *timestamp,
- uint32_t flags);
-/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
-
-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_t)(struct rte_eth_dev *dev,
- struct rte_dev_reg_info *info);
-/**< @internal Retrieve registers */
-
-typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
-/**< @internal Retrieve eeprom size */
-
-typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Retrieve eeprom data */
-
-typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
- struct rte_dev_eeprom_info *info);
-/**< @internal Program eeprom data */
-
-typedef int (*eth_l2_tunnel_eth_type_conf_t)
- (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
-/**< @internal config l2 tunnel ether type */
-
-typedef int (*eth_l2_tunnel_offload_set_t)
- (struct rte_eth_dev *dev,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**< @internal enable/disable the l2 tunnel offload functions */
-
-
-typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
- enum rte_filter_type filter_type,
- enum rte_filter_op filter_op,
- void *arg);
-/**< @internal Take operations to assigned filter type on an Ethernet device */
-
-typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
-
-typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
-/**< @internal Get Trafffic Metering and Policing (MTR) operations */
-
-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.
- */
-struct eth_dev_ops {
- eth_dev_configure_t dev_configure; /**< Configure device. */
- eth_dev_start_t dev_start; /**< Start device. */
- eth_dev_stop_t dev_stop; /**< Stop device. */
- eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
- eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
- eth_dev_close_t dev_close; /**< Close device. */
- eth_dev_reset_t dev_reset; /**< Reset device. */
- eth_link_update_t link_update; /**< Get device link state. */
- eth_is_removed_t is_removed;
- /**< Check if the device was physically removed. */
-
- eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
- eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
- eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
- eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
- eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
- eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
- eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
- eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
- mtu_set_t mtu_set; /**< Set MTU. */
-
- eth_stats_get_t stats_get; /**< Get generic device statistics. */
- eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
- eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
- eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
- eth_xstats_get_names_t xstats_get_names;
- /**< Get names of extended statistics. */
- eth_queue_stats_mapping_set_t queue_stats_mapping_set;
- /**< Configure per queue stat counter mapping. */
-
- eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
- eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
- eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
- eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
- eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
- /**< Get packet types supported and identified by device. */
-
- vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
- vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
- vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
- vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
- vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
-
- eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
- eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
- eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
- eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
- eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
- eth_queue_release_t rx_queue_release; /**< Release RX queue. */
- eth_rx_queue_count_t rx_queue_count;
- /**< Get the number of used RX descriptors. */
- eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
- eth_rx_descriptor_status_t rx_descriptor_status;
- /**< Check the status of a Rx descriptor. */
- eth_tx_descriptor_status_t tx_descriptor_status;
- /**< Check the status of a Tx descriptor. */
- eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
- eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
- eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
- eth_queue_release_t tx_queue_release; /**< Release TX queue. */
- eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
-
- eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
- eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
-
- flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
- flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
- priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
-
- eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
- eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
-
- eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
- eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
-
- eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
- eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
- eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
- /** Config ether type of l2 tunnel. */
- eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
- /** Enable/disable l2 tunnel offload functions. */
-
- eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
-
- rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
- rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
- reta_update_t reta_update; /** Update redirection table. */
- reta_query_t reta_query; /** Query redirection table. */
-
- eth_get_reg_t get_reg; /**< Get registers. */
- eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
- eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
- eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
-
-
- eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
-
- eth_get_dcb_info get_dcb_info; /** Get DCB information. */
-
- eth_timesync_enable_t timesync_enable;
- /** Turn IEEE1588/802.1AS timestamping on. */
- eth_timesync_disable_t timesync_disable;
- /** Turn IEEE1588/802.1AS timestamping off. */
- eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
- /** Read the IEEE1588/802.1AS RX timestamp. */
- eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
- /** Read the IEEE1588/802.1AS TX timestamp. */
- eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
- eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
- eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
-
- eth_xstats_get_by_id_t xstats_get_by_id;
- /**< Get extended device statistic values by ID. */
- eth_xstats_get_names_by_id_t xstats_get_names_by_id;
- /**< Get name of extended device statistics by ID. */
-
- eth_tm_ops_get_t tm_ops_get;
- /**< Get Traffic Management (TM) operations. */
-
- eth_mtr_ops_get_t mtr_ops_get;
- /**< Get Traffic Metering and Policing (MTR) operations. */
-
- eth_pool_ops_supported_t pool_ops_supported;
- /**< Test if a port supports specific mempool ops */
-};
-
/**
* Function type used for RX packet processing packet callbacks.
*
@@ -1679,20 +1202,6 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
-/**
- * @internal
- * Structure used to hold information about the callbacks to be called for a
- * queue on RX and TX.
- */
-struct rte_eth_rxtx_callback {
- struct rte_eth_rxtx_callback *next;
- union{
- rte_rx_callback_fn rx;
- rte_tx_callback_fn tx;
- } fn;
- void *param;
-};
-
/**
* A set of values to describe the possible states of an eth device.
*/
@@ -1703,40 +1212,6 @@ enum rte_eth_dev_state {
RTE_ETH_DEV_REMOVED,
};
-/**
- * @internal
- * The generic data structure associated with each ethernet device.
- *
- * Pointers to burst-oriented packet receive and transmit functions are
- * located at the beginning of the structure, along with the pointer to
- * where all the data elements for the particular device are stored in shared
- * memory. This split allows the function pointer and driver data to be per-
- * process, while the actual configuration data for the device is shared.
- */
-struct rte_eth_dev {
- eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
- eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
- eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
- struct rte_eth_dev_data *data; /**< Pointer to device data */
- const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
- struct rte_device *device; /**< Backing device */
- struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
- /** User application callbacks for NIC interrupts */
- struct rte_eth_dev_cb_list link_intr_cbs;
- /**
- * User-supplied functions called from rx_burst to post-process
- * received packets before passing them to the user
- */
- struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- /**
- * User-supplied functions called from tx_burst to pre-process
- * received packets before passing them to the driver for transmission.
- */
- struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
- enum rte_eth_dev_state state; /**< Flag indicating the port state */
- void *security_ctx; /**< Context for security ops */
-} __rte_cache_aligned;
-
struct rte_eth_dev_sriov {
uint8_t active; /**< SRIOV is active with 16, 32 or 64 pools */
uint8_t nb_q_per_pool; /**< rx queue number per pool */
@@ -1747,57 +1222,7 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-/**
- * @internal
- * The data part, with no function pointers, associated with each ethernet device.
- *
- * This structure is safe to place in shared memory to be common among different
- * processes in a multi-process configuration.
- */
-struct rte_eth_dev_data {
- char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
-
- void **rx_queues; /**< Array of pointers to RX queues. */
- void **tx_queues; /**< Array of pointers to TX queues. */
- uint16_t nb_rx_queues; /**< Number of RX queues. */
- uint16_t nb_tx_queues; /**< Number of TX queues. */
-
- struct rte_eth_dev_sriov sriov; /**< SRIOV data */
-
- void *dev_private; /**< PMD-specific private data */
-
- struct rte_eth_link dev_link;
- /**< Link-level information & status */
-
- struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
- uint16_t mtu; /**< Maximum Transmission Unit. */
-
- uint32_t min_rx_buf_size;
- /**< Common rx buffer size handled by all queues */
-
- uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
- struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
- uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
- /** bitmap array of associating Ethernet MAC addresses to pools */
- struct ether_addr* hash_mac_addrs;
- /** Device Ethernet MAC addresses of hash filtering. */
- uint16_t port_id; /**< Device [external] port identifier. */
- __extension__
- uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
- scattered_rx : 1, /**< RX of scattered packets 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). */
- lro : 1; /**< RX LRO is ON(1) / OFF(0) */
- uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
- /** Queues state: STARTED(1) / STOPPED(0) */
- uint32_t dev_flags; /**< Capabilities */
- enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
- int numa_node; /**< NUMA node connection */
- struct rte_vlan_filter_conf vlan_filter_conf;
- /**< VLAN filter configuration. */
-};
+#include <rte_ethdev_core.h>
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
@@ -1806,13 +1231,6 @@ struct rte_eth_dev_data {
/** Device supports device removal interrupt */
#define RTE_ETH_DEV_INTR_RMV 0x0008
-/**
- * @internal
- * The pool of *rte_eth_dev* structures. The size of the pool
- * is configured at compile-time in the <rte_ethdev.c> file.
- */
-extern struct rte_eth_dev rte_eth_devices[];
-
/**
* Iterates over valid ethdev ports.
*
diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h
new file mode 100644
index 000000000..f44b40e1e
--- /dev/null
+++ b/lib/librte_ether/rte_ethdev_core.h
@@ -0,0 +1,607 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
+ */
+
+#ifndef _RTE_ETHDEV_CORE_H_
+#define _RTE_ETHDEV_CORE_H_
+
+/**
+ * @file
+ *
+ * RTE Ethernet Device internal header.
+ *
+ * This header contains internal data types. But they are still part of the
+ * public API because they are used by inline functions in the published API.
+ *
+ * Applications should not use these directly.
+ *
+ */
+
+/*
+ * Definitions of all functions exported by an Ethernet driver through the
+ * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
+ * structure associated with an Ethernet device.
+ */
+struct rte_eth_dev;
+
+typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
+/**< @internal Ethernet device configuration. */
+
+typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to start a configured Ethernet device. */
+
+typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to stop a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link up a configured Ethernet device. */
+
+typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to link down a configured Ethernet device. */
+
+typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to close a configured Ethernet device. */
+
+typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
+/** <@internal Function used to reset a configured Ethernet device. */
+
+typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to detect an Ethernet device removal. */
+
+typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable the RX promiscuous mode of an Ethernet device. */
+
+typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Enable the receipt of all multicast packets by an Ethernet device. */
+
+typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Disable the receipt of all multicast packets by an Ethernet device. */
+
+typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
+ int wait_to_complete);
+/**< @internal Get link speed, duplex mode and state (up/down) of an Ethernet device. */
+
+typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_stats *igb_stats);
+/**< @internal Get global I/O statistics of an Ethernet device. */
+
+typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset global I/O statistics of an Ethernet device to 0. */
+
+typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat *stats, unsigned n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
+ const uint64_t *ids,
+ uint64_t *values,
+ unsigned int n);
+/**< @internal Get extended stats of an Ethernet device. */
+
+typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
+/**< @internal Reset extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, unsigned size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
+ struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
+ unsigned int size);
+/**< @internal Get names of extended stats of an Ethernet device. */
+
+typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id,
+ uint8_t stat_idx,
+ uint8_t is_rx);
+/**< @internal Set a queue statistics mapping for a tx/rx queue of an Ethernet device. */
+
+typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_dev_info *dev_info);
+/**< @internal Get specific informations of an Ethernet device. */
+
+typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
+/**< @internal Get supported ptypes of an Ethernet device. */
+
+typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Start rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
+ uint16_t queue_id);
+/**< @internal Stop rx and tx of a queue of an Ethernet device. */
+
+typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ uint16_t nb_rx_desc,
+ unsigned int socket_id,
+ const struct rte_eth_rxconf *rx_conf,
+ struct rte_mempool *mb_pool);
+/**< @internal Set up a receive queue of an Ethernet device. */
+
+typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
+ uint16_t tx_queue_id,
+ uint16_t nb_tx_desc,
+ unsigned int socket_id,
+ 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. */
+
+typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id);
+/**< @internal Get number of used descriptors on a receive queue. */
+
+typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
+/**< @internal Check DD bit of specific RX descriptor */
+
+typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
+/**< @internal Check the status of a Rx descriptor */
+
+typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
+/**< @internal Check the status of a Tx descriptor */
+
+typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
+ char *fw_version, size_t fw_size);
+/**< @internal Get firmware information of an Ethernet device. */
+
+typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
+/**< @internal Force mbufs to be from TX ring. */
+
+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. */
+
+typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal filtering of a VLAN Tag Identifier by an Ethernet device. */
+
+typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
+ enum rte_vlan_type type, uint16_t tpid);
+/**< @internal set the outer/inner VLAN-TPID by an Ethernet device. */
+
+typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
+/**< @internal set VLAN offload function by an Ethernet device. */
+
+typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
+ uint16_t vlan_id,
+ int on);
+/**< @internal set port based TX VLAN insertion by an Ethernet device. */
+
+typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
+ uint16_t rx_queue_id,
+ int on);
+/**< @internal VLAN stripping enable/disable by an queue of Ethernet device. */
+
+typedef uint16_t (*eth_rx_burst_t)(void *rxq,
+ struct rte_mbuf **rx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Retrieve input packets from a receive queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_burst_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Send output packets on a transmit queue of an Ethernet device. */
+
+typedef uint16_t (*eth_tx_prep_t)(void *txq,
+ struct rte_mbuf **tx_pkts,
+ uint16_t nb_pkts);
+/**< @internal Prepare output packets on a transmit queue of 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 */
+
+typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_fc_conf *fc_conf);
+/**< @internal Setup flow control parameter on an Ethernet device */
+
+typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_pfc_conf *pfc_conf);
+/**< @internal Setup priority flow control parameter on an Ethernet device */
+
+typedef int (*reta_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Update RSS redirection table on an Ethernet device */
+
+typedef int (*reta_query_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+/**< @internal Query RSS redirection table on an Ethernet device */
+
+typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Update RSS hash configuration of an Ethernet device */
+
+typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
+ struct rte_eth_rss_conf *rss_conf);
+/**< @internal Get current RSS hash configuration of an Ethernet device */
+
+typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
+/**< @internal Turn on SW controllable LED on an Ethernet device */
+
+typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
+/**< @internal Turn off SW controllable LED on an Ethernet device */
+
+typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
+/**< @internal Remove MAC address from receive address register */
+
+typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint32_t index,
+ uint32_t vmdq);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr);
+/**< @internal Set a MAC address into Receive Address Address Register */
+
+typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mac_addr,
+ uint8_t on);
+/**< @internal Set a Unicast Hash bitmap */
+
+typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
+ uint8_t on);
+/**< @internal Set all Unicast Hash bitmap */
+
+typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
+ uint16_t queue_idx,
+ uint16_t tx_rate);
+/**< @internal Set queue TX rate */
+
+typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
+/**< @internal Add a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
+ uint8_t rule_id);
+/**< @internal Remove a traffic mirroring rule on an Ethernet device */
+
+typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Add tunneling UDP port */
+
+typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
+ struct rte_eth_udp_tunnel *tunnel_udp);
+/**< @internal Delete tunneling UDP port */
+
+typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
+/**< @internal set the list of multicast addresses on an Ethernet device */
+
+typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to enable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
+/**< @internal Function used to disable IEEE1588/802.1AS timestamping. */
+
+typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
+ struct timespec *timestamp,
+ uint32_t flags);
+/**< @internal Function used to read an RX IEEE1588/802.1AS timestamp. */
+
+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_t)(struct rte_eth_dev *dev,
+ struct rte_dev_reg_info *info);
+/**< @internal Retrieve registers */
+
+typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
+/**< @internal Retrieve eeprom size */
+
+typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Retrieve eeprom data */
+
+typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Program eeprom data */
+
+typedef int (*eth_l2_tunnel_eth_type_conf_t)
+ (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
+/**< @internal config l2 tunnel ether type */
+
+typedef int (*eth_l2_tunnel_offload_set_t)
+ (struct rte_eth_dev *dev,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
+/**< @internal enable/disable the l2 tunnel offload functions */
+
+
+typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
+ enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op,
+ void *arg);
+/**< @internal Take operations to assigned filter type on an Ethernet device */
+
+typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Traffic Management (TM) operations on an Ethernet device */
+
+typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Trafffic Metering and Policing (MTR) operations */
+
+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.
+ */
+struct eth_dev_ops {
+ eth_dev_configure_t dev_configure; /**< Configure device. */
+ eth_dev_start_t dev_start; /**< Start device. */
+ eth_dev_stop_t dev_stop; /**< Stop device. */
+ eth_dev_set_link_up_t dev_set_link_up; /**< Device link up. */
+ eth_dev_set_link_down_t dev_set_link_down; /**< Device link down. */
+ eth_dev_close_t dev_close; /**< Close device. */
+ eth_dev_reset_t dev_reset; /**< Reset device. */
+ eth_link_update_t link_update; /**< Get device link state. */
+ eth_is_removed_t is_removed;
+ /**< Check if the device was physically removed. */
+
+ eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON. */
+ eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF. */
+ eth_allmulticast_enable_t allmulticast_enable;/**< RX multicast ON. */
+ eth_allmulticast_disable_t allmulticast_disable;/**< RX multicast OFF. */
+ eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address. */
+ eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address. */
+ eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address. */
+ eth_set_mc_addr_list_t set_mc_addr_list; /**< set list of mcast addrs. */
+ mtu_set_t mtu_set; /**< Set MTU. */
+
+ eth_stats_get_t stats_get; /**< Get generic device statistics. */
+ eth_stats_reset_t stats_reset; /**< Reset generic device statistics. */
+ eth_xstats_get_t xstats_get; /**< Get extended device statistics. */
+ eth_xstats_reset_t xstats_reset; /**< Reset extended device statistics. */
+ eth_xstats_get_names_t xstats_get_names;
+ /**< Get names of extended statistics. */
+ eth_queue_stats_mapping_set_t queue_stats_mapping_set;
+ /**< Configure per queue stat counter mapping. */
+
+ eth_dev_infos_get_t dev_infos_get; /**< Get device info. */
+ eth_rxq_info_get_t rxq_info_get; /**< retrieve RX queue information. */
+ eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */
+ eth_fw_version_get_t fw_version_get; /**< Get firmware version. */
+ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
+ /**< Get packet types supported and identified by device. */
+
+ vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */
+ vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */
+ vlan_strip_queue_set_t vlan_strip_queue_set; /**< VLAN Stripping on queue. */
+ vlan_offload_set_t vlan_offload_set; /**< Set VLAN Offload. */
+ vlan_pvid_set_t vlan_pvid_set; /**< Set port based TX VLAN insertion. */
+
+ eth_queue_start_t rx_queue_start;/**< Start RX for a queue. */
+ eth_queue_stop_t rx_queue_stop; /**< Stop RX for a queue. */
+ eth_queue_start_t tx_queue_start;/**< Start TX for a queue. */
+ eth_queue_stop_t tx_queue_stop; /**< Stop TX for a queue. */
+ eth_rx_queue_setup_t rx_queue_setup;/**< Set up device RX queue. */
+ eth_queue_release_t rx_queue_release; /**< Release RX queue. */
+ eth_rx_queue_count_t rx_queue_count;
+ /**< Get the number of used RX descriptors. */
+ eth_rx_descriptor_done_t rx_descriptor_done; /**< Check rxd DD bit. */
+ eth_rx_descriptor_status_t rx_descriptor_status;
+ /**< Check the status of a Rx descriptor. */
+ eth_tx_descriptor_status_t tx_descriptor_status;
+ /**< Check the status of a Tx descriptor. */
+ eth_rx_enable_intr_t rx_queue_intr_enable; /**< Enable Rx queue interrupt. */
+ eth_rx_disable_intr_t rx_queue_intr_disable; /**< Disable Rx queue interrupt. */
+ eth_tx_queue_setup_t tx_queue_setup;/**< Set up device TX queue. */
+ eth_queue_release_t tx_queue_release; /**< Release TX queue. */
+ eth_tx_done_cleanup_t tx_done_cleanup;/**< Free tx ring mbufs */
+
+ eth_dev_led_on_t dev_led_on; /**< Turn on LED. */
+ eth_dev_led_off_t dev_led_off; /**< Turn off LED. */
+
+ flow_ctrl_get_t flow_ctrl_get; /**< Get flow control. */
+ flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control. */
+ priority_flow_ctrl_set_t priority_flow_ctrl_set; /**< Setup priority flow control. */
+
+ eth_uc_hash_table_set_t uc_hash_table_set; /**< Set Unicast Table Array. */
+ eth_uc_all_hash_table_set_t uc_all_hash_table_set; /**< Set Unicast hash bitmap. */
+
+ eth_mirror_rule_set_t mirror_rule_set; /**< Add a traffic mirror rule. */
+ eth_mirror_rule_reset_t mirror_rule_reset; /**< reset a traffic mirror rule. */
+
+ eth_udp_tunnel_port_add_t udp_tunnel_port_add; /** Add UDP tunnel port. */
+ eth_udp_tunnel_port_del_t udp_tunnel_port_del; /** Del UDP tunnel port. */
+ eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
+ /** Config ether type of l2 tunnel. */
+ eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
+ /** Enable/disable l2 tunnel offload functions. */
+
+ eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */
+
+ rss_hash_update_t rss_hash_update; /** Configure RSS hash protocols. */
+ rss_hash_conf_get_t rss_hash_conf_get; /** Get current RSS hash configuration. */
+ reta_update_t reta_update; /** Update redirection table. */
+ reta_query_t reta_query; /** Query redirection table. */
+
+ eth_get_reg_t get_reg; /**< Get registers. */
+ eth_get_eeprom_length_t get_eeprom_length; /**< Get eeprom length. */
+ eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
+ eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
+
+
+ eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
+
+ eth_get_dcb_info get_dcb_info; /** Get DCB information. */
+
+ eth_timesync_enable_t timesync_enable;
+ /** Turn IEEE1588/802.1AS timestamping on. */
+ eth_timesync_disable_t timesync_disable;
+ /** Turn IEEE1588/802.1AS timestamping off. */
+ eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
+ /** Read the IEEE1588/802.1AS RX timestamp. */
+ eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
+ /** Read the IEEE1588/802.1AS TX timestamp. */
+ eth_timesync_adjust_time timesync_adjust_time; /** Adjust the device clock. */
+ eth_timesync_read_time timesync_read_time; /** Get the device clock time. */
+ eth_timesync_write_time timesync_write_time; /** Set the device clock time. */
+
+ eth_xstats_get_by_id_t xstats_get_by_id;
+ /**< Get extended device statistic values by ID. */
+ eth_xstats_get_names_by_id_t xstats_get_names_by_id;
+ /**< Get name of extended device statistics by ID. */
+
+ eth_tm_ops_get_t tm_ops_get;
+ /**< Get Traffic Management (TM) operations. */
+
+ eth_mtr_ops_get_t mtr_ops_get;
+ /**< Get Traffic Metering and Policing (MTR) operations. */
+
+ eth_pool_ops_supported_t pool_ops_supported;
+ /**< Test if a port supports specific mempool ops */
+};
+
+/**
+ * @internal
+ * Structure used to hold information about the callbacks to be called for a
+ * queue on RX and TX.
+ */
+struct rte_eth_rxtx_callback {
+ struct rte_eth_rxtx_callback *next;
+ union{
+ rte_rx_callback_fn rx;
+ rte_tx_callback_fn tx;
+ } fn;
+ void *param;
+};
+
+/**
+ * @internal
+ * The generic data structure associated with each ethernet device.
+ *
+ * Pointers to burst-oriented packet receive and transmit functions are
+ * located at the beginning of the structure, along with the pointer to
+ * where all the data elements for the particular device are stored in shared
+ * memory. This split allows the function pointer and driver data to be per-
+ * process, while the actual configuration data for the device is shared.
+ */
+struct rte_eth_dev {
+ eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
+ eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
+ eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
+ struct rte_eth_dev_data *data; /**< Pointer to device data */
+ const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
+ struct rte_device *device; /**< Backing device */
+ struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
+ /** User application callbacks for NIC interrupts */
+ struct rte_eth_dev_cb_list link_intr_cbs;
+ /**
+ * User-supplied functions called from rx_burst to post-process
+ * received packets before passing them to the user
+ */
+ struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ /**
+ * User-supplied functions called from tx_burst to pre-process
+ * received packets before passing them to the driver for transmission.
+ */
+ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
+ enum rte_eth_dev_state state; /**< Flag indicating the port state */
+ void *security_ctx; /**< Context for security ops */
+} __rte_cache_aligned;
+
+struct rte_eth_dev_sriov;
+
+/**
+ * @internal
+ * The data part, with no function pointers, associated with each ethernet device.
+ *
+ * This structure is safe to place in shared memory to be common among different
+ * processes in a multi-process configuration.
+ */
+struct rte_eth_dev_data {
+ char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
+
+ void **rx_queues; /**< Array of pointers to RX queues. */
+ void **tx_queues; /**< Array of pointers to TX queues. */
+ uint16_t nb_rx_queues; /**< Number of RX queues. */
+ uint16_t nb_tx_queues; /**< Number of TX queues. */
+
+ struct rte_eth_dev_sriov sriov; /**< SRIOV data */
+
+ void *dev_private; /**< PMD-specific private data */
+
+ struct rte_eth_link dev_link;
+ /**< Link-level information & status */
+
+ struct rte_eth_conf dev_conf; /**< Configuration applied to device. */
+ uint16_t mtu; /**< Maximum Transmission Unit. */
+
+ uint32_t min_rx_buf_size;
+ /**< Common rx buffer size handled by all queues */
+
+ uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
+ struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
+ uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
+ /** bitmap array of associating Ethernet MAC addresses to pools */
+ struct ether_addr* hash_mac_addrs;
+ /** Device Ethernet MAC addresses of hash filtering. */
+ uint16_t port_id; /**< Device [external] port identifier. */
+ __extension__
+ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
+ scattered_rx : 1, /**< RX of scattered packets 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). */
+ lro : 1; /**< RX LRO is ON(1) / OFF(0) */
+ uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
+ /** Queues state: STARTED(1) / STOPPED(0) */
+ uint32_t dev_flags; /**< Capabilities */
+ enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */
+ int numa_node; /**< NUMA node connection */
+ struct rte_vlan_filter_conf vlan_filter_conf;
+ /**< VLAN filter configuration. */
+};
+
+/**
+ * @internal
+ * The pool of *rte_eth_dev* structures. The size of the pool
+ * is configured at compile-time in the <rte_ethdev.c> file.
+ */
+extern struct rte_eth_dev rte_eth_devices[];
+
+#endif /* _RTE_ETHDEV_CORE_H_ */
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v6 3/4] ethdev: reorder inline functions
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 2/4] ethdev: separate internal structures into own header Ferruh Yigit
@ 2018-01-22 0:16 ` Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-22 0:51 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Thomas Monjalon
3 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-22 0:16 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Move all inline function to the end of the ethdev.h header file and move
the ethdev_core.h just before inline functions.
Since inline functions need data structures in ethdev_core.h, this
reorder is to group them and make it clear where put further inline
functions.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_ether/rte_ethdev.h | 2769 ++++++++++++++++++++---------------------
1 file changed, 1382 insertions(+), 1387 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 1e40d62c4..d097e528d 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -454,7 +454,6 @@ struct rte_eth_rss_conf {
ETH_RSS_GENEVE | \
ETH_RSS_NVGRE)
-
/**< Mask of valid RSS hash protocols */
#define ETH_RSS_PROTO_MASK ( \
ETH_RSS_IPV4 | \
@@ -1222,8 +1221,6 @@ struct rte_eth_dev_sriov {
#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
-#include <rte_ethdev_core.h>
-
/** Device supports link state interrupt */
#define RTE_ETH_DEV_INTR_LSC 0x0002
/** Device is a bonded slave */
@@ -1249,7 +1246,6 @@ uint16_t rte_eth_find_next(uint16_t port_id);
(unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \
p = rte_eth_find_next(p + 1))
-
/**
* Get the total number of Ethernet devices that have been successfully
* initialized by the matching Ethernet driver during the PCI probing phase
@@ -1573,8 +1569,6 @@ int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id);
*/
int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id);
-
-
/**
* Start an Ethernet device.
*
@@ -1601,7 +1595,6 @@ int rte_eth_dev_start(uint16_t port_id);
*/
void rte_eth_dev_stop(uint16_t port_id);
-
/**
* Link up an Ethernet device.
*
@@ -2193,1818 +2186,1820 @@ int rte_eth_dev_get_vlan_offload(uint16_t port_id);
*/
int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
+typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
+ void *userdata);
+
/**
+ * Structure used to buffer packets for future TX
+ * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ */
+struct rte_eth_dev_tx_buffer {
+ buffer_tx_error_fn error_callback;
+ void *error_userdata;
+ uint16_t size; /**< Size of buffer for buffered tx */
+ uint16_t length; /**< Number of packets in the array */
+ struct rte_mbuf *pkts[];
+ /**< Pending packets to be sent on explicit flush or when full */
+};
+
+/**
+ * Calculate the size of the tx buffer.
*
- * Retrieve a burst of input packets from a receive queue of an Ethernet
- * device. The retrieved packets are stored in *rte_mbuf* structures whose
- * pointers are supplied in the *rx_pkts* array.
- *
- * The rte_eth_rx_burst() function loops, parsing the RX ring of the
- * receive queue, up to *nb_pkts* packets, and for each completed RX
- * descriptor in the ring, it performs the following operations:
+ * @param sz
+ * Number of stored packets.
+ */
+#define RTE_ETH_TX_BUFFER_SIZE(sz) \
+ (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+
+/**
+ * Initialize default values for buffered transmitting
*
- * - Initialize the *rte_mbuf* data structure associated with the
- * RX descriptor according to the information provided by the NIC into
- * that RX descriptor.
+ * @param buffer
+ * Tx buffer to be initialized.
+ * @param size
+ * Buffer size
+ * @return
+ * 0 if no error
+ */
+int
+rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+
+/**
+ * Configure a callback for buffered packets which cannot be sent
*
- * - Store the *rte_mbuf* data structure into the next entry of the
- * *rx_pkts* array.
+ * Register a specific callback to be called when an attempt is made to send
+ * all packets buffered on an ethernet port, but not all packets can
+ * successfully be sent. The callback registered here will be called only
+ * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
+ * The default callback configured for each queue by default just frees the
+ * packets back to the calling mempool. If additional behaviour is required,
+ * for example, to count dropped packets, or to retry transmission of packets
+ * which cannot be sent, this function should be used to register a suitable
+ * callback function to implement the desired behaviour.
+ * The example callback "rte_eth_count_unsent_packet_callback()" is also
+ * provided as reference.
*
- * - Replenish the RX descriptor with a new *rte_mbuf* buffer
- * allocated from the memory pool associated with the receive queue at
- * initialization time.
+ * @param buffer
+ * The port identifier of the Ethernet device.
+ * @param callback
+ * The function to be used as the callback.
+ * @param userdata
+ * Arbitrary parameter to be passed to the callback function
+ * @return
+ * 0 on success, or -1 on error with rte_errno set appropriately
+ */
+int
+rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
+ buffer_tx_error_fn callback, void *userdata);
+
+/**
+ * Callback function for silently dropping unsent buffered packets.
*
- * When retrieving an input packet that was scattered by the controller
- * into multiple receive descriptors, the rte_eth_rx_burst() function
- * appends the associated *rte_mbuf* buffers to the first buffer of the
- * packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets silently and is used by tx buffered
+ * operations as default behavior.
*
- * The rte_eth_rx_burst() function returns the number of packets
- * actually retrieved, which is the number of *rte_mbuf* data structures
- * effectively supplied into the *rx_pkts* array.
- * A return value equal to *nb_pkts* indicates that the RX queue contained
- * at least *rx_pkts* packets, and this is likely to signify that other
- * received packets remain in the input queue. Applications implementing
- * a "retrieve as much received packets as possible" policy can check this
- * specific case and keep invoking the rte_eth_rx_burst() function until
- * a value less than *nb_pkts* is returned.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * This receive method has the following advantages:
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * - It allows a run-to-completion network stack engine to retrieve and
- * to immediately process received packets in a fast burst-oriented
- * approach, avoiding the overhead of unnecessary intermediate packet
- * queue/dequeue operations.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Not used
+ */
+void
+rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Callback function for tracking unsent buffered packets.
*
- * - Conversely, it also allows an asynchronous-oriented processing
- * method to retrieve bursts of received packets and to immediately
- * queue them for further parallel processing by another logical core,
- * for instance. However, instead of having received packets being
- * individually queued by the driver, this approach allows the caller
- * of the rte_eth_rx_burst() function to queue a burst of retrieved
- * packets at a time and therefore dramatically reduce the cost of
- * enqueue/dequeue operations per packet.
+ * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
+ * adjust the default behavior when buffered packets cannot be sent. This
+ * function drops any unsent packets, but also updates a user-supplied counter
+ * to track the overall number of packets dropped. The counter should be an
+ * uint64_t variable.
*
- * - It allows the rte_eth_rx_burst() function of the driver to take
- * advantage of burst-oriented hardware features (CPU cache,
- * prefetch instructions, and so on) to minimize the number of CPU
- * cycles per packet.
+ * NOTE: this function should not be called directly, instead it should be used
+ * as a callback for packet buffering.
*
- * To summarize, the proposed receive API enables many
- * burst-oriented optimizations in both synchronous and asynchronous
- * packet processing environments with no overhead in both cases.
+ * NOTE: when configuring this function as a callback with
+ * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
+ * should point to an uint64_t value.
*
- * The rte_eth_rx_burst() function does not provide any error
- * notification to avoid the corresponding overhead. As a hint, the
- * upper-level application might check the status of the device link once
- * being systematically returned a 0 value for a given number of tries.
+ * @param pkts
+ * The previously buffered packets which could not be sent
+ * @param unsent
+ * The number of unsent packets in the pkts array
+ * @param userdata
+ * Pointer to an uint64_t value, which will be incremented by unsent
+ */
+void
+rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
+ void *userdata);
+
+/**
+ * Request the driver to free mbufs currently cached by the driver. The
+ * driver will only free the mbuf if it is no longer in use. It is the
+ * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
+ * called if needed.
*
* @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
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
* to rte_eth_dev_configure().
- * @param rx_pkts
- * The address of an array of pointers to *rte_mbuf* structures that
- * must be large enough to store *nb_pkts* pointers in it.
- * @param nb_pkts
- * The maximum number of packets to retrieve.
+ * @param free_cnt
+ * Maximum number of packets to free. Use 0 to indicate all possible packets
+ * should be freed. Note that a packet may be using multiple mbufs.
* @return
- * The number of packets actually retrieved, which is the number
- * of pointers to *rte_mbuf* structures effectively supplied to the
- * *rx_pkts* array.
+ * Failure: < 0
+ * -ENODEV: Invalid interface
+ * -EIO: device is removed
+ * -ENOTSUP: Driver does not support function
+ * Success: >= 0
+ * 0-n: Number of packets freed. More packets may still remain in ring that
+ * are in use.
*/
-static inline uint16_t
-rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
-
- if (queue_id >= dev->data->nb_rx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
- int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
- rx_pkts, nb_pkts);
-
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+int
+rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
- if (unlikely(cb != NULL)) {
- do {
- nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
- nb_pkts, cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
+/**
+ * The eth device event type for interrupt, and maybe others in the future.
+ */
+enum rte_eth_event_type {
+ RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
+ RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
+ RTE_ETH_EVENT_QUEUE_STATE,
+ /**< queue state event (enabled/disabled) */
+ RTE_ETH_EVENT_INTR_RESET,
+ /**< reset interrupt event, sent to VF on PF reset */
+ RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
+ RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
+ 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_MAX /**< max value of this enum */
+};
- return nb_rx;
-}
+typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
+ enum rte_eth_event_type event, void *cb_arg, void *ret_param);
+/**< user application callback to be registered for interrupts */
/**
- * Get the number of used descriptors of a rx queue
+ * Register a callback function for port event.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
- * @return
- * The number of used descriptors in the specific queue, or:
- * (-EINVAL) if *port_id* or *queue_id* is invalid
- * (-ENOTSUP) if the device does not support this function
- */
-static inline int
-rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
-{
- struct rte_eth_dev *dev;
-
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
- dev = &rte_eth_devices[port_id];
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
- if (queue_id >= dev->data->nb_rx_queues)
- return -EINVAL;
-
- return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
-}
-
-/**
- * Check if the DD bit of the specific RX descriptor in the queue has been set
+ * Port id.
+ * RTE_ETH_ALL means register the event for all port ids.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue id on the specific port.
- * @param offset
- * The offset of the descriptor ID from tail.
* @return
- * - (1) if the specific DD bit is set.
- * - (0) if the specific DD bit is not set.
- * - (-ENODEV) if *port_id* invalid.
- * - (-ENOTSUP) if the device does not support this function
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
- return (*dev->dev_ops->rx_descriptor_done)( \
- dev->data->rx_queues[queue_id], offset);
-}
-
-#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
-#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
-#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_callback_register(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check the status of a Rx descriptor in the queue
- *
- * It should be called in a similar context than the Rx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
- *
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * Unregister a callback function for port event.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
- * @param queue_id
- * A valid Rx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the next
- * packet to be received by the driver).
+ * Port id.
+ * RTE_ETH_ALL means unregister the event for all port ids.
+ * @param event
+ * Event interested.
+ * @param cb_fn
+ * User supplied callback function to be called.
+ * @param cb_arg
+ * Pointer to the parameters for the registered callback. -1 means to
+ * remove all for the same callback address and same event.
*
* @return
- * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
- * receive a packet.
- * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
- * not yet processed by the driver (i.e. in the receive queue).
- * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
- * the driver and not yet returned to hw, or reserved by the hw.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - On success, zero.
+ * - On failure, a negative value.
*/
-static inline int
-rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
- uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *rxq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_rx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
- rxq = dev->data->rx_queues[queue_id];
-
- return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
-}
-
-#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
-#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
-#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
+int rte_eth_dev_callback_unregister(uint16_t port_id,
+ enum rte_eth_event_type event,
+ rte_eth_dev_cb_fn cb_fn, void *cb_arg);
/**
- * Check the status of a Tx descriptor in the queue.
- *
- * It should be called in a similar context than the Tx function:
- * - on a dataplane core
- * - not concurrently on the same queue
- *
- * Since it's a dataplane function, no check is performed on port_id and
- * queue_id. The caller must therefore ensure that the port is enabled
- * and the queue is configured and running.
+ * 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 packet arrives.
*
- * Note: accessing to a random descriptor in the ring may trigger cache
- * misses and have a performance impact.
+ * The rte_eth_dev_rx_intr_enable() function enables rx queue
+ * interrupt on specific rx queue of a port.
*
* @param port_id
- * A valid port identifier of the Ethernet device which.
+ * The port identifier of the Ethernet device.
* @param queue_id
- * A valid Tx queue identifier on this port.
- * @param offset
- * The offset of the descriptor starting from tail (0 is the place where
- * the next packet will be send).
- *
+ * 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
- * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
- * in the transmit queue.
- * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
- * be reused by the driver.
- * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
- * driver or the hardware.
- * - (-EINVAL) bad descriptor offset.
- * - (-ENOTSUP) if the device does not support this function.
- * - (-ENODEV) bad port or queue (only if compiled with debug).
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
- uint16_t queue_id, uint16_t offset)
-{
- struct rte_eth_dev *dev;
- void *txq;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-#endif
- dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues)
- return -ENODEV;
-#endif
- RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
- txq = dev->data->tx_queues[queue_id];
-
- return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
-}
+int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
/**
- * Send a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_burst() function is invoked to transmit output packets
- * on the output queue *queue_id* of the Ethernet device designated by its
- * *port_id*.
- * The *nb_pkts* parameter is the number of packets to send which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
- * up to the number of transmit descriptors available in the TX ring of the
- * transmit queue.
- * For each packet to send, the rte_eth_tx_burst() function performs
- * the following operations:
- *
- * - Pick up the next available descriptor in the transmit ring.
- *
- * - Free the network buffer previously sent with that descriptor, if any.
- *
- * - Initialize the transmit descriptor with the information provided
- * in the *rte_mbuf data structure.
- *
- * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
- * the rte_eth_tx_burst() function uses several transmit descriptors
- * of the ring.
- *
- * The rte_eth_tx_burst() function returns the number of packets it
- * actually sent. A return value equal to *nb_pkts* means that all packets
- * have been sent, and this is likely to signify that other output packets
- * could be immediately transmitted again. Applications that implement a
- * "send as many packets to transmit as possible" policy can check this
- * specific case and keep invoking the rte_eth_tx_burst() function until
- * a value less than *nb_pkts* is returned.
- *
- * It is the responsibility of the rte_eth_tx_burst() function to
- * transparently free the memory buffers of packets previously sent.
- * This feature is driven by the *tx_free_thresh* value supplied to the
- * rte_eth_dev_configure() function at device configuration time.
- * When the number of free TX descriptors drops below this threshold, the
- * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
- * of those packets whose transmission was effectively completed.
+ * When lcore wakes up from rx interrupt indicating packet coming, disable rx
+ * interrupt and returns to polling mode.
*
- * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
- * invoke this function concurrently on the same tx queue without SW lock.
- * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
+ * 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 transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * 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 tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to transmit.
* @return
- * The number of output packets actually stored in transmit descriptors of
- * the transmit ring. The return value can be less than the value of the
- * *tx_pkts* parameter when the transmit ring is full or has been filled up.
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-static inline uint16_t
-rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
- RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
-
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- return 0;
- }
-#endif
-
-#ifdef RTE_ETHDEV_RXTX_CALLBACKS
- struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
-
- if (unlikely(cb != NULL)) {
- do {
- nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
- cb->param);
- cb = cb->next;
- } while (cb != NULL);
- }
-#endif
-
- return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
-}
+int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
/**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice
- *
- * Process a burst of output packets on a transmit queue of an Ethernet device.
- *
- * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
- * transmitted on the output queue *queue_id* of the Ethernet device designated
- * by its *port_id*.
- * The *nb_pkts* parameter is the number of packets to be prepared which are
- * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
- * allocated from a pool created with rte_pktmbuf_pool_create().
- * For each packet to send, the rte_eth_tx_prepare() function performs
- * the following operations:
- *
- * - Check if packet meets devices requirements for tx offloads.
- *
- * - Check limitations about number of segments.
- *
- * - Check additional requirements when debug is enabled.
- *
- * - Update and/or reset required checksums when tx offload is set for packet.
- *
- * Since this function can modify packet data, provided mbufs must be safely
- * writable (e.g. modified data cannot be in shared segment).
- *
- * The rte_eth_tx_prepare() function returns the number of packets ready to be
- * sent. A return value equal to *nb_pkts* means that all packets are valid and
- * ready to be sent, otherwise stops processing on the first invalid packet and
- * leaves the rest packets untouched.
+ * RX Interrupt control per port.
*
- * When this functionality is not implemented in the driver, all packets are
- * are returned untouched.
+ * @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(uint16_t port_id, int epfd, int op, void *data);
+
+/**
+ * RX Interrupt control per queue.
*
* @param port_id
* The port identifier of the Ethernet device.
- * The value must be a valid port id.
* @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * 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 tx_pkts
- * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
- * which contain the output packets.
- * @param nb_pkts
- * The maximum number of packets to process.
+ * @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
- * The number of packets correct and ready to be sent. The return value can be
- * less than the value of the *tx_pkts* parameter when some packet doesn't
- * meet devices requirements with rte_errno set appropriately:
- * - -EINVAL: offload flags are not correctly set
- * - -ENOTSUP: the offload feature is not supported by the hardware
- *
+ * - On success, zero.
+ * - On failure, a negative value.
*/
+int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
+ int epfd, int op, void *data);
-#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
-
-static inline uint16_t
-rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
- struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- struct rte_eth_dev *dev;
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (!rte_eth_dev_is_valid_port(port_id)) {
- RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- dev = &rte_eth_devices[port_id];
-
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
- if (queue_id >= dev->data->nb_tx_queues) {
- RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
- rte_errno = -EINVAL;
- return 0;
- }
-#endif
-
- if (!dev->tx_pkt_prepare)
- return nb_pkts;
-
- return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
- tx_pkts, nb_pkts);
-}
-
-#else
-
-/*
- * Native NOOP operation for compilation targets which doesn't require any
- * preparations steps, and functional NOOP may introduce unnecessary performance
- * drop.
+/**
+ * Turn on the LED on the Ethernet device.
+ * This function turns on the LED on the Ethernet device.
*
- * Generally this is not a good idea to turn it on globally and didn't should
- * be used if behavior of tx_preparation can change.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-
-static inline uint16_t
-rte_eth_tx_prepare(__rte_unused uint16_t port_id,
- __rte_unused uint16_t queue_id,
- __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
-{
- return nb_pkts;
-}
-
-#endif
-
-typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
- void *userdata);
+int rte_eth_led_on(uint16_t port_id);
/**
- * Structure used to buffer packets for future TX
- * Used by APIs rte_eth_tx_buffer and rte_eth_tx_buffer_flush
+ * Turn off the LED on the Ethernet device.
+ * This function turns off the LED on the Ethernet device.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support
+ * that operation.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-struct rte_eth_dev_tx_buffer {
- buffer_tx_error_fn error_callback;
- void *error_userdata;
- uint16_t size; /**< Size of buffer for buffered tx */
- uint16_t length; /**< Number of packets in the array */
- struct rte_mbuf *pkts[];
- /**< Pending packets to be sent on explicit flush or when full */
-};
+int rte_eth_led_off(uint16_t port_id);
/**
- * Calculate the size of the tx buffer.
+ * Get current status of the Ethernet link flow control for Ethernet device
*
- * @param sz
- * Number of stored packets.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure where to store the flow control parameters.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
*/
-#define RTE_ETH_TX_BUFFER_SIZE(sz) \
- (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
+int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Initialize default values for buffered transmitting
+ * Configure the Ethernet link flow control for Ethernet device
*
- * @param buffer
- * Tx buffer to be initialized.
- * @param size
- * Buffer size
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param fc_conf
+ * The pointer to the structure of the flow control parameters.
* @return
- * 0 if no error
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure or device is removed.
*/
-int
-rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
+int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_fc_conf *fc_conf);
/**
- * Send any packets queued up for transmission on a port and HW queue
- *
- * This causes an explicit flush of packets previously buffered via the
- * rte_eth_tx_buffer() function. It returns the number of packets successfully
- * sent to the NIC, and calls the error callback for any unsent packets. Unless
- * explicitly set up otherwise, the default callback simply frees the unsent
- * packets back to the owning mempool.
+ * Configure the Ethernet priority flow control under DCB environment
+ * for Ethernet device.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer of packets to be transmit.
+ * The port identifier of the Ethernet device.
+ * @param pfc_conf
+ * The pointer to the structure of the priority flow control parameters.
* @return
- * The number of packets successfully sent to the Ethernet device. The error
- * callback is called for any packets which could not be sent.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter
+ * - (-EIO) if flow control setup failure or device is removed.
*/
-static inline uint16_t
-rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer)
-{
- uint16_t sent;
- uint16_t to_send = buffer->length;
-
- if (to_send == 0)
- return 0;
-
- sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
-
- buffer->length = 0;
-
- /* All packets sent, or to be dealt with by callback below */
- if (unlikely(sent != to_send))
- buffer->error_callback(&buffer->pkts[sent], to_send - sent,
- buffer->error_userdata);
-
- return sent;
-}
+int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
+ struct rte_eth_pfc_conf *pfc_conf);
/**
- * Buffer a single packet for future transmission on a port and queue
- *
- * This function takes a single mbuf/packet and buffers it for later
- * transmission on the particular port and queue specified. Once the buffer is
- * full of packets, an attempt will be made to transmit all the buffered
- * packets. In case of error, where not all packets can be transmitted, a
- * callback is called with the unsent packets as a parameter. If no callback
- * is explicitly set up, the unsent packets are just freed back to the owning
- * mempool. The function returns the number of packets actually sent i.e.
- * 0 if no buffer flush occurred, otherwise the number of packets successfully
- * flushed
+ * Add a MAC address to an internal array of addresses used to enable whitelist
+ * filtering to accept packets only if the destination MAC address matches.
*
- * @param port_id
+ * @param port
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param buffer
- * Buffer used to collect packets to be sent.
- * @param tx_pkt
- * Pointer to the packet mbuf to be sent.
+ * @param mac_addr
+ * The MAC address to add.
+ * @param pool
+ * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
+ * not enabled, this should be set to 0.
* @return
- * 0 = packet has been buffered for later transmission
- * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
- * causing N packets to be sent, and the error callback to be called for
- * the rest.
+ * - (0) if successfully added or *mac_addr" was already added.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port* is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOSPC) if no more MAC addresses can be added.
+ * - (-EINVAL) if MAC address is invalid.
*/
-static __rte_always_inline uint16_t
-rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
-{
- buffer->pkts[buffer->length++] = tx_pkt;
- if (buffer->length < buffer->size)
- return 0;
-
- return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
-}
+int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+ uint32_t pool);
/**
- * Configure a callback for buffered packets which cannot be sent
+ * Remove a MAC address from the internal array of addresses.
*
- * Register a specific callback to be called when an attempt is made to send
- * all packets buffered on an ethernet port, but not all packets can
- * successfully be sent. The callback registered here will be called only
- * from calls to rte_eth_tx_buffer() and rte_eth_tx_buffer_flush() APIs.
- * The default callback configured for each queue by default just frees the
- * packets back to the calling mempool. If additional behaviour is required,
- * for example, to count dropped packets, or to retry transmission of packets
- * which cannot be sent, this function should be used to register a suitable
- * callback function to implement the desired behaviour.
- * The example callback "rte_eth_count_unsent_packet_callback()" is also
- * provided as reference.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param mac_addr
+ * MAC address to remove.
+ * @return
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EADDRINUSE) if attempting to remove the default MAC address
+ */
+int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+
+/**
+ * Set the default MAC address.
*
- * @param buffer
+ * @param port
* The port identifier of the Ethernet device.
- * @param callback
- * The function to be used as the callback.
- * @param userdata
- * Arbitrary parameter to be passed to the callback function
+ * @param mac_addr
+ * New default MAC address.
* @return
- * 0 on success, or -1 on error with rte_errno set appropriately
+ * - (0) if successful, or *mac_addr* didn't exist.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port* invalid.
+ * - (-EINVAL) if MAC address is invalid.
*/
-int
-rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
- buffer_tx_error_fn callback, void *userdata);
+int rte_eth_dev_default_mac_addr_set(uint16_t port,
+ struct ether_addr *mac_addr);
/**
- * Callback function for silently dropping unsent buffered packets.
+ * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets silently and is used by tx buffered
- * operations as default behavior.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to update.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
+ * - (-EIO) if device is removed.
+ */
+int rte_eth_dev_rss_reta_update(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+
+ /**
+ * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param reta_conf
+ * RETA to query.
+ * @param reta_size
+ * Redirection table size. The table size can be queried by
+ * rte_eth_dev_info_get().
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
+ * - (-EIO) if device is removed.
+ */
+int rte_eth_dev_rss_reta_query(uint16_t port,
+ struct rte_eth_rss_reta_entry64 *reta_conf,
+ uint16_t reta_size);
+
+ /**
+ * Updates unicast hash table for receiving packet with the given destination
+ * MAC address, and the packet is routed to all VFs for which the RX mode is
+ * accept packets that match the unicast hash table.
*
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param addr
+ * Unicast MAC address.
+ * @param on
+ * 1 - Set an unicast hash bit for receiving packets with the MAC address.
+ * 0 - Clear an unicast hash bit.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if bad parameter.
+ */
+int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+ uint8_t on);
+
+ /**
+ * Updates all unicast hash bitmaps for receiving packet with any Unicast
+ * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
+ * mode is accept packets that match the unicast hash table.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Not used
+ * @param port
+ * The port identifier of the Ethernet device.
+ * @param on
+ * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
+ * MAC addresses
+ * 0 - Clear all unicast hash bitmaps
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if bad parameter.
*/
-void
-rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
/**
- * Callback function for tracking unsent buffered packets.
- *
- * This function can be passed to rte_eth_tx_buffer_set_err_callback() to
- * adjust the default behavior when buffered packets cannot be sent. This
- * function drops any unsent packets, but also updates a user-supplied counter
- * to track the overall number of packets dropped. The counter should be an
- * uint64_t variable.
- *
- * NOTE: this function should not be called directly, instead it should be used
- * as a callback for packet buffering.
+ * Set a traffic mirroring rule on an Ethernet device
*
- * NOTE: when configuring this function as a callback with
- * rte_eth_tx_buffer_set_err_callback(), the final, userdata parameter
- * should point to an uint64_t value.
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param mirror_conf
+ * The pointer to the traffic mirroring structure describing the mirroring rule.
+ * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
+ * destination pool and the value of rule if enable vlan or pool mirroring.
*
- * @param pkts
- * The previously buffered packets which could not be sent
- * @param unsent
- * The number of unsent packets in the pkts array
- * @param userdata
- * Pointer to an uint64_t value, which will be incremented by unsent
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
+ * @param on
+ * 1 - Enable a mirroring rule.
+ * 0 - Disable a mirroring rule.
+ * @return
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if the mr_conf information is not correct.
*/
-void
-rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
- void *userdata);
+int rte_eth_mirror_rule_set(uint16_t port_id,
+ struct rte_eth_mirror_conf *mirror_conf,
+ uint8_t rule_id,
+ uint8_t on);
/**
- * Request the driver to free mbufs currently cached by the driver. The
- * driver will only free the mbuf if it is no longer in use. It is the
- * application's responsibity to ensure rte_eth_tx_buffer_flush(..) is
- * called if needed.
+ * Reset a traffic mirroring rule on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The index of the transmit queue through which output packets must be
- * sent.
- * The value must be in the range [0, nb_tx_queue - 1] previously supplied
- * to rte_eth_dev_configure().
- * @param free_cnt
- * Maximum number of packets to free. Use 0 to indicate all possible packets
- * should be freed. Note that a packet may be using multiple mbufs.
- * @return
- * Failure: < 0
- * -ENODEV: Invalid interface
- * -EIO: device is removed
- * -ENOTSUP: Driver does not support function
- * Success: >= 0
- * 0-n: Number of packets freed. More packets may still remain in ring that
- * are in use.
- */
-int
-rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
-
-/**
- * The eth device event type for interrupt, and maybe others in the future.
- */
-enum rte_eth_event_type {
- RTE_ETH_EVENT_UNKNOWN, /**< unknown event type */
- RTE_ETH_EVENT_INTR_LSC, /**< lsc interrupt event */
- RTE_ETH_EVENT_QUEUE_STATE,
- /**< queue state event (enabled/disabled) */
- RTE_ETH_EVENT_INTR_RESET,
- /**< reset interrupt event, sent to VF on PF reset */
- RTE_ETH_EVENT_VF_MBOX, /**< message from the VF received by PF */
- RTE_ETH_EVENT_MACSEC, /**< MACsec offload related event */
- 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_MAX /**< max value of this enum */
-};
-
-typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
- enum rte_eth_event_type event, void *cb_arg, void *ret_param);
-/**< user application callback to be registered for interrupts */
-
-
-
-/**
- * Register a callback function for port event.
- *
- * @param port_id
- * Port id.
- * RTE_ETH_ALL means register the event for all port ids.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback.
- *
+ * @param rule_id
+ * The index of traffic mirroring rule, we support four separated rules.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_register(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_mirror_rule_reset(uint16_t port_id,
+ uint8_t rule_id);
/**
- * Unregister a callback function for port event.
+ * Set the rate limitation for a queue on an Ethernet device.
*
* @param port_id
- * Port id.
- * RTE_ETH_ALL means unregister the event for all port ids.
- * @param event
- * Event interested.
- * @param cb_fn
- * User supplied callback function to be called.
- * @param cb_arg
- * Pointer to the parameters for the registered callback. -1 means to
- * remove all for the same callback address and same event.
- *
+ * The port identifier of the Ethernet device.
+ * @param queue_idx
+ * The queue id.
+ * @param tx_rate
+ * The tx rate in Mbps. Allocated from the total port link speed.
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EIO) if device is removed.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_callback_unregister(uint16_t port_id,
- enum rte_eth_event_type event,
- rte_eth_dev_cb_fn cb_fn, void *cb_arg);
+int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
+ uint16_t tx_rate);
-/**
- * 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 packet arrives.
- *
- * The rte_eth_dev_rx_intr_enable() function enables rx queue
- * interrupt on specific rx queue of a port.
+ /**
+ * Configuration of Receive Side Scaling hash computation of Ethernet device.
*
* @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 rss_conf
+ * The new configuration to use for RSS hash computation on the port.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
* - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support.
+ * - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
+int rte_eth_dev_rss_hash_update(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * 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.
+ /**
+ * Retrieve current configuration of Receive Side Scaling hash computation
+ * of Ethernet device.
*
* @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 rss_conf
+ * Where to store the current RSS hash configuration of the Ethernet device.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if port identifier is invalid.
* - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support RSS.
*/
-int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
+int
+rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
+ struct rte_eth_rss_conf *rss_conf);
-/**
- * RX Interrupt control per port.
+ /**
+ * Add UDP tunneling port for a specific type of tunnel.
+ * The packets with this UDP port will be identified as this type of tunnel.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to change or add more UDP port for the tunnel. So the offloading function
+ * can take effect on the packets with the specific UDP 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.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
+int
+rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
-/**
- * RX Interrupt control per queue.
+ /**
+ * Delete UDP tunneling port a specific type of tunnel.
+ * The packets with this UDP port will not be identified as this type of tunnel
+ * any more.
+ * Before enabling any offloading function for a tunnel, users can call this API
+ * to delete a UDP port for the tunnel. So the offloading function will not take
+ * effect on the packets with the specific UDP 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().
- * @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.
+ * @param tunnel_udp
+ * UDP tunneling configuration.
+ *
* @return
- * - On success, zero.
- * - On failure, a negative value.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
- int epfd, int op, void *data);
+int
+rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
+ struct rte_eth_udp_tunnel *tunnel_udp);
/**
- * Turn on the LED on the Ethernet device.
- * This function turns on the LED on the Ethernet device.
+ * Check whether the filter type is supported on an Ethernet device.
+ * All the supported filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support this filter type.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
*/
-int rte_eth_led_on(uint16_t port_id);
+int rte_eth_dev_filter_supported(uint16_t port_id,
+ enum rte_filter_type filter_type);
/**
- * Turn off the LED on the Ethernet device.
- * This function turns off the LED on the Ethernet device.
+ * Take operations to assigned filter type on an Ethernet device.
+ * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
*
* @param port_id
* The port identifier of the Ethernet device.
+ * @param filter_type
+ * Filter type.
+ * @param filter_op
+ * Type of operation.
+ * @param arg
+ * A pointer to arguments defined specifically for the operation.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if underlying hardware OR driver doesn't support
- * that operation.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_led_off(uint16_t port_id);
+int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
+ enum rte_filter_op filter_op, void *arg);
/**
- * Get current status of the Ethernet link flow control for Ethernet device
+ * Get DCB information on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure where to store the flow control parameters.
+ * @param dcb_info
+ * dcb information.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support.
*/
-int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+int rte_eth_dev_get_dcb_info(uint16_t port_id,
+ struct rte_eth_dcb_info *dcb_info);
/**
- * Configure the Ethernet link flow control for Ethernet device
+ * Add a callback to be called on packet RX on a given port and queue.
+ *
+ * This API configures a function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param fc_conf
- * The pointer to the structure of the flow control parameters.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure or device is removed.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_fc_conf *fc_conf);
+void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Configure the Ethernet priority flow control under DCB environment
- * for Ethernet device.
+ * Add a callback that must be called first on packet RX on a given port
+ * and queue.
+ *
+ * This API configures a first function to be called for each burst of
+ * packets received on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_rx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param pfc_conf
- * The pointer to the structure of the priority flow control parameters.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support priority flow control mode.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EINVAL) if bad parameter
- * - (-EIO) if flow control setup failure or device is removed.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
- struct rte_eth_pfc_conf *pfc_conf);
+void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_rx_callback_fn fn, void *user_param);
/**
- * Add a MAC address to an internal array of addresses used to enable whitelist
- * filtering to accept packets only if the destination MAC address matches.
+ * Add a callback to be called on packet TX on a given port and queue.
*
- * @param port
+ * This API configures a function to be called for each burst of
+ * packets sent on a given NIC port queue. The return value is a pointer
+ * that can be used to later remove the callback using
+ * rte_eth_remove_tx_callback().
+ *
+ * Multiple functions are called in the order that they are added.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * The MAC address to add.
- * @param pool
- * VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
- * not enabled, this should be set to 0.
+ * @param queue_id
+ * The queue on the Ethernet device on which the callback is to be added.
+ * @param fn
+ * The callback function
+ * @param user_param
+ * A generic pointer parameter which will be passed to each invocation of the
+ * callback function on this port and queue.
+ *
* @return
- * - (0) if successfully added or *mac_addr" was already added.
- * - (-ENOTSUP) if hardware doesn't support this feature.
- * - (-ENODEV) if *port* is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOSPC) if no more MAC addresses can be added.
- * - (-EINVAL) if MAC address is invalid.
+ * NULL on error.
+ * On success, a pointer value which can later be used to remove the callback.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
- uint32_t pool);
+void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+ rte_tx_callback_fn fn, void *user_param);
+
+struct rte_eth_rxtx_callback;
/**
- * Remove a MAC address from the internal array of addresses.
+ * Remove an RX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_rx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * MAC address to remove.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_rx_callback().
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EADDRINUSE) if attempting to remove the default MAC address
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Set the default MAC address.
+ * Remove a TX packet callback from a given port and queue.
*
- * @param port
+ * This function is used to removed callbacks that were added to a NIC port
+ * queue using rte_eth_add_tx_callback().
+ *
+ * Note: the callback is removed from the callback list but it isn't freed
+ * since the it may still be in use. The memory for the callback can be
+ * subsequently freed back by the application by calling rte_free():
+ *
+ * - Immediately - if the port is stopped, or the user knows that no
+ * callbacks are in flight e.g. if called from the thread doing RX/TX
+ * on that queue.
+ *
+ * - After a short delay - where the delay is sufficient to allow any
+ * in-flight callbacks to complete.
+ *
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param mac_addr
- * New default MAC address.
+ * @param queue_id
+ * The queue on the Ethernet device from which the callback is to be removed.
+ * @param user_cb
+ * User supplied callback created via rte_eth_add_tx_callback().
+ *
* @return
- * - (0) if successful, or *mac_addr* didn't exist.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port* invalid.
- * - (-EINVAL) if MAC address is invalid.
+ * - 0: Success. Callback was removed.
+ * - -ENOTSUP: Callback support is not available.
+ * - -EINVAL: The port_id or the queue_id is out of range, or the callback
+ * is NULL or not found for the port/queue.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
- struct ether_addr *mac_addr);
+int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxtx_callback *user_cb);
/**
- * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+ * Retrieve information about given port's RX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to update.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
- * - (-EIO) if device is removed.
+ * - 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_dev_rss_reta_update(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_rxq_info *qinfo);
- /**
- * Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
+/**
+ * Retrieve information about given port's TX queue.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param reta_conf
- * RETA to query.
- * @param reta_size
- * Redirection table size. The table size can be queried by
- * rte_eth_dev_info_get().
+ * @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) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
- * - (-EIO) if device is removed.
+ * - 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_dev_rss_reta_query(uint16_t port,
- struct rte_eth_rss_reta_entry64 *reta_conf,
- uint16_t reta_size);
+int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_txq_info *qinfo);
- /**
- * Updates unicast hash table for receiving packet with the given destination
- * MAC address, and the packet is routed to all VFs for which the RX mode is
- * accept packets that match the unicast hash table.
+/**
+ * Retrieve device registers and register attributes (number of registers and
+ * register size)
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param addr
- * Unicast MAC address.
- * @param on
- * 1 - Set an unicast hash bit for receiving packets with the MAC address.
- * 0 - Clear an unicast hash bit.
+ * @param info
+ * Pointer to rte_dev_reg_info structure to fill in. If info->data is
+ * NULL the function fills in the width and length fields. If non-NULL
+ * the registers are put into the buffer pointed at by the data field.
* @return
* - (0) if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
- uint8_t on);
+int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
- /**
- * Updates all unicast hash bitmaps for receiving packet with any Unicast
- * Ethernet MAC addresses,the packet is routed to all VFs for which the RX
- * mode is accept packets that match the unicast hash table.
+/**
+ * Retrieve size of device EEPROM
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
- * @param on
- * 1 - Set all unicast hash bitmaps for receiving all the Ethernet
- * MAC addresses
- * 0 - Clear all unicast hash bitmaps
* @return
- * - (0) if successful.
+ * - (>=0) EEPROM size if successful.
* - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
+ * - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_get_eeprom_length(uint16_t port_id);
/**
- * Set a traffic mirroring rule on an Ethernet device
+ * Retrieve EEPROM and EEPROM attribute
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param mirror_conf
- * The pointer to the traffic mirroring structure describing the mirroring rule.
- * The *rte_eth_vm_mirror_conf* structure includes the type of mirroring rule,
- * destination pool and the value of rule if enable vlan or pool mirroring.
- *
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
- * @param on
- * 1 - Enable a mirroring rule.
- * 0 - Disable a mirroring rule.
+ * @param info
+ * The template includes buffer for return EEPROM data and
+ * EEPROM attributes to be filled.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if the mr_conf information is not correct.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_set(uint16_t port_id,
- struct rte_eth_mirror_conf *mirror_conf,
- uint8_t rule_id,
- uint8_t on);
+int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
- * Reset a traffic mirroring rule on an Ethernet device.
+ * Program EEPROM with provided data
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rule_id
- * The index of traffic mirroring rule, we support four separated rules.
+ * @param info
+ * The template includes EEPROM data for programming and
+ * EEPROM attributes to be filled
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
+ * - (-ENOTSUP) if hardware doesn't support.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if bad parameter.
+ * - others depends on the specific operations implementation.
*/
-int rte_eth_mirror_rule_reset(uint16_t port_id,
- uint8_t rule_id);
+int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
- * Set the rate limitation for a queue on an Ethernet device.
+ * Set the list of multicast addresses to filter on an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_idx
- * The queue id.
- * @param tx_rate
- * The tx rate in Mbps. Allocated from the total port link speed.
+ * @param mc_addr_set
+ * The array of multicast addresses to set. Equal to NULL when the function
+ * is invoked to flush the set of filtered addresses.
+ * @param nb_mc_addr
+ * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
+ * when the function is invoked to flush the set of filtered addresses.
* @return
* - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port_id* invalid.
* - (-EIO) if device is removed.
- * - (-EINVAL) if bad parameter.
+ * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
+ * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
*/
-int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
- uint16_t tx_rate);
+int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
+ struct ether_addr *mc_addr_set,
+ uint32_t nb_mc_addr);
- /**
- * Configuration of Receive Side Scaling hash computation of Ethernet device.
+/**
+ * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * The new configuration to use for RSS hash computation on the port.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-EINVAL) if bad parameter.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_rss_hash_update(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_timesync_enable(uint16_t port_id);
- /**
- * Retrieve current configuration of Receive Side Scaling hash computation
- * of Ethernet device.
+/**
+ * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param rss_conf
- * Where to store the current RSS hash configuration of the Ethernet device.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support RSS.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
- struct rte_eth_rss_conf *rss_conf);
+int rte_eth_timesync_disable(uint16_t port_id);
- /**
- * Add UDP tunneling port for a specific type of tunnel.
- * The packets with this UDP port will be identified as this type of tunnel.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to change or add more UDP port for the tunnel. So the offloading function
- * can take effect on the packets with the specific UDP port.
+/**
+ * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
+ * @param timestamp
+ * Pointer to the timestamp struct.
+ * @param flags
+ * Device specific flags. Used to pass the RX timesync register index to
+ * i40e. Unused in igb/ixgbe, pass 0 instead.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
+ struct timespec *timestamp, uint32_t flags);
- /**
- * Delete UDP tunneling port a specific type of tunnel.
- * The packets with this UDP port will not be identified as this type of tunnel
- * any more.
- * Before enabling any offloading function for a tunnel, users can call this API
- * to delete a UDP port for the tunnel. So the offloading function will not take
- * effect on the packets with the specific UDP port.
+/**
+ * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param tunnel_udp
- * UDP tunneling configuration.
+ * @param timestamp
+ * Pointer to the timestamp struct.
*
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int
-rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
- struct rte_eth_udp_tunnel *tunnel_udp);
+int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
+ struct timespec *timestamp);
/**
- * Check whether the filter type is supported on an Ethernet device.
- * All the supported filter types are defined in 'rte_eth_ctrl.h'.
+ * 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 filter_type
- * Filter type.
+ * @param delta
+ * The adjustment in nanoseconds.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support this filter type.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
+ * - 0: Success.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_filter_supported(uint16_t port_id,
- enum rte_filter_type filter_type);
+int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
/**
- * Take operations to assigned filter type on an Ethernet device.
- * All the supported operations and filter types are defined in 'rte_eth_ctrl.h'.
+ * 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 filter_type
- * Filter type.
- * @param filter_op
- * Type of operation.
- * @param arg
- * A pointer to arguments defined specifically for the operation.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
+ *
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
+ * - 0: Success.
*/
-int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
- enum rte_filter_op filter_op, void *arg);
+int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
/**
- * Get DCB information on an Ethernet device.
+ * 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 dcb_info
- * dcb information.
+ * @param time
+ * Pointer to the timespec struct that holds the time.
+ *
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support.
+ * - 0: Success.
+ * - -EINVAL: No timestamp is available.
+ * - -ENODEV: The port ID is invalid.
+ * - -EIO: if device is removed.
+ * - -ENOTSUP: The function is not supported by the Ethernet driver.
*/
-int rte_eth_dev_get_dcb_info(uint16_t port_id,
- struct rte_eth_dcb_info *dcb_info);
+int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
/**
- * Add a callback to be called on packet RX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Config l2 tunnel ether type of an Ethernet device for filtering specific
+ * tunnel packets by ether type.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param l2_tunnel
+ * l2 tunnel configuration.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int
+rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel);
/**
- * Add a callback that must be called first on packet RX on a given port
- * and queue.
- *
- * This API configures a first function to be called for each burst of
- * packets received on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_rx_callback().
- *
- * Multiple functions are called in the order that they are added.
+ * Enable/disable l2 tunnel offload functions. Include,
+ * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
+ * Filtering, forwarding and offloading this type of tunnel packets depend on
+ * this ability.
+ * 2, Stripping the l2 tunnel tag.
+ * 3, Insertion of the l2 tunnel tag.
+ * 4, Forwarding the packets based on the l2 tunnel tag.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
+ * @param l2_tunnel
+ * l2 tunnel parameters.
+ * @param mask
+ * Indicate the offload function.
+ * @param en
+ * Enable or disable this function.
*
* @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
+ * - (0) if successful.
+ * - (-ENODEV) if port identifier is invalid.
+ * - (-EIO) if device is removed.
+ * - (-ENOTSUP) if hardware doesn't support tunnel type.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
- rte_rx_callback_fn fn, void *user_param);
+int
+rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
+ struct rte_eth_l2_tunnel_conf *l2_tunnel,
+ uint32_t mask,
+ uint8_t en);
/**
- * Add a callback to be called on packet TX on a given port and queue.
- *
- * This API configures a function to be called for each burst of
- * packets sent on a given NIC port queue. The return value is a pointer
- * that can be used to later remove the callback using
- * rte_eth_remove_tx_callback().
- *
- * Multiple functions are called in the order that they are added.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device on which the callback is to be added.
- * @param fn
- * The callback function
- * @param user_param
- * A generic pointer parameter which will be passed to each invocation of the
- * callback function on this port and queue.
- *
- * @return
- * NULL on error.
- * On success, a pointer value which can later be used to remove the callback.
- */
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
- rte_tx_callback_fn fn, void *user_param);
+* Get the port id from pci address or device name
+* Ex: 0000:2:00.0 or vdev name net_pcap0
+*
+* @param name
+* pci address or name of the device
+* @param port_id
+* pointer to port identifier of the device
+* @return
+* - (0) if successful and port_id is filled.
+* - (-ENODEV or -EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
/**
- * Remove an RX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_rx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_rx_callback().
- *
- * @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
- */
-int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+* Get the device name from port id
+*
+* @param port_id
+* pointer to port identifier of the device
+* @param name
+* pci address or name of the device
+* @return
+* - (0) if successful.
+* - (-EINVAL) on failure.
+*/
+int
+rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
/**
- * Remove a TX packet callback from a given port and queue.
- *
- * This function is used to removed callbacks that were added to a NIC port
- * queue using rte_eth_add_tx_callback().
- *
- * Note: the callback is removed from the callback list but it isn't freed
- * since the it may still be in use. The memory for the callback can be
- * subsequently freed back by the application by calling rte_free():
- *
- * - Immediately - if the port is stopped, or the user knows that no
- * callbacks are in flight e.g. if called from the thread doing RX/TX
- * on that queue.
- *
- * - After a short delay - where the delay is sufficient to allow any
- * in-flight callbacks to complete.
+ * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
+ * the ethernet device information, otherwise adjust them to boundaries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param queue_id
- * The queue on the Ethernet device from which the callback is to be removed.
- * @param user_cb
- * User supplied callback created via rte_eth_add_tx_callback().
- *
+ * @param nb_rx_desc
+ * A pointer to a uint16_t where the number of receive
+ * descriptors stored.
+ * @param nb_tx_desc
+ * A pointer to a uint16_t where the number of transmit
+ * descriptors stored.
* @return
- * - 0: Success. Callback was removed.
- * - -ENOTSUP: Callback support is not available.
- * - -EINVAL: The port_id or the queue_id is out of range, or the callback
- * is NULL or not found for the port/queue.
+ * - (0) if successful.
+ * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
*/
-int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
+ uint16_t *nb_rx_desc,
+ uint16_t *nb_tx_desc);
/**
- * Retrieve information about given port's RX queue.
+ * Test if a port supports specific mempool ops.
*
* @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.
- *
+ * Port identifier of the Ethernet device.
+ * @param [in] pool
+ * The name of the pool operations to test.
* @return
- * - 0: Success
- * - -ENOTSUP: routine is not supported by the device PMD.
- * - -EINVAL: The port_id or the queue_id is out of range.
+ * - 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_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxq_info *qinfo);
+int
+rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
/**
- * Retrieve information about given port's TX queue.
+ * Get the security context for the Ethernet device.
*
* @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.
- *
+ * Port identifier 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.
+ * - NULL on error.
+ * - pointer to security context on success.
*/
-int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_txq_info *qinfo);
+void *
+rte_eth_dev_get_sec_ctx(uint8_t port_id);
-/**
- * Retrieve device registers and register attributes (number of registers and
- * register size)
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * Pointer to rte_dev_reg_info structure to fill in. If info->data is
- * NULL the function fills in the width and length fields. If non-NULL
- * the registers are put into the buffer pointed at by the data field.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
-/**
- * Retrieve size of device EEPROM
- *
- * @param port_id
- * The port identifier of the Ethernet device.
- * @return
- * - (>=0) EEPROM size if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
- */
-int rte_eth_dev_get_eeprom_length(uint16_t port_id);
+#include <rte_ethdev_core.h>
/**
- * Retrieve EEPROM and EEPROM attribute
+ *
+ * Retrieve a burst of input packets from a receive queue of an Ethernet
+ * device. The retrieved packets are stored in *rte_mbuf* structures whose
+ * pointers are supplied in the *rx_pkts* array.
+ *
+ * The rte_eth_rx_burst() function loops, parsing the RX ring of the
+ * receive queue, up to *nb_pkts* packets, and for each completed RX
+ * descriptor in the ring, it performs the following operations:
+ *
+ * - Initialize the *rte_mbuf* data structure associated with the
+ * RX descriptor according to the information provided by the NIC into
+ * that RX descriptor.
+ *
+ * - Store the *rte_mbuf* data structure into the next entry of the
+ * *rx_pkts* array.
+ *
+ * - Replenish the RX descriptor with a new *rte_mbuf* buffer
+ * allocated from the memory pool associated with the receive queue at
+ * initialization time.
+ *
+ * When retrieving an input packet that was scattered by the controller
+ * into multiple receive descriptors, the rte_eth_rx_burst() function
+ * appends the associated *rte_mbuf* buffers to the first buffer of the
+ * packet.
+ *
+ * The rte_eth_rx_burst() function returns the number of packets
+ * actually retrieved, which is the number of *rte_mbuf* data structures
+ * effectively supplied into the *rx_pkts* array.
+ * A return value equal to *nb_pkts* indicates that the RX queue contained
+ * at least *rx_pkts* packets, and this is likely to signify that other
+ * received packets remain in the input queue. Applications implementing
+ * a "retrieve as much received packets as possible" policy can check this
+ * specific case and keep invoking the rte_eth_rx_burst() function until
+ * a value less than *nb_pkts* is returned.
+ *
+ * This receive method has the following advantages:
+ *
+ * - It allows a run-to-completion network stack engine to retrieve and
+ * to immediately process received packets in a fast burst-oriented
+ * approach, avoiding the overhead of unnecessary intermediate packet
+ * queue/dequeue operations.
+ *
+ * - Conversely, it also allows an asynchronous-oriented processing
+ * method to retrieve bursts of received packets and to immediately
+ * queue them for further parallel processing by another logical core,
+ * for instance. However, instead of having received packets being
+ * individually queued by the driver, this approach allows the caller
+ * of the rte_eth_rx_burst() function to queue a burst of retrieved
+ * packets at a time and therefore dramatically reduce the cost of
+ * enqueue/dequeue operations per packet.
+ *
+ * - It allows the rte_eth_rx_burst() function of the driver to take
+ * advantage of burst-oriented hardware features (CPU cache,
+ * prefetch instructions, and so on) to minimize the number of CPU
+ * cycles per packet.
+ *
+ * To summarize, the proposed receive API enables many
+ * burst-oriented optimizations in both synchronous and asynchronous
+ * packet processing environments with no overhead in both cases.
+ *
+ * The rte_eth_rx_burst() function does not provide any error
+ * notification to avoid the corresponding overhead. As a hint, the
+ * upper-level application might check the status of the device link once
+ * being systematically returned a 0 value for a given number of tries.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param info
- * The template includes buffer for return EEPROM data and
- * EEPROM attributes to be filled.
+ * @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 rx_pkts
+ * The address of an array of pointers to *rte_mbuf* structures that
+ * must be large enough to store *nb_pkts* pointers in it.
+ * @param nb_pkts
+ * The maximum number of packets to retrieve.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
+ * The number of packets actually retrieved, which is the number
+ * of pointers to *rte_mbuf* structures effectively supplied to the
+ * *rx_pkts* array.
*/
-int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+static inline uint16_t
+rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_rx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+ int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
+ rx_pkts, nb_pkts);
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
+ nb_pkts, cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return nb_rx;
+}
/**
- * Program EEPROM with provided data
+ * Get the number of used descriptors of a rx queue
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param info
- * The template includes EEPROM data for programming and
- * EEPROM attributes to be filled
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
* @return
- * - (0) if successful.
- * - (-ENOTSUP) if hardware doesn't support.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - others depends on the specific operations implementation.
+ * The number of used descriptors in the specific queue, or:
+ * (-EINVAL) if *port_id* or *queue_id* is invalid
+ * (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+static inline int
+rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
+ dev = &rte_eth_devices[port_id];
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -EINVAL;
+
+ return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
+}
/**
- * Set the list of multicast addresses to filter on an Ethernet device.
+ * Check if the DD bit of the specific RX descriptor in the queue has been set
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param mc_addr_set
- * The array of multicast addresses to set. Equal to NULL when the function
- * is invoked to flush the set of filtered addresses.
- * @param nb_mc_addr
- * The number of multicast addresses in the *mc_addr_set* array. Equal to 0
- * when the function is invoked to flush the set of filtered addresses.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The queue id on the specific port.
+ * @param offset
+ * The offset of the descriptor ID from tail.
* @return
- * - (0) if successful.
- * - (-ENODEV) if *port_id* invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering.
- * - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
+ * - (1) if the specific DD bit is set.
+ * - (0) if the specific DD bit is not set.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-ENOTSUP) if the device does not support this function
*/
-int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
- struct ether_addr *mc_addr_set,
- uint32_t nb_mc_addr);
+static inline int
+rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
+ return (*dev->dev_ops->rx_descriptor_done)( \
+ dev->data->rx_queues[queue_id], offset);
+}
+
+#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */
+#define RTE_ETH_RX_DESC_DONE 1 /**< Desc done, filled by hw. */
+#define RTE_ETH_RX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * Enable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * Check the status of a Rx descriptor in the queue
*
- * @param port_id
- * The port identifier of the Ethernet device.
+ * It should be called in a similar context than the Rx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_enable(uint16_t port_id);
-
-/**
- * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
+ *
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Rx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the next
+ * packet to be received by the driver).
*
* @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * - (RTE_ETH_RX_DESC_AVAIL): Descriptor is available for the hardware to
+ * receive a packet.
+ * - (RTE_ETH_RX_DESC_DONE): Descriptor is done, it is filled by hw, but
+ * not yet processed by the driver (i.e. in the receive queue).
+ * - (RTE_ETH_RX_DESC_UNAVAIL): Descriptor is unavailable, either hold by
+ * the driver and not yet returned to hw, or reserved by the hw.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int rte_eth_timesync_disable(uint16_t port_id);
+static inline int
+rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
+ uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *rxq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_rx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
+ rxq = dev->data->rx_queues[queue_id];
+
+ return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
+}
+
+#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled for hw, waiting xmit. */
+#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */
+#define RTE_ETH_TX_DESC_UNAVAIL 2 /**< Desc used by driver or hw. */
/**
- * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
+ * Check the status of a Tx descriptor in the queue.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
- * @param flags
- * Device specific flags. Used to pass the RX timesync register index to
- * i40e. Unused in igb/ixgbe, pass 0 instead.
+ * It should be called in a similar context than the Tx function:
+ * - on a dataplane core
+ * - not concurrently on the same queue
*
- * @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
- struct timespec *timestamp, uint32_t flags);
-
-/**
- * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
+ * Since it's a dataplane function, no check is performed on port_id and
+ * queue_id. The caller must therefore ensure that the port is enabled
+ * and the queue is configured and running.
+ *
+ * Note: accessing to a random descriptor in the ring may trigger cache
+ * misses and have a performance impact.
*
* @param port_id
- * The port identifier of the Ethernet device.
- * @param timestamp
- * Pointer to the timestamp struct.
+ * A valid port identifier of the Ethernet device which.
+ * @param queue_id
+ * A valid Tx queue identifier on this port.
+ * @param offset
+ * The offset of the descriptor starting from tail (0 is the place where
+ * the next packet will be send).
*
* @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * - (RTE_ETH_TX_DESC_FULL) Descriptor is being processed by the hw, i.e.
+ * in the transmit queue.
+ * - (RTE_ETH_TX_DESC_DONE) Hardware is done with this descriptor, it can
+ * be reused by the driver.
+ * - (RTE_ETH_TX_DESC_UNAVAIL): Descriptor is unavailable, reserved by the
+ * driver or the hardware.
+ * - (-EINVAL) bad descriptor offset.
+ * - (-ENOTSUP) if the device does not support this function.
+ * - (-ENODEV) bad port or queue (only if compiled with debug).
*/
-int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
- struct timespec *timestamp);
+static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
+ uint16_t queue_id, uint16_t offset)
+{
+ struct rte_eth_dev *dev;
+ void *txq;
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+#endif
+ dev = &rte_eth_devices[port_id];
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues)
+ return -ENODEV;
+#endif
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
+ txq = dev->data->tx_queues[queue_id];
+
+ return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
+}
/**
- * Adjust the timesync clock on an Ethernet device.
+ * Send a burst of output packets on a transmit queue of 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.
+ * The rte_eth_tx_burst() function is invoked to transmit output packets
+ * on the output queue *queue_id* of the Ethernet device designated by its
+ * *port_id*.
+ * The *nb_pkts* parameter is the number of packets to send which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * The rte_eth_tx_burst() function loops, sending *nb_pkts* packets,
+ * up to the number of transmit descriptors available in the TX ring of the
+ * transmit queue.
+ * For each packet to send, the rte_eth_tx_burst() function performs
+ * the following operations:
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param delta
- * The adjustment in nanoseconds.
+ * - Pick up the next available descriptor in the transmit ring.
*
- * @return
- * - 0: Success.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
- */
-int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
-
-/**
- * Read the time from the timesync clock on an Ethernet device.
+ * - Free the network buffer previously sent with that descriptor, if any.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * - Initialize the transmit descriptor with the information provided
+ * in the *rte_mbuf data structure.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
+ * In the case of a segmented packet composed of a list of *rte_mbuf* buffers,
+ * the rte_eth_tx_burst() function uses several transmit descriptors
+ * of the ring.
*
- * @return
- * - 0: Success.
- */
-int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
-
-/**
- * Set the time of the timesync clock on an Ethernet device.
+ * The rte_eth_tx_burst() function returns the number of packets it
+ * actually sent. A return value equal to *nb_pkts* means that all packets
+ * have been sent, and this is likely to signify that other output packets
+ * could be immediately transmitted again. Applications that implement a
+ * "send as many packets to transmit as possible" policy can check this
+ * specific case and keep invoking the rte_eth_tx_burst() function until
+ * a value less than *nb_pkts* is returned.
*
- * This is usually used in conjunction with other Ethdev timesync functions to
- * synchronize the device time using the IEEE1588/802.1AS protocol.
+ * It is the responsibility of the rte_eth_tx_burst() function to
+ * transparently free the memory buffers of packets previously sent.
+ * This feature is driven by the *tx_free_thresh* value supplied to the
+ * rte_eth_dev_configure() function at device configuration time.
+ * When the number of free TX descriptors drops below this threshold, the
+ * rte_eth_tx_burst() function must [attempt to] free the *rte_mbuf* buffers
+ * of those packets whose transmission was effectively completed.
+ *
+ * If the PMD is DEV_TX_OFFLOAD_MT_LOCKFREE capable, multiple threads can
+ * invoke this function concurrently on the same tx queue without SW lock.
+ * @see rte_eth_dev_info_get, struct rte_eth_txconf::txq_flags
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param time
- * Pointer to the timespec struct that holds the time.
- *
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to transmit.
* @return
- * - 0: Success.
- * - -EINVAL: No timestamp is available.
- * - -ENODEV: The port ID is invalid.
- * - -EIO: if device is removed.
- * - -ENOTSUP: The function is not supported by the Ethernet driver.
+ * The number of output packets actually stored in transmit descriptors of
+ * the transmit ring. The return value can be less than the value of the
+ * *tx_pkts* parameter when the transmit ring is full or has been filled up.
*/
-int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
+static inline uint16_t
+rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
+
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ return 0;
+ }
+#endif
+
+#ifdef RTE_ETHDEV_RXTX_CALLBACKS
+ struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
+
+ if (unlikely(cb != NULL)) {
+ do {
+ nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
+ cb->param);
+ cb = cb->next;
+ } while (cb != NULL);
+ }
+#endif
+
+ return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
+}
/**
- * Config l2 tunnel ether type of an Ethernet device for filtering specific
- * tunnel packets by ether type.
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel configuration.
+ * Process a burst of output packets on a transmit queue of an Ethernet device.
*
- * @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
- */
-int
-rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel);
-
-/**
- * Enable/disable l2 tunnel offload functions. Include,
- * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.
- * Filtering, forwarding and offloading this type of tunnel packets depend on
- * this ability.
- * 2, Stripping the l2 tunnel tag.
- * 3, Insertion of the l2 tunnel tag.
- * 4, Forwarding the packets based on the l2 tunnel tag.
+ * The rte_eth_tx_prepare() function is invoked to prepare output packets to be
+ * transmitted on the output queue *queue_id* of the Ethernet device designated
+ * by its *port_id*.
+ * The *nb_pkts* parameter is the number of packets to be prepared which are
+ * supplied in the *tx_pkts* array of *rte_mbuf* structures, each of them
+ * allocated from a pool created with rte_pktmbuf_pool_create().
+ * For each packet to send, the rte_eth_tx_prepare() function performs
+ * the following operations:
+ *
+ * - Check if packet meets devices requirements for tx offloads.
+ *
+ * - Check limitations about number of segments.
+ *
+ * - Check additional requirements when debug is enabled.
+ *
+ * - Update and/or reset required checksums when tx offload is set for packet.
+ *
+ * Since this function can modify packet data, provided mbufs must be safely
+ * writable (e.g. modified data cannot be in shared segment).
+ *
+ * The rte_eth_tx_prepare() function returns the number of packets ready to be
+ * sent. A return value equal to *nb_pkts* means that all packets are valid and
+ * ready to be sent, otherwise stops processing on the first invalid packet and
+ * leaves the rest packets untouched.
+ *
+ * When this functionality is not implemented in the driver, all packets are
+ * are returned untouched.
*
* @param port_id
* The port identifier of the Ethernet device.
- * @param l2_tunnel
- * l2 tunnel parameters.
- * @param mask
- * Indicate the offload function.
- * @param en
- * Enable or disable this function.
- *
+ * The value must be a valid port id.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param tx_pkts
+ * The address of an array of *nb_pkts* pointers to *rte_mbuf* structures
+ * which contain the output packets.
+ * @param nb_pkts
+ * The maximum number of packets to process.
* @return
- * - (0) if successful.
- * - (-ENODEV) if port identifier is invalid.
- * - (-EIO) if device is removed.
- * - (-ENOTSUP) if hardware doesn't support tunnel type.
+ * The number of packets correct and ready to be sent. The return value can be
+ * less than the value of the *tx_pkts* parameter when some packet doesn't
+ * meet devices requirements with rte_errno set appropriately:
+ * - -EINVAL: offload flags are not correctly set
+ * - -ENOTSUP: the offload feature is not supported by the hardware
+ *
*/
-int
-rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
- struct rte_eth_l2_tunnel_conf *l2_tunnel,
- uint32_t mask,
- uint8_t en);
-/**
-* Get the port id from pci address or device name
-* Ex: 0000:2:00.0 or vdev name net_pcap0
-*
-* @param name
-* pci address or name of the device
-* @param port_id
-* pointer to port identifier of the device
-* @return
-* - (0) if successful and port_id is filled.
-* - (-ENODEV or -EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
+#ifndef RTE_ETHDEV_TX_PREPARE_NOOP
-/**
-* Get the device name from port id
-*
-* @param port_id
-* pointer to port identifier of the device
-* @param name
-* pci address or name of the device
-* @return
-* - (0) if successful.
-* - (-EINVAL) on failure.
-*/
-int
-rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
+static inline uint16_t
+rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
+ struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ struct rte_eth_dev *dev;
-/**
- * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from
- * the ethernet device information, otherwise adjust them to boundaries.
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ dev = &rte_eth_devices[port_id];
+
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+ if (queue_id >= dev->data->nb_tx_queues) {
+ RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
+ rte_errno = -EINVAL;
+ return 0;
+ }
+#endif
+
+ if (!dev->tx_pkt_prepare)
+ return nb_pkts;
+
+ return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
+ tx_pkts, nb_pkts);
+}
+
+#else
+
+/*
+ * Native NOOP operation for compilation targets which doesn't require any
+ * preparations steps, and functional NOOP may introduce unnecessary performance
+ * drop.
*
- * @param port_id
- * The port identifier of the Ethernet device.
- * @param nb_rx_desc
- * A pointer to a uint16_t where the number of receive
- * descriptors stored.
- * @param nb_tx_desc
- * A pointer to a uint16_t where the number of transmit
- * descriptors stored.
- * @return
- * - (0) if successful.
- * - (-ENOTSUP, -ENODEV or -EINVAL) on failure.
+ * Generally this is not a good idea to turn it on globally and didn't should
+ * be used if behavior of tx_preparation can change.
*/
-int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
- uint16_t *nb_rx_desc,
- uint16_t *nb_tx_desc);
+static inline uint16_t
+rte_eth_tx_prepare(__rte_unused uint16_t port_id,
+ __rte_unused uint16_t queue_id,
+ __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
+{
+ return nb_pkts;
+}
+
+#endif
/**
- * Test if a port supports specific mempool ops.
+ * Send any packets queued up for transmission on a port and HW queue
+ *
+ * This causes an explicit flush of packets previously buffered via the
+ * rte_eth_tx_buffer() function. It returns the number of packets successfully
+ * sent to the NIC, and calls the error callback for any unsent packets. Unless
+ * explicitly set up otherwise, the default callback simply frees the unsent
+ * packets back to the owning mempool.
*
* @param port_id
- * Port identifier of the Ethernet device.
- * @param [in] pool
- * The name of the pool operations to test.
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer of packets to be transmit.
* @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.
+ * The number of packets successfully sent to the Ethernet device. The error
+ * callback is called for any packets which could not be sent.
*/
-int
-rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
+static inline uint16_t
+rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer)
+{
+ uint16_t sent;
+ uint16_t to_send = buffer->length;
+
+ if (to_send == 0)
+ return 0;
+
+ sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
+
+ buffer->length = 0;
+
+ /* All packets sent, or to be dealt with by callback below */
+ if (unlikely(sent != to_send))
+ buffer->error_callback(&buffer->pkts[sent], to_send - sent,
+ buffer->error_userdata);
+
+ return sent;
+}
/**
- * Get the security context for the Ethernet device.
+ * Buffer a single packet for future transmission on a port and queue
+ *
+ * This function takes a single mbuf/packet and buffers it for later
+ * transmission on the particular port and queue specified. Once the buffer is
+ * full of packets, an attempt will be made to transmit all the buffered
+ * packets. In case of error, where not all packets can be transmitted, a
+ * callback is called with the unsent packets as a parameter. If no callback
+ * is explicitly set up, the unsent packets are just freed back to the owning
+ * mempool. The function returns the number of packets actually sent i.e.
+ * 0 if no buffer flush occurred, otherwise the number of packets successfully
+ * flushed
*
* @param port_id
- * Port identifier of the Ethernet device
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The index of the transmit queue through which output packets must be
+ * sent.
+ * The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ * to rte_eth_dev_configure().
+ * @param buffer
+ * Buffer used to collect packets to be sent.
+ * @param tx_pkt
+ * Pointer to the packet mbuf to be sent.
* @return
- * - NULL on error.
- * - pointer to security context on success.
+ * 0 = packet has been buffered for later transmission
+ * N > 0 = packet has been buffered, and the buffer was subsequently flushed,
+ * causing N packets to be sent, and the error callback to be called for
+ * the rest.
*/
-void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
+static __rte_always_inline uint16_t
+rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
+ struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
+{
+ buffer->pkts[buffer->length++] = tx_pkt;
+ if (buffer->length < buffer->size)
+ return 0;
+
+ return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
+}
#ifdef __cplusplus
}
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v6 4/4] ethdev: rename function parameter for consistency
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 3/4] ethdev: reorder inline functions Ferruh Yigit
@ 2018-01-22 0:16 ` Ferruh Yigit
2018-01-22 0:51 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Thomas Monjalon
3 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-01-22 0:16 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Ferruh Yigit
Update "port" function argument variable to "port_id" in public
header to be consistent in all APIs.
No functional change.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index d097e528d..ccf4a15f2 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1158,7 +1158,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* The callback function is called on RX with a burst of packets that have
* been received on the given port and queue.
*
- * @param port
+ * @param port_id
* The Ethernet port on which RX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to receive the packets.
@@ -1174,7 +1174,7 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
* @return
* The number of packets returned to the user.
*/
-typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
void *user_param);
@@ -1184,7 +1184,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* The callback function is called on TX with a burst of packets immediately
* before the packets are put onto the hardware queue for transmission.
*
- * @param port
+ * @param port_id
* The Ethernet port on which TX is being performed.
* @param queue
* The queue on the Ethernet port which is being used to transmit the packets.
@@ -1198,7 +1198,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
* @return
* The number of packets to be written to the NIC.
*/
-typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
+typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
/**
@@ -2571,7 +2571,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* Add a MAC address to an internal array of addresses used to enable whitelist
* filtering to accept packets only if the destination MAC address matches.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* The MAC address to add.
@@ -2579,20 +2579,20 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* VMDq pool index to associate address with (if VMDq is enabled). If VMDq is
* not enabled, this should be set to 0.
* @return
- * - (0) if successfully added or *mac_addr" was already added.
+ * - (0) if successfully added or *mac_addr* was already added.
* - (-ENOTSUP) if hardware doesn't support this feature.
* - (-ENODEV) if *port* is invalid.
* - (-EIO) if device is removed.
* - (-ENOSPC) if no more MAC addresses can be added.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
+int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr,
uint32_t pool);
/**
* Remove a MAC address from the internal array of addresses.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* MAC address to remove.
@@ -2602,12 +2602,12 @@ int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
* - (-ENODEV) if *port* invalid.
* - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
+int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr);
/**
* Set the default MAC address.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param mac_addr
* New default MAC address.
@@ -2617,13 +2617,13 @@ int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
* - (-ENODEV) if *port* invalid.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_default_mac_addr_set(uint16_t port,
+int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
struct ether_addr *mac_addr);
/**
* Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to update.
@@ -2636,14 +2636,14 @@ int rte_eth_dev_default_mac_addr_set(uint16_t port,
* - (-EINVAL) if bad parameter.
* - (-EIO) if device is removed.
*/
-int rte_eth_dev_rss_reta_update(uint16_t port,
+int rte_eth_dev_rss_reta_update(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
/**
* Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param reta_conf
* RETA to query.
@@ -2656,7 +2656,7 @@ int rte_eth_dev_rss_reta_update(uint16_t port,
* - (-EINVAL) if bad parameter.
* - (-EIO) if device is removed.
*/
-int rte_eth_dev_rss_reta_query(uint16_t port,
+int rte_eth_dev_rss_reta_query(uint16_t port_id,
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size);
@@ -2665,7 +2665,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* MAC address, and the packet is routed to all VFs for which the RX mode is
* accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param addr
* Unicast MAC address.
@@ -2679,7 +2679,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port,
* - (-EIO) if device is removed.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
+int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr,
uint8_t on);
/**
@@ -2687,7 +2687,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* Ethernet MAC addresses,the packet is routed to all VFs for which the RX
* mode is accept packets that match the unicast hash table.
*
- * @param port
+ * @param port_id
* The port identifier of the Ethernet device.
* @param on
* 1 - Set all unicast hash bitmaps for receiving all the Ethernet
@@ -2700,7 +2700,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
* - (-EIO) if device is removed.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
+int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on);
/**
* Set a traffic mirroring rule on an Ethernet device
--
2.14.3
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Ferruh Yigit
` (2 preceding siblings ...)
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
@ 2018-01-22 0:51 ` Thomas Monjalon
3 siblings, 0 replies; 76+ messages in thread
From: Thomas Monjalon @ 2018-01-22 0:51 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
22/01/2018 01:16, Ferruh Yigit:
> Create a rte_ethdev_driver.h file and move PMD specific APIs here.
> Drivers updated to include this new header file.
>
> There is no update in header content and since ethdev.h included by
> ethdev_driver.h, nothing changed from driver point of view, only
> logically grouping of APIs. From applications point of view they can't
> access to driver specific APIs anymore and they shouldn't.
>
> More PMD specific data structures still remain in ethdev.h because of
> inline functions in header use them. Those will be handled separately.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Series applied, thanks
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v4] ethdev: return named opaque type instead of void pointer
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
2018-01-17 22:11 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
@ 2018-03-09 11:25 ` Ferruh Yigit
[not found] ` <20180309123651.GB19004@hmswarspite.think-freely.org>
2018-03-20 16:34 ` [dpdk-dev] [PATCH v5] " Ferruh Yigit
1 sibling, 2 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-03-09 11:25 UTC (permalink / raw)
To: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon
Cc: dev, Ferruh Yigit
"struct rte_eth_rxtx_callback" is defined as internal data structure and
used as named opaque type.
So the functions that are adding callbacks can return objects in this
type instead of void pointer.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
v2:
* keep using struct * in parameters, instead add callback functions
return struct rte_eth_rxtx_callback pointer.
v4:
* Remove deprecation notice. LIBABIVER already increased in this release
---
doc/guides/rel_notes/deprecation.rst | 7 -------
lib/librte_ether/rte_ethdev.c | 6 +++---
lib/librte_ether/rte_ethdev.h | 13 ++++++++-----
3 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index ad54de721..0c696f743 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -142,13 +142,6 @@ Deprecation Notices
successful. This modification will only impact the PMDs, not the
applications.
-* ethdev: functions add rx/tx callback will return named opaque type
- ``rte_eth_add_rx_callback()``, ``rte_eth_add_first_rx_callback()`` and
- ``rte_eth_add_tx_callback()`` functions currently return callback object as
- ``void \*`` but APIs to delete callbacks get ``struct rte_eth_rxtx_callback \*``
- as parameter. For consistency functions adding callback will return
- ``struct rte_eth_rxtx_callback \*`` instead of ``void \*``.
-
* i40e: The default flexible payload configuration which extracts the first 16
bytes of the payload for RSS will be deprecated starting from 18.02. If
required the previous behavior can be configured using existing flow
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 86bce0872..77628cc05 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3501,7 +3501,7 @@ rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
filter_op, arg));
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param)
{
@@ -3543,7 +3543,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
return cb;
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param)
{
@@ -3578,7 +3578,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
return cb;
}
-void *
+struct rte_eth_rxtx_callback *
rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
rte_tx_callback_fn fn, void *user_param)
{
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 213fe27e1..d58b0cb02 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3004,6 +3004,8 @@ int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
int rte_eth_dev_get_dcb_info(uint16_t port_id,
struct rte_eth_dcb_info *dcb_info);
+struct rte_eth_rxtx_callback;
+
/**
* Add a callback to be called on packet RX on a given port and queue.
*
@@ -3028,7 +3030,8 @@ int rte_eth_dev_get_dcb_info(uint16_t port_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param);
/**
@@ -3056,7 +3059,8 @@ void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param);
/**
@@ -3083,11 +3087,10 @@ void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+struct rte_eth_rxtx_callback *
+rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
rte_tx_callback_fn fn, void *user_param);
-struct rte_eth_rxtx_callback;
-
/**
* Remove an RX packet callback from a given port and queue.
*
--
2.13.6
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v4] ethdev: fix port id storage
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
` (6 preceding siblings ...)
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
@ 2018-03-09 11:27 ` Ferruh Yigit
2018-03-09 12:58 ` Thomas Monjalon
7 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2018-03-09 11:27 UTC (permalink / raw)
To: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon
Cc: dev, Ferruh Yigit, stable, declan.doherty, Boris Pismenny,
Aviad Yehezkel, Radu Nicolau
port_id is now 16bits, update function parameter according.
Fixes: 4c270218aa26 ("ethdev: support security APIs")
Cc: stable@dpdk.org
Cc: declan.doherty@intel.com
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
Cc: Boris Pismenny <borisp@mellanox.com>
Cc: Aviad Yehezkel <aviadye@mellanox.com>
Cc: Radu Nicolau <radu.nicolau@intel.com>
Cc: Declan Doherty <declan.doherty@intel.com>
v4:
* Remove deprecation notice. LIBABIVER already incread in this release.
---
doc/guides/rel_notes/deprecation.rst | 4 ----
lib/librte_ether/rte_ethdev.c | 2 +-
lib/librte_ether/rte_ethdev.h | 2 +-
3 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 659458587..ad54de721 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -149,10 +149,6 @@ Deprecation Notices
as parameter. For consistency functions adding callback will return
``struct rte_eth_rxtx_callback \*`` instead of ``void \*``.
-* ethdev: ``rte_eth_dev_get_sec_ctx()`` fix port id storage
- ``rte_eth_dev_get_sec_ctx()`` is using ``uint8_t`` for ``port_id``,
- which should be ``uint16_t``.
-
* i40e: The default flexible payload configuration which extracts the first 16
bytes of the payload for RSS will be deprecated starting from 18.02. If
required the previous behavior can be configured using existing flow
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 6d6874903..86bce0872 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -520,7 +520,7 @@ rte_eth_dev_socket_id(uint16_t port_id)
}
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id)
+rte_eth_dev_get_sec_ctx(uint16_t port_id)
{
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, NULL);
return rte_eth_devices[port_id].security_ctx;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 036153306..213fe27e1 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3530,7 +3530,7 @@ rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
* - pointer to security context on success.
*/
void *
-rte_eth_dev_get_sec_ctx(uint8_t port_id);
+rte_eth_dev_get_sec_ctx(uint16_t port_id);
#include <rte_ethdev_core.h>
--
2.13.6
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: fix port id storage
2018-03-09 11:27 ` [dpdk-dev] [PATCH v4] ethdev: fix port id storage Ferruh Yigit
@ 2018-03-09 12:58 ` Thomas Monjalon
2018-03-26 20:25 ` Ferruh Yigit
0 siblings, 1 reply; 76+ messages in thread
From: Thomas Monjalon @ 2018-03-09 12:58 UTC (permalink / raw)
To: Ferruh Yigit
Cc: Neil Horman, John McNamara, Marko Kovacevic, dev, stable,
declan.doherty, Boris Pismenny, Aviad Yehezkel, Radu Nicolau
09/03/2018 12:27, Ferruh Yigit:
> port_id is now 16bits, update function parameter according.
>
> Fixes: 4c270218aa26 ("ethdev: support security APIs")
> Cc: stable@dpdk.org
> Cc: declan.doherty@intel.com
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: return named opaque type instead of void pointer
[not found] ` <20180309123651.GB19004@hmswarspite.think-freely.org>
@ 2018-03-09 13:00 ` Ferruh Yigit
2018-03-09 15:16 ` Neil Horman
0 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2018-03-09 13:00 UTC (permalink / raw)
To: Neil Horman; +Cc: John McNamara, Marko Kovacevic, Thomas Monjalon, dev
On 3/9/2018 12:36 PM, Neil Horman wrote:
> On Fri, Mar 09, 2018 at 11:25:31AM +0000, Ferruh Yigit wrote:
>> "struct rte_eth_rxtx_callback" is defined as internal data structure and
>> used as named opaque type.
>>
>> So the functions that are adding callbacks can return objects in this
>> type instead of void pointer.
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>> ---
>> v2:
>> * keep using struct * in parameters, instead add callback functions
>> return struct rte_eth_rxtx_callback pointer.
>>
>> v4:
>> * Remove deprecation notice. LIBABIVER already increased in this release
>> ---
>> doc/guides/rel_notes/deprecation.rst | 7 -------
>> lib/librte_ether/rte_ethdev.c | 6 +++---
>> lib/librte_ether/rte_ethdev.h | 13 ++++++++-----
>> 3 files changed, 11 insertions(+), 15 deletions(-)
>>
> This doesn't quite make sense to me. If rte_eth_rxtx_callback is defined as an
> internal data structure, then it shouldn't be used as part of the prototype for
> an exported function, as the structure will then no longer be a internal data
> structure, but rather part of the public ABI.
"struct rte_eth_rxtx_callback" is internal data structure. And application
should not access elements of this structure.
"struct rte_eth_rxtx_callback;" is defined in the public header, so applications
can use it as opaque type.
It is possible that both "add" and "remove" APIs use "void *" and API itself can
cast it. But the inconsistency was "add" related APIs return "void *" and
"remove" related APIs require a parameter in "struct rte_eth_rxtx_callback *" type.
While unifying the usage, "struct rte_eth_rxtx_callback *" preferred against
"void *", because named opaque type documents intention/usage better.
Thanks,
ferruh
>
> Neil
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: return named opaque type instead of void pointer
2018-03-09 13:00 ` Ferruh Yigit
@ 2018-03-09 15:16 ` Neil Horman
2018-03-09 15:45 ` Ferruh Yigit
0 siblings, 1 reply; 76+ messages in thread
From: Neil Horman @ 2018-03-09 15:16 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: John McNamara, Marko Kovacevic, Thomas Monjalon, dev
On Fri, Mar 09, 2018 at 01:00:35PM +0000, Ferruh Yigit wrote:
> On 3/9/2018 12:36 PM, Neil Horman wrote:
> > On Fri, Mar 09, 2018 at 11:25:31AM +0000, Ferruh Yigit wrote:
> >> "struct rte_eth_rxtx_callback" is defined as internal data structure and
> >> used as named opaque type.
> >>
> >> So the functions that are adding callbacks can return objects in this
> >> type instead of void pointer.
> >>
> >> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> >> ---
> >> v2:
> >> * keep using struct * in parameters, instead add callback functions
> >> return struct rte_eth_rxtx_callback pointer.
> >>
> >> v4:
> >> * Remove deprecation notice. LIBABIVER already increased in this release
> >> ---
> >> doc/guides/rel_notes/deprecation.rst | 7 -------
> >> lib/librte_ether/rte_ethdev.c | 6 +++---
> >> lib/librte_ether/rte_ethdev.h | 13 ++++++++-----
> >> 3 files changed, 11 insertions(+), 15 deletions(-)
> >>
> > This doesn't quite make sense to me. If rte_eth_rxtx_callback is defined as an
> > internal data structure, then it shouldn't be used as part of the prototype for
> > an exported function, as the structure will then no longer be a internal data
> > structure, but rather part of the public ABI.
>
> "struct rte_eth_rxtx_callback" is internal data structure. And application
> should not access elements of this structure.
>
> "struct rte_eth_rxtx_callback;" is defined in the public header, so applications
> can use it as opaque type.
>
> It is possible that both "add" and "remove" APIs use "void *" and API itself can
> cast it. But the inconsistency was "add" related APIs return "void *" and
> "remove" related APIs require a parameter in "struct rte_eth_rxtx_callback *" type.
>
> While unifying the usage, "struct rte_eth_rxtx_callback *" preferred against
> "void *", because named opaque type documents intention/usage better.
>
> Thanks,
> ferruh
>
I get what you're saying about rte_eth_rxtx_callback being an internals
structure (or its intent is to be an internal structure), but it doesn't seem to
hold up to the header file layout. rte_eth_rxtx_callback is defined in
rte_ethdev_core.h which according to the makefile, is listed as a symlinked
file, and therefore available for external applications to include. This
negates the intended opaque nature of the struct. I think before you do this,
you want to rectify that.
Neil
> >
> > Neil
> >
>
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: return named opaque type instead of void pointer
2018-03-09 15:16 ` Neil Horman
@ 2018-03-09 15:45 ` Ferruh Yigit
2018-03-09 19:06 ` Neil Horman
0 siblings, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2018-03-09 15:45 UTC (permalink / raw)
To: Neil Horman; +Cc: John McNamara, Marko Kovacevic, Thomas Monjalon, dev
On 3/9/2018 3:16 PM, Neil Horman wrote:
> On Fri, Mar 09, 2018 at 01:00:35PM +0000, Ferruh Yigit wrote:
>> On 3/9/2018 12:36 PM, Neil Horman wrote:
>>> On Fri, Mar 09, 2018 at 11:25:31AM +0000, Ferruh Yigit wrote:
>>>> "struct rte_eth_rxtx_callback" is defined as internal data structure and
>>>> used as named opaque type.
>>>>
>>>> So the functions that are adding callbacks can return objects in this
>>>> type instead of void pointer.
>>>>
>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>>>> ---
>>>> v2:
>>>> * keep using struct * in parameters, instead add callback functions
>>>> return struct rte_eth_rxtx_callback pointer.
>>>>
>>>> v4:
>>>> * Remove deprecation notice. LIBABIVER already increased in this release
>>>> ---
>>>> doc/guides/rel_notes/deprecation.rst | 7 -------
>>>> lib/librte_ether/rte_ethdev.c | 6 +++---
>>>> lib/librte_ether/rte_ethdev.h | 13 ++++++++-----
>>>> 3 files changed, 11 insertions(+), 15 deletions(-)
>>>>
>>> This doesn't quite make sense to me. If rte_eth_rxtx_callback is defined as an
>>> internal data structure, then it shouldn't be used as part of the prototype for
>>> an exported function, as the structure will then no longer be a internal data
>>> structure, but rather part of the public ABI.
>>
>> "struct rte_eth_rxtx_callback" is internal data structure. And application
>> should not access elements of this structure.
>>
>> "struct rte_eth_rxtx_callback;" is defined in the public header, so applications
>> can use it as opaque type.
>>
>> It is possible that both "add" and "remove" APIs use "void *" and API itself can
>> cast it. But the inconsistency was "add" related APIs return "void *" and
>> "remove" related APIs require a parameter in "struct rte_eth_rxtx_callback *" type.
>>
>> While unifying the usage, "struct rte_eth_rxtx_callback *" preferred against
>> "void *", because named opaque type documents intention/usage better.
>>
>> Thanks,
>> ferruh
>>
> I get what you're saying about rte_eth_rxtx_callback being an internals
> structure (or its intent is to be an internal structure), but it doesn't seem to
> hold up to the header file layout. rte_eth_rxtx_callback is defined in
> rte_ethdev_core.h which according to the makefile, is listed as a symlinked
> file, and therefore available for external applications to include. This
> negates the intended opaque nature of the struct. I think before you do this,
> you want to rectify that.
Intention is to make "struct rte_eth_rxtx_callback" internal, but as you said it
is available to applications. This is same for all data structures in
rte_ethdev_core.h
Unfortunately it can't be actual internal because of inline functions in public
header uses them. And we can't change inline functions because of performance
concerns.
Since we can't make the structure real internal, we can't really prevent
applications to access the internals, this same if you use "void *".
>
> Neil
>
>>>
>>> Neil
>>>
>>
>>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: return named opaque type instead of void pointer
2018-03-09 15:45 ` Ferruh Yigit
@ 2018-03-09 19:06 ` Neil Horman
2018-03-20 15:51 ` Ferruh Yigit
0 siblings, 1 reply; 76+ messages in thread
From: Neil Horman @ 2018-03-09 19:06 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: John McNamara, Marko Kovacevic, Thomas Monjalon, dev
On Fri, Mar 09, 2018 at 03:45:49PM +0000, Ferruh Yigit wrote:
> On 3/9/2018 3:16 PM, Neil Horman wrote:
> > On Fri, Mar 09, 2018 at 01:00:35PM +0000, Ferruh Yigit wrote:
> >> On 3/9/2018 12:36 PM, Neil Horman wrote:
> >>> On Fri, Mar 09, 2018 at 11:25:31AM +0000, Ferruh Yigit wrote:
> >>>> "struct rte_eth_rxtx_callback" is defined as internal data structure and
> >>>> used as named opaque type.
> >>>>
> >>>> So the functions that are adding callbacks can return objects in this
> >>>> type instead of void pointer.
> >>>>
> >>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >>>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> >>>> ---
> >>>> v2:
> >>>> * keep using struct * in parameters, instead add callback functions
> >>>> return struct rte_eth_rxtx_callback pointer.
> >>>>
> >>>> v4:
> >>>> * Remove deprecation notice. LIBABIVER already increased in this release
> >>>> ---
> >>>> doc/guides/rel_notes/deprecation.rst | 7 -------
> >>>> lib/librte_ether/rte_ethdev.c | 6 +++---
> >>>> lib/librte_ether/rte_ethdev.h | 13 ++++++++-----
> >>>> 3 files changed, 11 insertions(+), 15 deletions(-)
> >>>>
> >>> This doesn't quite make sense to me. If rte_eth_rxtx_callback is defined as an
> >>> internal data structure, then it shouldn't be used as part of the prototype for
> >>> an exported function, as the structure will then no longer be a internal data
> >>> structure, but rather part of the public ABI.
> >>
> >> "struct rte_eth_rxtx_callback" is internal data structure. And application
> >> should not access elements of this structure.
> >>
> >> "struct rte_eth_rxtx_callback;" is defined in the public header, so applications
> >> can use it as opaque type.
> >>
> >> It is possible that both "add" and "remove" APIs use "void *" and API itself can
> >> cast it. But the inconsistency was "add" related APIs return "void *" and
> >> "remove" related APIs require a parameter in "struct rte_eth_rxtx_callback *" type.
> >>
> >> While unifying the usage, "struct rte_eth_rxtx_callback *" preferred against
> >> "void *", because named opaque type documents intention/usage better.
> >>
> >> Thanks,
> >> ferruh
> >>
> > I get what you're saying about rte_eth_rxtx_callback being an internals
> > structure (or its intent is to be an internal structure), but it doesn't seem to
> > hold up to the header file layout. rte_eth_rxtx_callback is defined in
> > rte_ethdev_core.h which according to the makefile, is listed as a symlinked
> > file, and therefore available for external applications to include. This
> > negates the intended opaque nature of the struct. I think before you do this,
> > you want to rectify that.
>
> Intention is to make "struct rte_eth_rxtx_callback" internal, but as you said it
> is available to applications. This is same for all data structures in
> rte_ethdev_core.h
>
Well...yes. Thats what I said
> Unfortunately it can't be actual internal because of inline functions in public
> header uses them. And we can't change inline functions because of performance
> concerns.
>
I'm sorry, thats not ok with me. Just declaring a data structure to be
internal-only without enforcing that is asking for applications to mangle
internal data, and theres no reason it can't be fixed (and done without
sacrificing performance).
> Since we can't make the structure real internal, we can't really prevent
> applications to access the internals, this same if you use "void *".
>
Just typedef a void pointer to some rte_ethdev_cb_handle_t type and pass that
back and forth instead. That at least hides the fact that you are using a non
opaque structure from user applications without some intentional casting. You
can further lock the call down by declaring the handles const so that no one
tries to dereference or modify them without generating a warning.
Neil
> >
> > Neil
> >
> >>>
> >>> Neil
> >>>
> >>
> >>
>
>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: return named opaque type instead of void pointer
2018-03-09 19:06 ` Neil Horman
@ 2018-03-20 15:51 ` Ferruh Yigit
0 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-03-20 15:51 UTC (permalink / raw)
To: Neil Horman; +Cc: John McNamara, Marko Kovacevic, Thomas Monjalon, dev
On 3/9/2018 7:06 PM, Neil Horman wrote:
> On Fri, Mar 09, 2018 at 03:45:49PM +0000, Ferruh Yigit wrote:
>> On 3/9/2018 3:16 PM, Neil Horman wrote:
>>> On Fri, Mar 09, 2018 at 01:00:35PM +0000, Ferruh Yigit wrote:
>>>> On 3/9/2018 12:36 PM, Neil Horman wrote:
>>>>> On Fri, Mar 09, 2018 at 11:25:31AM +0000, Ferruh Yigit wrote:
>>>>>> "struct rte_eth_rxtx_callback" is defined as internal data structure and
>>>>>> used as named opaque type.
>>>>>>
>>>>>> So the functions that are adding callbacks can return objects in this
>>>>>> type instead of void pointer.
>>>>>>
>>>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>>>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>>>>>> ---
>>>>>> v2:
>>>>>> * keep using struct * in parameters, instead add callback functions
>>>>>> return struct rte_eth_rxtx_callback pointer.
>>>>>>
>>>>>> v4:
>>>>>> * Remove deprecation notice. LIBABIVER already increased in this release
>>>>>> ---
>>>>>> doc/guides/rel_notes/deprecation.rst | 7 -------
>>>>>> lib/librte_ether/rte_ethdev.c | 6 +++---
>>>>>> lib/librte_ether/rte_ethdev.h | 13 ++++++++-----
>>>>>> 3 files changed, 11 insertions(+), 15 deletions(-)
>>>>>>
>>>>> This doesn't quite make sense to me. If rte_eth_rxtx_callback is defined as an
>>>>> internal data structure, then it shouldn't be used as part of the prototype for
>>>>> an exported function, as the structure will then no longer be a internal data
>>>>> structure, but rather part of the public ABI.
>>>>
>>>> "struct rte_eth_rxtx_callback" is internal data structure. And application
>>>> should not access elements of this structure.
>>>>
>>>> "struct rte_eth_rxtx_callback;" is defined in the public header, so applications
>>>> can use it as opaque type.
>>>>
>>>> It is possible that both "add" and "remove" APIs use "void *" and API itself can
>>>> cast it. But the inconsistency was "add" related APIs return "void *" and
>>>> "remove" related APIs require a parameter in "struct rte_eth_rxtx_callback *" type.
>>>>
>>>> While unifying the usage, "struct rte_eth_rxtx_callback *" preferred against
>>>> "void *", because named opaque type documents intention/usage better.
>>>>
>>>> Thanks,
>>>> ferruh
>>>>
>>> I get what you're saying about rte_eth_rxtx_callback being an internals
>>> structure (or its intent is to be an internal structure), but it doesn't seem to
>>> hold up to the header file layout. rte_eth_rxtx_callback is defined in
>>> rte_ethdev_core.h which according to the makefile, is listed as a symlinked
>>> file, and therefore available for external applications to include. This
>>> negates the intended opaque nature of the struct. I think before you do this,
>>> you want to rectify that.
>>
>> Intention is to make "struct rte_eth_rxtx_callback" internal, but as you said it
>> is available to applications. This is same for all data structures in
>> rte_ethdev_core.h
>>
> Well...yes. Thats what I said
>
>> Unfortunately it can't be actual internal because of inline functions in public
>> header uses them. And we can't change inline functions because of performance
>> concerns.
>>
> I'm sorry, thats not ok with me. Just declaring a data structure to be
> internal-only without enforcing that is asking for applications to mangle
> internal data, and theres no reason it can't be fixed (and done without
> sacrificing performance).
Currently that is what blocking us, mainly rte_eth_[rt]x_burst() inline
functions. Is there a way to fix it without loosing performance?
>
>> Since we can't make the structure real internal, we can't really prevent
>> applications to access the internals, this same if you use "void *".
>>
> Just typedef a void pointer to some rte_ethdev_cb_handle_t type and pass that
> back and forth instead. That at least hides the fact that you are using a non
> opaque structure from user applications without some intentional casting. You
> can further lock the call down by declaring the handles const so that no one
> tries to dereference or modify them without generating a warning.
Even handle won't work if user really wants to update it. This may highlight the
intention but I believe moving struct to ethdev_core.h already highlights the
intention.
Related to the const qualifier I was thinking if remove functions needs to
update the struct, but it doesn't seems the case, I will add them.
>
> Neil
>
>>>
>>> Neil
>>>
>>>>>
>>>>> Neil
>>>>>
>>>>
>>>>
>>
>>
^ permalink raw reply [flat|nested] 76+ messages in thread
* [dpdk-dev] [PATCH v5] ethdev: return named opaque type instead of void pointer
2018-03-09 11:25 ` [dpdk-dev] [PATCH v4] " Ferruh Yigit
[not found] ` <20180309123651.GB19004@hmswarspite.think-freely.org>
@ 2018-03-20 16:34 ` Ferruh Yigit
2018-03-21 13:04 ` Neil Horman
1 sibling, 1 reply; 76+ messages in thread
From: Ferruh Yigit @ 2018-03-20 16:34 UTC (permalink / raw)
To: Neil Horman, John McNamara, Marko Kovacevic, Thomas Monjalon,
Reshma Pattan
Cc: dev, Ferruh Yigit
"struct rte_eth_rxtx_callback" is defined as internal data structure and
used as named opaque type.
So the functions that are adding callbacks can return objects in this
type instead of void pointer.
Also const qualifier added to "struct rte_eth_rxtx_callback *" to
protect it better from application modification.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
v2:
* keep using struct * in parameters, instead add callback functions
return struct rte_eth_rxtx_callback pointer.
v4:
* Remove deprecation notice. LIBABIVER already increased in this release
v5:
* add const qualifier to rte_eth_rxtx_callback
---
doc/guides/rel_notes/deprecation.rst | 7 -------
lib/librte_ether/rte_ethdev.c | 10 +++++-----
lib/librte_ether/rte_ethdev.h | 17 ++++++++++-------
lib/librte_latencystats/rte_latencystats.c | 2 +-
lib/librte_pdump/rte_pdump.c | 2 +-
5 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index ad54de721..0c696f743 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -142,13 +142,6 @@ Deprecation Notices
successful. This modification will only impact the PMDs, not the
applications.
-* ethdev: functions add rx/tx callback will return named opaque type
- ``rte_eth_add_rx_callback()``, ``rte_eth_add_first_rx_callback()`` and
- ``rte_eth_add_tx_callback()`` functions currently return callback object as
- ``void \*`` but APIs to delete callbacks get ``struct rte_eth_rxtx_callback \*``
- as parameter. For consistency functions adding callback will return
- ``struct rte_eth_rxtx_callback \*`` instead of ``void \*``.
-
* i40e: The default flexible payload configuration which extracts the first 16
bytes of the payload for RSS will be deprecated starting from 18.02. If
required the previous behavior can be configured using existing flow
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index dd9470099..9304d0440 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3487,7 +3487,7 @@ rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
filter_op, arg));
}
-void *
+const struct rte_eth_rxtx_callback *
rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param)
{
@@ -3529,7 +3529,7 @@ rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
return cb;
}
-void *
+const struct rte_eth_rxtx_callback *
rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param)
{
@@ -3564,7 +3564,7 @@ rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
return cb;
}
-void *
+const struct rte_eth_rxtx_callback *
rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
rte_tx_callback_fn fn, void *user_param)
{
@@ -3609,7 +3609,7 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
int
rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb)
+ const struct rte_eth_rxtx_callback *user_cb)
{
#ifndef RTE_ETHDEV_RXTX_CALLBACKS
return -ENOTSUP;
@@ -3643,7 +3643,7 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
int
rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb)
+ const struct rte_eth_rxtx_callback *user_cb)
{
#ifndef RTE_ETHDEV_RXTX_CALLBACKS
return -ENOTSUP;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 213fe27e1..d890fa7bc 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3004,6 +3004,8 @@ int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
int rte_eth_dev_get_dcb_info(uint16_t port_id,
struct rte_eth_dcb_info *dcb_info);
+struct rte_eth_rxtx_callback;
+
/**
* Add a callback to be called on packet RX on a given port and queue.
*
@@ -3028,7 +3030,8 @@ int rte_eth_dev_get_dcb_info(uint16_t port_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
+const struct rte_eth_rxtx_callback *
+rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param);
/**
@@ -3056,7 +3059,8 @@ void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
+const struct rte_eth_rxtx_callback *
+rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
rte_rx_callback_fn fn, void *user_param);
/**
@@ -3083,11 +3087,10 @@ void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
* NULL on error.
* On success, a pointer value which can later be used to remove the callback.
*/
-void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
+const struct rte_eth_rxtx_callback *
+rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
rte_tx_callback_fn fn, void *user_param);
-struct rte_eth_rxtx_callback;
-
/**
* Remove an RX packet callback from a given port and queue.
*
@@ -3119,7 +3122,7 @@ struct rte_eth_rxtx_callback;
* is NULL or not found for the port/queue.
*/
int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+ const struct rte_eth_rxtx_callback *user_cb);
/**
* Remove a TX packet callback from a given port and queue.
@@ -3152,7 +3155,7 @@ int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
* is NULL or not found for the port/queue.
*/
int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
- struct rte_eth_rxtx_callback *user_cb);
+ const struct rte_eth_rxtx_callback *user_cb);
/**
* Retrieve information about given port's RX queue.
diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c
index 66330203c..fc9497659 100644
--- a/lib/librte_latencystats/rte_latencystats.c
+++ b/lib/librte_latencystats/rte_latencystats.c
@@ -46,7 +46,7 @@ struct rte_latency_stats {
static struct rte_latency_stats *glob_stats;
struct rxtx_cbs {
- struct rte_eth_rxtx_callback *cb;
+ const struct rte_eth_rxtx_callback *cb;
};
static struct rxtx_cbs rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index ec8a5d84c..4fb0b4204 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -75,7 +75,7 @@ struct pdump_response {
static struct pdump_rxtx_cbs {
struct rte_ring *ring;
struct rte_mempool *mp;
- struct rte_eth_rxtx_callback *cb;
+ const struct rte_eth_rxtx_callback *cb;
void *filter;
} rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];
--
2.13.6
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v5] ethdev: return named opaque type instead of void pointer
2018-03-20 16:34 ` [dpdk-dev] [PATCH v5] " Ferruh Yigit
@ 2018-03-21 13:04 ` Neil Horman
2018-03-23 17:00 ` Bruce Richardson
2018-03-27 19:10 ` Ferruh Yigit
0 siblings, 2 replies; 76+ messages in thread
From: Neil Horman @ 2018-03-21 13:04 UTC (permalink / raw)
To: Ferruh Yigit
Cc: John McNamara, Marko Kovacevic, Thomas Monjalon, Reshma Pattan, dev
On Tue, Mar 20, 2018 at 04:34:04PM +0000, Ferruh Yigit wrote:
> "struct rte_eth_rxtx_callback" is defined as internal data structure and
> used as named opaque type.
>
> So the functions that are adding callbacks can return objects in this
> type instead of void pointer.
>
> Also const qualifier added to "struct rte_eth_rxtx_callback *" to
> protect it better from application modification.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> v2:
> * keep using struct * in parameters, instead add callback functions
> return struct rte_eth_rxtx_callback pointer.
>
> v4:
> * Remove deprecation notice. LIBABIVER already increased in this release
>
> v5:
> * add const qualifier to rte_eth_rxtx_callback
I still wish we could find a way to remove the inline functions and truly
protect that struct, but a const is definately better than nothing
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v5] ethdev: return named opaque type instead of void pointer
2018-03-21 13:04 ` Neil Horman
@ 2018-03-23 17:00 ` Bruce Richardson
2018-03-24 2:08 ` Neil Horman
2018-03-27 19:10 ` Ferruh Yigit
1 sibling, 1 reply; 76+ messages in thread
From: Bruce Richardson @ 2018-03-23 17:00 UTC (permalink / raw)
To: Neil Horman
Cc: Ferruh Yigit, John McNamara, Marko Kovacevic, Thomas Monjalon,
Reshma Pattan, dev
On Wed, Mar 21, 2018 at 09:04:01AM -0400, Neil Horman wrote:
> On Tue, Mar 20, 2018 at 04:34:04PM +0000, Ferruh Yigit wrote:
> > "struct rte_eth_rxtx_callback" is defined as internal data structure and
> > used as named opaque type.
> >
> > So the functions that are adding callbacks can return objects in this
> > type instead of void pointer.
> >
> > Also const qualifier added to "struct rte_eth_rxtx_callback *" to
> > protect it better from application modification.
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> > v2:
> > * keep using struct * in parameters, instead add callback functions
> > return struct rte_eth_rxtx_callback pointer.
> >
> > v4:
> > * Remove deprecation notice. LIBABIVER already increased in this release
> >
> > v5:
> > * add const qualifier to rte_eth_rxtx_callback
> I still wish we could find a way to remove the inline functions and truly
> protect that struct, but a const is definately better than nothing
>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
>
Actually, I think we should do exactly that - convert the rx and tx burst
calls into actual function calls (and consider any other inlined functions
too). The cost would be the overhead of making an additional function call
per-burst, which is likely to be pretty minimal for most common burst sizes
e.g. 32.
We did some quick tests here with the i40e driver, and for a burst size of
32 saw less than 1% perf drop, and for even a small burst of 8 saw less
than 5% drop. Note that this is testing with testpmd, which has nothing but
I/O in the datapath. A real-world app is likely to do far more with the
packets and therefore see proportionally far less perf hit.
Thoughts?
/Bruce
PS: This un-inlining could probably be applied to other device types too,
e.g. cryptodev (though probably not eventdev as it tends to have smaller
bursts in some use-cases).
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v5] ethdev: return named opaque type instead of void pointer
2018-03-23 17:00 ` Bruce Richardson
@ 2018-03-24 2:08 ` Neil Horman
2018-03-26 8:47 ` Ananyev, Konstantin
0 siblings, 1 reply; 76+ messages in thread
From: Neil Horman @ 2018-03-24 2:08 UTC (permalink / raw)
To: Bruce Richardson
Cc: Ferruh Yigit, John McNamara, Marko Kovacevic, Thomas Monjalon,
Reshma Pattan, dev
On Fri, Mar 23, 2018 at 05:00:34PM +0000, Bruce Richardson wrote:
> On Wed, Mar 21, 2018 at 09:04:01AM -0400, Neil Horman wrote:
> > On Tue, Mar 20, 2018 at 04:34:04PM +0000, Ferruh Yigit wrote:
> > > "struct rte_eth_rxtx_callback" is defined as internal data structure and
> > > used as named opaque type.
> > >
> > > So the functions that are adding callbacks can return objects in this
> > > type instead of void pointer.
> > >
> > > Also const qualifier added to "struct rte_eth_rxtx_callback *" to
> > > protect it better from application modification.
> > >
> > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > ---
> > > v2:
> > > * keep using struct * in parameters, instead add callback functions
> > > return struct rte_eth_rxtx_callback pointer.
> > >
> > > v4:
> > > * Remove deprecation notice. LIBABIVER already increased in this release
> > >
> > > v5:
> > > * add const qualifier to rte_eth_rxtx_callback
> > I still wish we could find a way to remove the inline functions and truly
> > protect that struct, but a const is definately better than nothing
> >
> > Acked-by: Neil Horman <nhorman@tuxdriver.com>
> >
> Actually, I think we should do exactly that - convert the rx and tx burst
> calls into actual function calls (and consider any other inlined functions
> too). The cost would be the overhead of making an additional function call
> per-burst, which is likely to be pretty minimal for most common burst sizes
> e.g. 32.
>
> We did some quick tests here with the i40e driver, and for a burst size of
> 32 saw less than 1% perf drop, and for even a small burst of 8 saw less
> than 5% drop. Note that this is testing with testpmd, which has nothing but
> I/O in the datapath. A real-world app is likely to do far more with the
> packets and therefore see proportionally far less perf hit.
>
> Thoughts?
>
> /Bruce
>
> PS: This un-inlining could probably be applied to other device types too,
> e.g. cryptodev (though probably not eventdev as it tends to have smaller
> bursts in some use-cases).
>
I would be 1000% on board with this conversion.
Best
Neil
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v5] ethdev: return named opaque type instead of void pointer
2018-03-24 2:08 ` Neil Horman
@ 2018-03-26 8:47 ` Ananyev, Konstantin
0 siblings, 0 replies; 76+ messages in thread
From: Ananyev, Konstantin @ 2018-03-26 8:47 UTC (permalink / raw)
To: Neil Horman, Richardson, Bruce
Cc: Yigit, Ferruh, Mcnamara, John, Kovacevic, Marko, Thomas Monjalon,
Pattan, Reshma, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Saturday, March 24, 2018 2:09 AM
> To: Richardson, Bruce <bruce.richardson@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>; Thomas Monjalon <thomas@monjalon.net>; Pattan, Reshma <reshma.pattan@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v5] ethdev: return named opaque type instead of void pointer
>
> On Fri, Mar 23, 2018 at 05:00:34PM +0000, Bruce Richardson wrote:
> > On Wed, Mar 21, 2018 at 09:04:01AM -0400, Neil Horman wrote:
> > > On Tue, Mar 20, 2018 at 04:34:04PM +0000, Ferruh Yigit wrote:
> > > > "struct rte_eth_rxtx_callback" is defined as internal data structure and
> > > > used as named opaque type.
> > > >
> > > > So the functions that are adding callbacks can return objects in this
> > > > type instead of void pointer.
> > > >
> > > > Also const qualifier added to "struct rte_eth_rxtx_callback *" to
> > > > protect it better from application modification.
> > > >
> > > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > > > ---
> > > > v2:
> > > > * keep using struct * in parameters, instead add callback functions
> > > > return struct rte_eth_rxtx_callback pointer.
> > > >
> > > > v4:
> > > > * Remove deprecation notice. LIBABIVER already increased in this release
> > > >
> > > > v5:
> > > > * add const qualifier to rte_eth_rxtx_callback
> > > I still wish we could find a way to remove the inline functions and truly
> > > protect that struct, but a const is definately better than nothing
> > >
> > > Acked-by: Neil Horman <nhorman@tuxdriver.com>
> > >
> > Actually, I think we should do exactly that - convert the rx and tx burst
> > calls into actual function calls (and consider any other inlined functions
> > too). The cost would be the overhead of making an additional function call
> > per-burst, which is likely to be pretty minimal for most common burst sizes
> > e.g. 32.
> >
> > We did some quick tests here with the i40e driver, and for a burst size of
> > 32 saw less than 1% perf drop, and for even a small burst of 8 saw less
> > than 5% drop. Note that this is testing with testpmd, which has nothing but
> > I/O in the datapath. A real-world app is likely to do far more with the
> > packets and therefore see proportionally far less perf hit.
> >
> > Thoughts?
> >
> > /Bruce
> >
> > PS: This un-inlining could probably be applied to other device types too,
> > e.g. cryptodev (though probably not eventdev as it tends to have smaller
> > bursts in some use-cases).
> >
> I would be 1000% on board with this conversion.
+1 from me too.
It would allow to greatly simplify support and further development for ethdev.
Konstantin
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v4] ethdev: fix port id storage
2018-03-09 12:58 ` Thomas Monjalon
@ 2018-03-26 20:25 ` Ferruh Yigit
0 siblings, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-03-26 20:25 UTC (permalink / raw)
To: Thomas Monjalon
Cc: Neil Horman, John McNamara, Marko Kovacevic, dev, stable,
declan.doherty, Boris Pismenny, Aviad Yehezkel, Radu Nicolau
On 3/9/2018 12:58 PM, Thomas Monjalon wrote:
> 09/03/2018 12:27, Ferruh Yigit:
>> port_id is now 16bits, update function parameter according.
>>
>> Fixes: 4c270218aa26 ("ethdev: support security APIs")
>> Cc: stable@dpdk.org
>> Cc: declan.doherty@intel.com
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 76+ messages in thread
* Re: [dpdk-dev] [PATCH v5] ethdev: return named opaque type instead of void pointer
2018-03-21 13:04 ` Neil Horman
2018-03-23 17:00 ` Bruce Richardson
@ 2018-03-27 19:10 ` Ferruh Yigit
1 sibling, 0 replies; 76+ messages in thread
From: Ferruh Yigit @ 2018-03-27 19:10 UTC (permalink / raw)
To: Neil Horman
Cc: John McNamara, Marko Kovacevic, Thomas Monjalon, Reshma Pattan, dev
On 3/21/2018 1:04 PM, Neil Horman wrote:
> On Tue, Mar 20, 2018 at 04:34:04PM +0000, Ferruh Yigit wrote:
>> "struct rte_eth_rxtx_callback" is defined as internal data structure and
>> used as named opaque type.
>>
>> So the functions that are adding callbacks can return objects in this
>> type instead of void pointer.
>>
>> Also const qualifier added to "struct rte_eth_rxtx_callback *" to
>> protect it better from application modification.
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> v2:
>> * keep using struct * in parameters, instead add callback functions
>> return struct rte_eth_rxtx_callback pointer.
>>
>> v4:
>> * Remove deprecation notice. LIBABIVER already increased in this release
>>
>> v5:
>> * add const qualifier to rte_eth_rxtx_callback
> I still wish we could find a way to remove the inline functions and truly
> protect that struct, but a const is definately better than nothing
>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 76+ messages in thread
end of thread, other threads:[~2018-03-27 19:10 UTC | newest]
Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-01 2:29 [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 2/7] ethdev: fix port id storage Ferruh Yigit
2017-12-01 9:01 ` Hemant Agrawal
2017-12-01 23:52 ` Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 3/7] ethdev: separate driver APIs Ferruh Yigit
2017-12-01 6:24 ` Shreyansh Jain
2017-12-01 8:59 ` Hemant Agrawal
2017-12-01 23:51 ` Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 4/7] ethdev: separate internal structures into own header Ferruh Yigit
2017-12-01 5:44 ` Hemant Agrawal
2017-12-01 2:29 ` [dpdk-dev] [PATCH 5/7] ethdev: reorder inline functions Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 6/7] ethdev: rename function parameter for consistency Ferruh Yigit
2017-12-01 2:29 ` [dpdk-dev] [PATCH 7/7] ethdev: use opaque user callback object Ferruh Yigit
2017-12-01 10:33 ` Bruce Richardson
2017-12-01 11:22 ` Ananyev, Konstantin
2017-12-01 13:17 ` Bruce Richardson
2017-12-01 23:51 ` Ferruh Yigit
2017-12-04 10:31 ` Bruce Richardson
2017-12-04 17:49 ` Ferruh Yigit
[not found] ` <49eb13f1-e12f-071a-b58b-1cd4852b7c8b@scylladb.com>
2017-12-01 22:30 ` [dpdk-dev] [PATCH 1/7] ethdev: remove unused flag from header Vlad Zolotarov
2017-12-01 23:51 ` Ferruh Yigit
2017-12-02 2:22 ` Vlad Zolotarov
2017-12-04 17:54 ` Ferruh Yigit
2017-12-04 19:37 ` Vlad Zolotarov
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 1/6] ethdev: fix port id storage Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 2/6] ethdev: separate driver APIs Ferruh Yigit
2018-01-09 19:19 ` Andrew Rybchenko
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 3/6] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 4/6] ethdev: reorder inline functions Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 5/6] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-09 16:23 ` [dpdk-dev] [PATCH v2 6/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
2018-01-09 18:55 ` Stephen Hemminger
2018-01-09 18:58 ` Stephen Hemminger
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Ferruh Yigit
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 2/6] ethdev: return named opaque type instead of void pointer Ferruh Yigit
2018-01-17 22:11 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-01-18 10:09 ` Ferruh Yigit
2018-03-09 11:25 ` [dpdk-dev] [PATCH v4] " Ferruh Yigit
[not found] ` <20180309123651.GB19004@hmswarspite.think-freely.org>
2018-03-09 13:00 ` Ferruh Yigit
2018-03-09 15:16 ` Neil Horman
2018-03-09 15:45 ` Ferruh Yigit
2018-03-09 19:06 ` Neil Horman
2018-03-20 15:51 ` Ferruh Yigit
2018-03-20 16:34 ` [dpdk-dev] [PATCH v5] " Ferruh Yigit
2018-03-21 13:04 ` Neil Horman
2018-03-23 17:00 ` Bruce Richardson
2018-03-24 2:08 ` Neil Horman
2018-03-26 8:47 ` Ananyev, Konstantin
2018-03-27 19:10 ` Ferruh Yigit
2018-01-17 21:57 ` [dpdk-dev] [PATCH v3 3/6] ethdev: separate driver APIs Ferruh Yigit
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 4/6] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-17 22:24 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-01-18 10:09 ` Ferruh Yigit
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 5/6] ethdev: reorder inline functions Ferruh Yigit
2018-01-17 21:58 ` [dpdk-dev] [PATCH v3 6/6] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-17 22:09 ` [dpdk-dev] [PATCH v3 1/6] ethdev: fix port id storage Thomas Monjalon
2018-01-17 22:19 ` Thomas Monjalon
2018-01-18 10:15 ` Ferruh Yigit
2018-01-18 11:29 ` Thomas Monjalon
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 3/4] ethdev: reorder inline functions Ferruh Yigit
2018-01-20 16:57 ` [dpdk-dev] [PATCH v4 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-21 23:12 ` [dpdk-dev] [PATCH v4 1/4] ethdev: separate driver APIs Thomas Monjalon
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 " Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 3/4] ethdev: reorder inline functions Ferruh Yigit
2018-01-21 23:35 ` [dpdk-dev] [PATCH v5 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 2/4] ethdev: separate internal structures into own header Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 3/4] ethdev: reorder inline functions Ferruh Yigit
2018-01-22 0:16 ` [dpdk-dev] [PATCH v6 4/4] ethdev: rename function parameter for consistency Ferruh Yigit
2018-01-22 0:51 ` [dpdk-dev] [PATCH v6 1/4] ethdev: separate driver APIs Thomas Monjalon
2018-03-09 11:27 ` [dpdk-dev] [PATCH v4] ethdev: fix port id storage Ferruh Yigit
2018-03-09 12:58 ` Thomas Monjalon
2018-03-26 20:25 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).