ethdev: remove unused flag from header
Subsystems (3)
PATCH v3 3/6 ethdev: separate driver APIs
In reply to Ferruh YigitCreate 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.
---
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 +- drivers/net/mlx5/mlx5_rss.c | 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
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -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>
drivers/bus/dpaa/include/fman.h +1 -1
@@ -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>
drivers/bus/fslmc/fslmc_bus.c +1 -1
@@ -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>
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +1 -1
@@ -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>
drivers/event/dpaa2/dpaa2_eventdev.c +1 -1
@@ -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>
drivers/event/dpaa2/dpaa2_hw_dpcon.c +1 -1
@@ -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>
drivers/event/octeontx/ssovf_evdev.c +1 -1
@@ -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>
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +1 -1
@@ -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>
drivers/net/af_packet/rte_eth_af_packet.c +1 -1
@@ -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>
drivers/net/ark/ark_ethdev_rx.h +1 -1
@@ -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,
drivers/net/ark/ark_ethdev_tx.h +1 -1
@@ -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,
drivers/net/ark/ark_ext.h +1 -1
@@ -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
drivers/net/ark/ark_global.h +1 -1
@@ -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>
drivers/net/ark/ark_pktchkr.c +1 -1
@@ -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"
drivers/net/ark/ark_pktgen.c +1 -1
@@ -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"
drivers/net/avf/avf_ethdev.c +1 -1
@@ -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>
drivers/net/avf/avf_rxtx.c +1 -1
@@ -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>
drivers/net/avf/avf_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/avf/avf_rxtx_vec_sse.c +1 -1
@@ -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"
drivers/net/avf/avf_vchnl.c +1 -1
@@ -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"
drivers/net/avp/avp_ethdev.c +1 -1
@@ -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>
drivers/net/bnx2x/bnx2x_ethdev.h +1 -1
@@ -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>
drivers/net/bnxt/bnxt.h +1 -1
@@ -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>
drivers/net/bnxt/bnxt_ethdev.c +1 -1
@@ -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>
drivers/net/bnxt/bnxt_stats.h +1 -1
@@ -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,
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
@@ -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>
drivers/net/bnxt/rte_pmd_bnxt.h +1 -1
@@ -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
drivers/net/bonding/rte_eth_bond_api.c +1 -1
@@ -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>
drivers/net/bonding/rte_eth_bond_pmd.c +1 -1
@@ -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>
drivers/net/bonding/rte_eth_bond_private.h +1 -1
@@ -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>
drivers/net/cxgbe/base/t4_hw.c +1 -1
@@ -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>
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -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>
drivers/net/cxgbe/cxgbe_main.c +1 -1
@@ -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>
drivers/net/cxgbe/sge.c +1 -1
@@ -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>
drivers/net/dpaa/dpaa_ethdev.c +1 -1
@@ -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>
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -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>
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -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>
drivers/net/dpaa/rte_pmd_dpaa.h +1 -1
@@ -15,7 +15,7 @@* */ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> /** * @warning
drivers/net/dpaa2/base/dpaa2_hw_dpni.c +1 -1
@@ -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>
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -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>
drivers/net/dpaa2/dpaa2_rxtx.c +1 -1
@@ -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>
drivers/net/e1000/em_ethdev.c +1 -1
@@ -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>
drivers/net/e1000/em_rxtx.c +1 -1
@@ -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>
drivers/net/e1000/igb_ethdev.c +1 -1
@@ -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>
drivers/net/e1000/igb_flow.c +1 -1
@@ -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>
drivers/net/e1000/igb_pf.c +1 -1
@@ -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>
drivers/net/e1000/igb_rxtx.c +1 -1
@@ -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>
drivers/net/ena/ena_ethdev.c +1 -1
@@ -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>
drivers/net/enic/enic_clsf.c +1 -1
@@ -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>
drivers/net/enic/enic_ethdev.c +1 -1
@@ -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>
drivers/net/enic/enic_flow.c +1 -1
@@ -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>
drivers/net/enic/enic_main.c +1 -1
@@ -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"
drivers/net/enic/enic_res.c +1 -1
@@ -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"
drivers/net/enic/enic_rxtx.c +1 -1
@@ -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"
drivers/net/failsafe/failsafe.c +1 -1
@@ -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>
drivers/net/failsafe/failsafe_ops.c +1 -1
@@ -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>
drivers/net/failsafe/failsafe_private.h +1 -1
@@ -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"
drivers/net/failsafe/failsafe_rxtx.c +1 -1
@@ -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"
drivers/net/fm10k/fm10k_ethdev.c +1 -1
@@ -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>
drivers/net/fm10k/fm10k_rxtx.c +1 -1
@@ -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"
drivers/net/fm10k/fm10k_rxtx_vec.c +1 -1
@@ -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"
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -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>
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
@@ -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>
drivers/net/i40e/i40e_fdir.c +1 -1
@@ -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>
drivers/net/i40e/i40e_flow.c +1 -1
@@ -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>
drivers/net/i40e/i40e_pf.c +1 -1
@@ -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>
drivers/net/i40e/i40e_rxtx.c +1 -1
@@ -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>
drivers/net/i40e/i40e_rxtx_vec_altivec.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_avx2.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_neon.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_sse.c +1 -1
@@ -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"
drivers/net/i40e/rte_pmd_i40e.h +1 -1
@@ -14,7 +14,7 @@* */ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> /** * Response sent back to i40e driver from user app after callback
drivers/net/ixgbe/ixgbe_bypass.c +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_fdir.c +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_flow.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_ipsec.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_pf.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_malloc.h> #include "ixgbe_ethdev.h"
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_malloc.h> #include "ixgbe_ethdev.h"
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
@@ -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"
drivers/net/ixgbe/rte_pmd_ixgbe.h +1 -1
@@ -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.
drivers/net/kni/rte_eth_kni.c +1 -1
@@ -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>
drivers/net/liquidio/base/lio_23xx_vf.c +1 -1
@@ -4,7 +4,7 @@#include <string.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_cycles.h> #include <rte_malloc.h>
drivers/net/liquidio/base/lio_mbox.c +1 -1
@@ -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"
drivers/net/liquidio/lio_ethdev.c +1 -1
@@ -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>
drivers/net/liquidio/lio_rxtx.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_ethdev.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_flow.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_flow.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_intr.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_rxq.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_rxtx.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_txq.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5.h +1 -1
@@ -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>
drivers/net/mlx5/mlx5_defs.h +1 -1
@@ -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"
drivers/net/mlx5/mlx5_ethdev.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_mac.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rss.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rxmode.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_stats.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_trigger.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_txq.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_vlan.c +1 -1
@@ -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"
drivers/net/mrvl/mrvl_ethdev.c +1 -1
@@ -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>
drivers/net/nfp/nfp_net.c +1 -1
@@ -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>
drivers/net/null/rte_eth_null.c +1 -1
@@ -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>
drivers/net/octeontx/octeontx_ethdev.h +1 -1
@@ -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>
drivers/net/octeontx/octeontx_rxtx.c +1 -1
@@ -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>
drivers/net/octeontx/octeontx_rxtx.h +1 -1
@@ -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))
drivers/net/pcap/rte_eth_pcap.c +1 -1
@@ -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>
drivers/net/qede/qede_ethdev.h +1 -1
@@ -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>
drivers/net/ring/rte_eth_ring.c +1 -1
@@ -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>
drivers/net/sfc/sfc.h +1 -1
@@ -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>
drivers/net/sfc/sfc_dp_rx.h +1 -1
@@ -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"
drivers/net/sfc/sfc_dp_tx.h +1 -1
@@ -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"
drivers/net/sfc/sfc_ethdev.c +1 -1
@@ -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>
drivers/net/sfc/sfc_ev.h +1 -1
@@ -10,7 +10,7 @@#ifndef _SFC_EV_H_#define _SFC_EV_H_ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/sfc/sfc_flow.c +1 -1
@@ -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>
drivers/net/sfc/sfc_rx.h +1 -1
@@ -12,7 +12,7 @@#include <rte_mbuf.h> #include <rte_mempool.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/sfc/sfc_tx.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_TX_H#include <rte_mbuf.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/softnic/rte_eth_softnic.c +1 -1
@@ -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>
drivers/net/softnic/rte_eth_softnic_internals.h +1 -1
@@ -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"
drivers/net/szedata2/rte_eth_szedata2.c +1 -1
@@ -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>
drivers/net/tap/rte_eth_tap.c +1 -1
@@ -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>
drivers/net/tap/rte_eth_tap.h +1 -1
@@ -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
drivers/net/thunderx/nicvf_ethdev.c +1 -1
@@ -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>
drivers/net/thunderx/nicvf_ethdev.h +1 -1
@@ -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
drivers/net/thunderx/nicvf_rxtx.c +1 -1
@@ -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>
drivers/net/thunderx/nicvf_rxtx.h +1 -1
@@ -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)
drivers/net/thunderx/nicvf_struct.h +1 -1
@@ -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 {
drivers/net/vhost/rte_eth_vhost.c +1 -1
@@ -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>
drivers/net/virtio/virtio_ethdev.c +1 -1
@@ -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>
drivers/net/virtio/virtio_pci.h +1 -1
@@ -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 ;
drivers/net/virtio/virtio_rxtx.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple_neon.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple_sse.c +1 -1
@@ -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>
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -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>
drivers/net/vmxnet3/vmxnet3_rxtx.c +1 -1
@@ -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>
lib/librte_ether/Makefile +1 -0
@@ -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
lib/librte_ether/rte_ethdev.c +1 -0
@@ -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" ;
lib/librte_ether/rte_ethdev.h +4 -108
142 lines not on this page · raw message
lib/librte_ether/rte_ethdev_driver.h new file +132 -0
132 lines not on this page · raw message
lib/librte_ether/rte_ethdev_pci.h +1 -1
@@ -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.
lib/librte_ether/rte_ethdev_vdev.h +1 -1
@@ -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
Signature · 1 line
2.14.3
PATCH v3 4/6 ethdev: separate internal structures into own header
In reply to Ferruh Yigitrte_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.
--- 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
lib/librte_ether/Makefile +1 -0
@@ -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
lib/librte_ether/rte_ethdev.h +1 -578
609 lines not on this page · raw message
lib/librte_ether/rte_ethdev_core.h new file +619 -0
619 lines not on this page · raw message
Signature · 1 line
2.14.3
Re: [dpdk-stable] [PATCH v3 4/6] ethdev: separate internal structures into own header
17/01/2018 22:58, Ferruh Yigit:
Quoted 31 lines
+/*-
+ * 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.
Quoted 1 line
+ */
SPDX tag requirement spotted :)
lib/librte_ether/rte_ethdev_core.h line 40
Quoted 7 lines
lib/librte_ether/rte_ethdev_core.h new file +7
-0+#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.
Re: [dpdk-stable] [PATCH v3 4/6] ethdev: separate internal structures into own header
Quoted 34 lines · Thomas Monjalon
17/01/2018 22:58, Ferruh Yigit:
Quoted 31 lines
+/*-
+ * 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.Quoted 1 line
+ */
Quoted 1 line
SPDX tag requirement spotted :)
Will fix.
Quoted 11 lines
lib/librte_ether/rte_ethdev_core.h line 40
Quoted 8 lines
lib/librte_ether/rte_ethdev_core.h new file +7
-0+#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
Quoted 1 line
PATCH v3 5/6 ethdev: reorder inline functions
In reply to Ferruh YigitMove 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.
--- lib/librte_ether/rte_ethdev.h | 2704 +++++++++++++++++++++-------------------- 1 file changed, 1353 insertions(+), 1351 deletions(-)
lib/librte_ether/rte_ethdev.h +1353 -1351
@@ -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)) {
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.14.3
Part of the diff is not shown here. View the raw message.
PATCH v3 6/6 ethdev: rename function parameter for consistency
In reply to Ferruh YigitUpdate "port" function argument variable to "port_id" in public header to be consistent in all APIs.
No functional change.
--- lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)
lib/librte_ether/rte_ethdev.h +19 -19
@@ -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
Signature · 1 line
2.14.3
Re: [PATCH v3 1/6] ethdev: fix port id storage
In reply to Ferruh Yigit17/01/2018 22:57, Ferruh Yigit:
Quoted 8 lines
port_idis now 16bits, update function parameter according.Signed-off-by Ferruh Yigit <[email protected]>Acked-by Hemant Agrawal <[email protected]>
Obviously,
Re: [PATCH v3 1/6] ethdev: fix port id storage
17/01/2018 23:09, Thomas Monjalon:
Quoted 7 lines
17/01/2018 22:57, Ferruh Yigit:
Quoted 6 lines
port_idis now 16bits, update function parameter according.
Quoted 5 lines
Quoted 2 lines
Signed-off-by Ferruh Yigit <[email protected]>Acked-by Hemant Agrawal <[email protected]>Obviously,
Acked-by Thomas Monjalon <[email protected]>
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.
Re: [PATCH v3 1/6] ethdev: fix port id storage
Quoted 8 lines · Thomas Monjalon
17/01/2018 23:09, Thomas Monjalon:
Quoted 7 lines
17/01/2018 22:57, Ferruh Yigit:
Quoted 6 lines
port_idis now 16bits, update function parameter according.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Ferruh Yigit <[email protected]>Acked-by Hemant Agrawal <[email protected]>Obviously,
Acked-by Thomas Monjalon <[email protected]>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.
Quoted 4 lines
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
Quoted 3 lines
And the function was placed randomly in the middle of struct declarations! One more proof of the poor quality of
rte_securitystuff.
Re: [PATCH v3 1/6] ethdev: fix port id storage
18/01/2018 11:15, Ferruh Yigit:
Quoted 15 lines · Thomas Monjalon
Quoted 14 lines
17/01/2018 23:09, Thomas Monjalon:
Quoted 12 lines
17/01/2018 22:57, Ferruh Yigit:
Quoted 8 lines
port_idis now 16bits, update function parameter according.Signed-off-by Ferruh Yigit <[email protected]>Acked-by Hemant Agrawal <[email protected]>Obviously,
Acked-by Thomas Monjalon <[email protected]>
Quoted 11 lines
Quoted 2 lines
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 forport_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.
Quoted 2 lines
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.
PATCH v4 1/4 ethdev: separate driver APIs
In reply to Ferruh YigitCreate 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.
---
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 +- drivers/net/mlx5/mlx5_rss.c | 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
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -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>
drivers/bus/dpaa/include/fman.h +1 -1
@@ -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>
drivers/bus/fslmc/fslmc_bus.c +1 -1
@@ -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>
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +1 -1
@@ -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>
drivers/event/dpaa2/dpaa2_eventdev.c +1 -1
@@ -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>
drivers/event/dpaa2/dpaa2_hw_dpcon.c +1 -1
@@ -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>
drivers/event/octeontx/ssovf_evdev.c +1 -1
@@ -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>
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +1 -1
@@ -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>
drivers/net/af_packet/rte_eth_af_packet.c +1 -1
@@ -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>
drivers/net/ark/ark_ethdev_rx.h +1 -1
@@ -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,
drivers/net/ark/ark_ethdev_tx.h +1 -1
@@ -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,
drivers/net/ark/ark_ext.h +1 -1
@@ -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
drivers/net/ark/ark_global.h +1 -1
@@ -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>
drivers/net/ark/ark_pktchkr.c +1 -1
@@ -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"
drivers/net/ark/ark_pktgen.c +1 -1
@@ -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"
drivers/net/avf/avf_ethdev.c +1 -1
@@ -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>
drivers/net/avf/avf_rxtx.c +1 -1
@@ -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>
drivers/net/avf/avf_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/avf/avf_rxtx_vec_sse.c +1 -1
@@ -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"
drivers/net/avf/avf_vchnl.c +1 -1
@@ -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"
drivers/net/avp/avp_ethdev.c +1 -1
@@ -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>
drivers/net/bnx2x/bnx2x_ethdev.h +1 -1
@@ -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>
drivers/net/bnxt/bnxt.h +1 -1
@@ -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>
drivers/net/bnxt/bnxt_ethdev.c +1 -1
@@ -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>
drivers/net/bnxt/bnxt_stats.h +1 -1
@@ -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,
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
@@ -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>
drivers/net/bnxt/rte_pmd_bnxt.h +1 -1
@@ -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
drivers/net/bonding/rte_eth_bond_api.c +1 -1
@@ -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>
drivers/net/bonding/rte_eth_bond_pmd.c +1 -1
@@ -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>
drivers/net/bonding/rte_eth_bond_private.h +1 -1
@@ -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>
drivers/net/cxgbe/base/t4_hw.c +1 -1
@@ -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>
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -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>
drivers/net/cxgbe/cxgbe_main.c +1 -1
@@ -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>
drivers/net/cxgbe/sge.c +1 -1
@@ -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>
drivers/net/dpaa/dpaa_ethdev.c +1 -1
@@ -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>
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -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>
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -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>
drivers/net/dpaa/rte_pmd_dpaa.h +1 -1
@@ -15,7 +15,7 @@* */ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> /** * @warning
drivers/net/dpaa2/base/dpaa2_hw_dpni.c +1 -1
@@ -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>
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -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>
drivers/net/dpaa2/dpaa2_rxtx.c +1 -1
@@ -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>
drivers/net/e1000/em_ethdev.c +1 -1
@@ -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>
drivers/net/e1000/em_rxtx.c +1 -1
@@ -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>
drivers/net/e1000/igb_ethdev.c +1 -1
@@ -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>
drivers/net/e1000/igb_flow.c +1 -1
@@ -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>
drivers/net/e1000/igb_pf.c +1 -1
@@ -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>
drivers/net/e1000/igb_rxtx.c +1 -1
@@ -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>
drivers/net/ena/ena_ethdev.c +1 -1
@@ -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>
drivers/net/enic/enic_clsf.c +1 -1
@@ -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>
drivers/net/enic/enic_ethdev.c +1 -1
@@ -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>
drivers/net/enic/enic_flow.c +1 -1
@@ -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>
drivers/net/enic/enic_main.c +1 -1
@@ -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"
drivers/net/enic/enic_res.c +1 -1
@@ -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"
drivers/net/enic/enic_rxtx.c +1 -1
@@ -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"
drivers/net/failsafe/failsafe.c +1 -1
@@ -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>
drivers/net/failsafe/failsafe_ops.c +1 -1
@@ -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>
drivers/net/failsafe/failsafe_private.h +1 -1
@@ -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"
drivers/net/failsafe/failsafe_rxtx.c +1 -1
@@ -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"
drivers/net/fm10k/fm10k_ethdev.c +1 -1
@@ -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>
drivers/net/fm10k/fm10k_rxtx.c +1 -1
@@ -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"
drivers/net/fm10k/fm10k_rxtx_vec.c +1 -1
@@ -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"
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -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>
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
@@ -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>
drivers/net/i40e/i40e_fdir.c +1 -1
@@ -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>
drivers/net/i40e/i40e_flow.c +1 -1
@@ -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>
drivers/net/i40e/i40e_pf.c +1 -1
@@ -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>
drivers/net/i40e/i40e_rxtx.c +1 -1
@@ -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>
drivers/net/i40e/i40e_rxtx_vec_altivec.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_avx2.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_neon.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_sse.c +1 -1
@@ -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"
drivers/net/i40e/rte_pmd_i40e.h +1 -1
@@ -14,7 +14,7 @@* */ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> /** * Response sent back to i40e driver from user app after callback
drivers/net/ixgbe/ixgbe_bypass.c +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_fdir.c +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_flow.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_ipsec.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_pf.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_malloc.h> #include "ixgbe_ethdev.h"
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_malloc.h> #include "ixgbe_ethdev.h"
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
@@ -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"
drivers/net/ixgbe/rte_pmd_ixgbe.h +1 -1
@@ -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.
drivers/net/kni/rte_eth_kni.c +1 -1
@@ -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>
drivers/net/liquidio/base/lio_23xx_vf.c +1 -1
@@ -4,7 +4,7 @@#include <string.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_cycles.h> #include <rte_malloc.h>
drivers/net/liquidio/base/lio_mbox.c +1 -1
@@ -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"
drivers/net/liquidio/lio_ethdev.c +1 -1
@@ -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>
drivers/net/liquidio/lio_rxtx.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_ethdev.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_flow.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_flow.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_intr.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_rxq.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_rxtx.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_txq.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5.h +1 -1
@@ -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>
drivers/net/mlx5/mlx5_defs.h +1 -1
@@ -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"
drivers/net/mlx5/mlx5_ethdev.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_mac.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rss.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rxmode.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_stats.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_trigger.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_txq.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_vlan.c +1 -1
@@ -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"
drivers/net/mrvl/mrvl_ethdev.c +1 -1
@@ -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>
drivers/net/nfp/nfp_net.c +1 -1
@@ -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>
drivers/net/null/rte_eth_null.c +1 -1
@@ -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>
drivers/net/octeontx/octeontx_ethdev.h +1 -1
@@ -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>
drivers/net/octeontx/octeontx_rxtx.c +1 -1
@@ -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>
drivers/net/octeontx/octeontx_rxtx.h +1 -1
@@ -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))
drivers/net/pcap/rte_eth_pcap.c +1 -1
@@ -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>
drivers/net/qede/qede_ethdev.h +1 -1
@@ -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>
drivers/net/ring/rte_eth_ring.c +1 -1
@@ -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>
drivers/net/sfc/sfc.h +1 -1
@@ -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>
drivers/net/sfc/sfc_dp_rx.h +1 -1
@@ -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"
drivers/net/sfc/sfc_dp_tx.h +1 -1
@@ -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"
drivers/net/sfc/sfc_ethdev.c +1 -1
@@ -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>
drivers/net/sfc/sfc_ev.h +1 -1
@@ -10,7 +10,7 @@#ifndef _SFC_EV_H_#define _SFC_EV_H_ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/sfc/sfc_flow.c +1 -1
@@ -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>
drivers/net/sfc/sfc_rx.h +1 -1
@@ -12,7 +12,7 @@#include <rte_mbuf.h> #include <rte_mempool.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/sfc/sfc_tx.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_TX_H#include <rte_mbuf.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/softnic/rte_eth_softnic.c +1 -1
@@ -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>
drivers/net/softnic/rte_eth_softnic_internals.h +1 -1
@@ -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"
drivers/net/szedata2/rte_eth_szedata2.c +1 -1
@@ -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>
drivers/net/tap/rte_eth_tap.c +1 -1
@@ -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>
drivers/net/tap/rte_eth_tap.h +1 -1
@@ -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
drivers/net/thunderx/nicvf_ethdev.c +1 -1
@@ -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>
drivers/net/thunderx/nicvf_ethdev.h +1 -1
@@ -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
drivers/net/thunderx/nicvf_rxtx.c +1 -1
@@ -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>
drivers/net/thunderx/nicvf_rxtx.h +1 -1
@@ -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)
drivers/net/thunderx/nicvf_struct.h +1 -1
@@ -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 {
drivers/net/vhost/rte_eth_vhost.c +1 -1
@@ -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>
drivers/net/virtio/virtio_ethdev.c +1 -1
@@ -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>
drivers/net/virtio/virtio_pci.h +1 -1
@@ -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 ;
drivers/net/virtio/virtio_rxtx.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple_neon.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple_sse.c +1 -1
@@ -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>
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -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>
drivers/net/vmxnet3/vmxnet3_rxtx.c +1 -1
@@ -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>
lib/librte_ether/Makefile +1 -0
@@ -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
lib/librte_ether/rte_ethdev.c +1 -0
@@ -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" ;
lib/librte_ether/rte_ethdev.h +4 -108
142 lines not on this page · raw message
lib/librte_ether/rte_ethdev_driver.h new file +132 -0
132 lines not on this page · raw message
lib/librte_ether/rte_ethdev_pci.h +1 -1
@@ -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.
lib/librte_ether/rte_ethdev_vdev.h +1 -1
@@ -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
Signature · 1 line
2.14.3
PATCH v4 2/4 ethdev: separate internal structures into own header
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.
--- 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
lib/librte_ether/Makefile +1 -0
@@ -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
lib/librte_ether/rte_ethdev.h +1 -578
609 lines not on this page · raw message
lib/librte_ether/rte_ethdev_core.h new file +602 -0
602 lines not on this page · raw message
Signature · 1 line
2.14.3
PATCH v4 3/4 ethdev: reorder inline functions
In reply to Ferruh YigitMove 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.
--- lib/librte_ether/rte_ethdev.h | 2694 +++++++++++++++++++++-------------------- 1 file changed, 1348 insertions(+), 1346 deletions(-)
lib/librte_ether/rte_ethdev.h +1348 -1346
@@ -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
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.14.3
Part of the diff is not shown here. View the raw message.
PATCH v4 4/4 ethdev: rename function parameter for consistency
In reply to Ferruh YigitUpdate "port" function argument variable to "port_id" in public header to be consistent in all APIs.
No functional change.
--- lib/librte_ether/rte_ethdev.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)
lib/librte_ether/rte_ethdev.h +19 -19
@@ -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
Signature · 1 line
2.14.3
Re: [PATCH v4 1/4] ethdev: separate driver APIs
In reply to Ferruh Yigit20/01/2018 17:57, Ferruh Yigit:
Quoted 8 lines
Create a
rte_ethdev_driver.hfile and move PMD specific APIs here. Drivers updated to include this new header file.There is no update in header content and since
ethdev.hincluded byethdev_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.
Quoted 6 lines
More PMD specific data structures still remain in
ethdev.hbecause of inline functions in header use them. Those will be handled separately.Signed-off-by Ferruh Yigit <[email protected]>Acked-by Shreyansh Jain <[email protected]>Acked-by Andrew Rybchenko <[email protected]>
It is really hard to review, especially patches 2 and 3. But I really like the idea, so
Series Acked-by: Thomas Monjalon <[email protected]>
Let's take this change in 18.02-rc1.
PATCH v5 1/4 ethdev: separate driver APIs
In reply to Ferruh YigitCreate 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.
---
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 +- drivers/net/mlx5/mlx5_rss.c | 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
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -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>
drivers/bus/dpaa/include/fman.h +1 -1
@@ -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>
drivers/bus/fslmc/fslmc_bus.c +1 -1
@@ -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>
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +1 -1
@@ -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>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +1 -1
@@ -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>
drivers/event/dpaa2/dpaa2_eventdev.c +1 -1
@@ -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>
drivers/event/dpaa2/dpaa2_hw_dpcon.c +1 -1
@@ -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>
drivers/event/octeontx/ssovf_evdev.c +1 -1
@@ -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>
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +1 -1
@@ -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>
drivers/net/af_packet/rte_eth_af_packet.c +1 -1
@@ -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>
drivers/net/ark/ark_ethdev_rx.h +1 -1
@@ -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,
drivers/net/ark/ark_ethdev_tx.h +1 -1
@@ -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,
drivers/net/ark/ark_ext.h +1 -1
@@ -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
drivers/net/ark/ark_global.h +1 -1
@@ -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>
drivers/net/ark/ark_pktchkr.c +1 -1
@@ -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"
drivers/net/ark/ark_pktgen.c +1 -1
@@ -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"
drivers/net/avf/avf_ethdev.c +1 -1
@@ -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>
drivers/net/avf/avf_rxtx.c +1 -1
@@ -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>
drivers/net/avf/avf_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/avf/avf_rxtx_vec_sse.c +1 -1
@@ -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"
drivers/net/avf/avf_vchnl.c +1 -1
@@ -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"
drivers/net/avp/avp_ethdev.c +1 -1
@@ -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>
drivers/net/bnx2x/bnx2x_ethdev.h +1 -1
@@ -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>
drivers/net/bnxt/bnxt.h +1 -1
@@ -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>
drivers/net/bnxt/bnxt_ethdev.c +1 -1
@@ -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>
drivers/net/bnxt/bnxt_stats.h +1 -1
@@ -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,
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
@@ -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>
drivers/net/bnxt/rte_pmd_bnxt.h +1 -1
@@ -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
drivers/net/bonding/rte_eth_bond_api.c +1 -1
@@ -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>
drivers/net/bonding/rte_eth_bond_pmd.c +1 -1
@@ -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>
drivers/net/bonding/rte_eth_bond_private.h +1 -1
@@ -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>
drivers/net/cxgbe/base/t4_hw.c +1 -1
@@ -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>
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -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>
drivers/net/cxgbe/cxgbe_main.c +1 -1
@@ -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>
drivers/net/cxgbe/sge.c +1 -1
@@ -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>
drivers/net/dpaa/dpaa_ethdev.c +1 -1
@@ -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>
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -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>
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -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>
drivers/net/dpaa/rte_pmd_dpaa.h +1 -1
@@ -15,7 +15,7 @@* */ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> /** * @warning
drivers/net/dpaa2/base/dpaa2_hw_dpni.c +1 -1
@@ -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>
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -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>
drivers/net/dpaa2/dpaa2_rxtx.c +1 -1
@@ -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>
drivers/net/e1000/em_ethdev.c +1 -1
@@ -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>
drivers/net/e1000/em_rxtx.c +1 -1
@@ -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>
drivers/net/e1000/igb_ethdev.c +1 -1
@@ -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>
drivers/net/e1000/igb_flow.c +1 -1
@@ -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>
drivers/net/e1000/igb_pf.c +1 -1
@@ -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>
drivers/net/e1000/igb_rxtx.c +1 -1
@@ -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>
drivers/net/ena/ena_ethdev.c +1 -1
@@ -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>
drivers/net/enic/enic_clsf.c +1 -1
@@ -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>
drivers/net/enic/enic_ethdev.c +1 -1
@@ -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>
drivers/net/enic/enic_flow.c +1 -1
@@ -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>
drivers/net/enic/enic_main.c +1 -1
@@ -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"
drivers/net/enic/enic_res.c +1 -1
@@ -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"
drivers/net/enic/enic_rxtx.c +1 -1
@@ -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"
drivers/net/failsafe/failsafe.c +1 -1
@@ -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>
drivers/net/failsafe/failsafe_ops.c +1 -1
@@ -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>
drivers/net/failsafe/failsafe_private.h +1 -1
@@ -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"
drivers/net/failsafe/failsafe_rxtx.c +1 -1
@@ -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"
drivers/net/fm10k/fm10k_ethdev.c +1 -1
@@ -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>
drivers/net/fm10k/fm10k_rxtx.c +1 -1
@@ -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"
drivers/net/fm10k/fm10k_rxtx_vec.c +1 -1
@@ -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"
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -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>
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
@@ -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>
drivers/net/i40e/i40e_fdir.c +1 -1
@@ -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>
drivers/net/i40e/i40e_flow.c +1 -1
@@ -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>
drivers/net/i40e/i40e_pf.c +1 -1
@@ -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>
drivers/net/i40e/i40e_rxtx.c +1 -1
@@ -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>
drivers/net/i40e/i40e_rxtx_vec_altivec.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_avx2.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_neon.c +1 -1
@@ -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"
drivers/net/i40e/i40e_rxtx_vec_sse.c +1 -1
@@ -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"
drivers/net/i40e/rte_pmd_i40e.h +1 -1
@@ -14,7 +14,7 @@* */ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> /** * Response sent back to i40e driver from user app after callback
drivers/net/ixgbe/ixgbe_bypass.c +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_fdir.c +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_flow.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_ipsec.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_pf.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
@@ -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>
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +1 -1
@@ -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"
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_malloc.h> #include "ixgbe_ethdev.h"
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_malloc.h> #include "ixgbe_ethdev.h"
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
@@ -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"
drivers/net/ixgbe/rte_pmd_ixgbe.h +1 -1
@@ -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.
drivers/net/kni/rte_eth_kni.c +1 -1
@@ -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>
drivers/net/liquidio/base/lio_23xx_vf.c +1 -1
@@ -4,7 +4,7 @@#include <string.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include <rte_cycles.h> #include <rte_malloc.h>
drivers/net/liquidio/base/lio_mbox.c +1 -1
@@ -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"
drivers/net/liquidio/lio_ethdev.c +1 -1
@@ -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>
drivers/net/liquidio/lio_rxtx.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_ethdev.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_flow.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_flow.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_intr.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_rxq.c +1 -1
@@ -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>
drivers/net/mlx4/mlx4_rxtx.h +1 -1
@@ -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>
drivers/net/mlx4/mlx4_txq.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5.h +1 -1
@@ -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>
drivers/net/mlx5/mlx5_defs.h +1 -1
@@ -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"
drivers/net/mlx5/mlx5_ethdev.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_mac.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rss.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rxmode.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_stats.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_trigger.c +1 -1
@@ -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>
drivers/net/mlx5/mlx5_txq.c +1 -1
@@ -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"
drivers/net/mlx5/mlx5_vlan.c +1 -1
@@ -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"
drivers/net/mrvl/mrvl_ethdev.c +1 -1
@@ -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>
drivers/net/nfp/nfp_net.c +1 -1
@@ -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>
drivers/net/null/rte_eth_null.c +1 -1
@@ -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>
drivers/net/octeontx/octeontx_ethdev.h +1 -1
@@ -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>
drivers/net/octeontx/octeontx_rxtx.c +1 -1
@@ -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>
drivers/net/octeontx/octeontx_rxtx.h +1 -1
@@ -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))
drivers/net/pcap/rte_eth_pcap.c +1 -1
@@ -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>
drivers/net/qede/qede_ethdev.h +1 -1
@@ -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>
drivers/net/ring/rte_eth_ring.c +1 -1
@@ -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>
drivers/net/sfc/sfc.h +1 -1
@@ -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>
drivers/net/sfc/sfc_dp_rx.h +1 -1
@@ -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"
drivers/net/sfc/sfc_dp_tx.h +1 -1
@@ -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"
drivers/net/sfc/sfc_ethdev.c +1 -1
@@ -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>
drivers/net/sfc/sfc_ev.h +1 -1
@@ -10,7 +10,7 @@#ifndef _SFC_EV_H_#define _SFC_EV_H_ -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/sfc/sfc_flow.c +1 -1
@@ -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>
drivers/net/sfc/sfc_rx.h +1 -1
@@ -12,7 +12,7 @@#include <rte_mbuf.h> #include <rte_mempool.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/sfc/sfc_tx.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_TX_H#include <rte_mbuf.h> -#include <rte_ethdev.h> +#include <rte_ethdev_driver.h> #include "efx.h"
drivers/net/softnic/rte_eth_softnic.c +1 -1
@@ -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>
drivers/net/softnic/rte_eth_softnic_internals.h +1 -1
@@ -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"
drivers/net/szedata2/rte_eth_szedata2.c +1 -1
@@ -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>
drivers/net/tap/rte_eth_tap.c +1 -1
@@ -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>
drivers/net/tap/rte_eth_tap.h +1 -1
@@ -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
drivers/net/thunderx/nicvf_ethdev.c +1 -1
@@ -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>
drivers/net/thunderx/nicvf_ethdev.h +1 -1
@@ -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
drivers/net/thunderx/nicvf_rxtx.c +1 -1
@@ -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>
drivers/net/thunderx/nicvf_rxtx.h +1 -1
@@ -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)
drivers/net/thunderx/nicvf_struct.h +1 -1
@@ -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 {
drivers/net/vhost/rte_eth_vhost.c +1 -1
@@ -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>
drivers/net/virtio/virtio_ethdev.c +1 -1
@@ -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>
drivers/net/virtio/virtio_pci.h +1 -1
@@ -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 ;
drivers/net/virtio/virtio_rxtx.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple_neon.c +1 -1
@@ -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>
drivers/net/virtio/virtio_rxtx_simple_sse.c +1 -1
@@ -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>
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -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>
drivers/net/vmxnet3/vmxnet3_rxtx.c +1 -1
@@ -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>
lib/librte_ether/Makefile +1 -0
@@ -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
lib/librte_ether/rte_ethdev.c +1 -0
@@ -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" ;
lib/librte_ether/rte_ethdev.h +4 -170
210 lines not on this page · raw message
lib/librte_ether/rte_ethdev_driver.h new file +193 -0
193 lines not on this page · raw message
lib/librte_ether/rte_ethdev_pci.h +1 -1
@@ -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.
lib/librte_ether/rte_ethdev_vdev.h +1 -1
@@ -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
Signature · 1 line
2.14.3
PATCH v5 2/4 ethdev: separate internal structures into own header
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.
--- 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
lib/librte_ether/Makefile +1 -0
@@ -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
lib/librte_ether/rte_ethdev.h +1 -583
614 lines not on this page · raw message
lib/librte_ether/rte_ethdev_core.h new file +607 -0
607 lines not on this page · raw message
Signature · 1 line
2.14.3