summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/dpdk.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-11-17 09:46:41 +0100
committerSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>2017-11-20 11:41:22 +0000
commit45b485099d8bdf5985e9869bc8221852073f9369 (patch)
tree184c75dbe758a9606c16b89a56d4f62965c01663 /src/plugins/dpdk/device/dpdk.h
parent9d1d73a9010dcd0929dc932af1fd7117863f6758 (diff)
dpdk: add support for DPDK 17.11
Also remove DPDK 17.05 support. Change-Id: I4f96cb3f002cd90b12d800d6904f2364d7c4e270 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/dpdk.h')
-rw-r--r--src/plugins/dpdk/device/dpdk.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index 669629293c0..efcc5a766bf 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -39,6 +39,9 @@
#include <rte_eth_bond.h>
#include <rte_sched.h>
#include <rte_net.h>
+#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 0)
+#include <rte_bus_pci.h>
+#endif
#include <vnet/unix/pcap.h>
#include <vnet/devices/devices.h>
@@ -115,6 +118,12 @@ typedef struct
u64 tx_tail;
} tx_ring_hdr_t;
+#if RTE_VERSION < RTE_VERSION_NUM(17, 11, 0, 0)
+typedef uint8_t dpdk_portid_t;
+#else
+typedef uint16_t dpdk_portid_t;
+#endif
+
typedef struct
{
struct rte_ring *swq;
@@ -150,7 +159,7 @@ typedef struct
volatile u32 **lockp;
/* Instance ID */
- u32 device_index;
+ dpdk_portid_t device_index;
u32 hw_if_index;
u32 vlib_sw_if_index;
@@ -203,11 +212,11 @@ typedef struct
dpdk_device_hqos_per_hqos_thread_t *hqos_ht;
/* af_packet or BondEthernet instance number */
- u8 port_id;
+ dpdk_portid_t port_id;
/* Bonded interface port# of a slave -
only valid if DPDK_DEVICE_FLAG_BOND_SLAVE bit is set */
- u8 bond_port;
+ dpdk_portid_t bond_port;
struct rte_eth_link link;
f64 time_last_link_update;
@@ -422,14 +431,9 @@ void dpdk_device_setup (dpdk_device_t * xd);
void dpdk_device_start (dpdk_device_t * xd);
void dpdk_device_stop (dpdk_device_t * xd);
-#if DPDK_VOID_CALLBACK
-void dpdk_port_state_callback (uint8_t port_id,
- enum rte_eth_event_type type, void *param);
-#else
-int dpdk_port_state_callback (uint8_t port_id,
+int dpdk_port_state_callback (dpdk_portid_t port_id,
enum rte_eth_event_type type,
void *param, void *ret_param);
-#endif
#define foreach_dpdk_error \
_(NONE, "no error") \