summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/dpdk/device')
-rw-r--r--src/plugins/dpdk/device/common.c23
-rw-r--r--src/plugins/dpdk/device/dpdk.h22
-rw-r--r--src/plugins/dpdk/device/format.c12
-rwxr-xr-xsrc/plugins/dpdk/device/init.c2
4 files changed, 30 insertions, 29 deletions
diff --git a/src/plugins/dpdk/device/common.c b/src/plugins/dpdk/device/common.c
index c65cec6734d..d488d69e553 100644
--- a/src/plugins/dpdk/device/common.c
+++ b/src/plugins/dpdk/device/common.c
@@ -155,11 +155,11 @@ dpdk_device_start (dpdk_device_t * xd)
if (xd->pmd == VNET_DPDK_PMD_BOND)
{
- u8 slink[16];
+ dpdk_portid_t slink[16];
int nlink = rte_eth_bond_slaves_get (xd->device_index, slink, 16);
while (nlink >= 1)
{
- u8 dpdk_port = slink[--nlink];
+ dpdk_portid_t dpdk_port = slink[--nlink];
rte_eth_allmulticast_enable (dpdk_port);
}
}
@@ -177,11 +177,11 @@ dpdk_device_stop (dpdk_device_t * xd)
/* For bonded interface, stop slave links */
if (xd->pmd == VNET_DPDK_PMD_BOND)
{
- u8 slink[16];
+ dpdk_portid_t slink[16];
int nlink = rte_eth_bond_slaves_get (xd->device_index, slink, 16);
while (nlink >= 1)
{
- u8 dpdk_port = slink[--nlink];
+ dpdk_portid_t dpdk_port = slink[--nlink];
rte_eth_dev_stop (dpdk_port);
}
}
@@ -246,7 +246,7 @@ garp_na_proc_callback (uword * dpdk_port)
}
always_inline int
-dpdk_port_state_callback_inline (uint8_t port_id,
+dpdk_port_state_callback_inline (dpdk_portid_t port_id,
enum rte_eth_event_type type, void *param)
{
struct rte_eth_link link;
@@ -294,24 +294,15 @@ dpdk_port_state_callback_inline (uint8_t port_id,
return 0;
}
-#if DPDK_VOID_CALLBACK
-void
-dpdk_port_state_callback (uint8_t port_id,
- enum rte_eth_event_type type, void *param)
-{
- dpdk_port_state_callback_inline (port_id, type, param);
-}
-
-#else
int
-dpdk_port_state_callback (uint8_t port_id,
+dpdk_port_state_callback (dpdk_portid_t port_id,
enum rte_eth_event_type type,
void *param,
void *ret_param __attribute__ ((unused)))
{
return dpdk_port_state_callback_inline (port_id, type, param);
}
-#endif
+
/*
* fd.io coding-style-patch-verification: ON
*
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") \
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index a2635c53ca4..8f1f729d89a 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -79,18 +79,24 @@
_(DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM, "outer-ipv4-cksum") \
_(DEV_TX_OFFLOAD_QINQ_INSERT, "qinq-insert")
+#if RTE_VERSION < RTE_VERSION_NUM(17, 11, 0, 0)
+#define PKT_RX_VLAN PKT_RX_VLAN_PKT
+#endif
+
#define foreach_dpdk_pkt_rx_offload_flag \
- _ (PKT_RX_VLAN_PKT, "RX packet is a 802.1q VLAN packet") \
+ _ (PKT_RX_VLAN, "RX packet is a 802.1q VLAN packet") \
_ (PKT_RX_RSS_HASH, "RX packet with RSS hash result") \
_ (PKT_RX_FDIR, "RX packet with FDIR infos") \
_ (PKT_RX_L4_CKSUM_BAD, "L4 cksum of RX pkt. is not OK") \
_ (PKT_RX_IP_CKSUM_BAD, "IP cksum of RX pkt. is not OK") \
+ _ (PKT_RX_EIP_CKSUM_BAD, "External IP header checksum error") \
_ (PKT_RX_VLAN_STRIPPED, "RX packet VLAN tag stripped") \
_ (PKT_RX_IP_CKSUM_GOOD, "IP cksum of RX pkt. is valid") \
_ (PKT_RX_L4_CKSUM_GOOD, "L4 cksum of RX pkt. is valid") \
_ (PKT_RX_IEEE1588_PTP, "RX IEEE1588 L2 Ethernet PT Packet") \
_ (PKT_RX_IEEE1588_TMST, "RX IEEE1588 L2/L4 timestamped packet") \
- _ (PKT_RX_QINQ_STRIPPED, "RX packet QinQ tags stripped")
+ _ (PKT_RX_QINQ_STRIPPED, "RX packet QinQ tags stripped") \
+ _ (PKT_RX_TIMESTAMP, "Timestamp field is valid")
#define foreach_dpdk_pkt_type \
_ (L2, ETHER, "Ethernet packet") \
@@ -728,7 +734,7 @@ format_dpdk_rte_mbuf (u8 * s, va_list * va)
s = format (s, "\n%U%U", format_white_space, indent,
format_dpdk_pkt_offload_flags, &mb->ol_flags);
- if ((mb->ol_flags & PKT_RX_VLAN_PKT) &&
+ if ((mb->ol_flags & PKT_RX_VLAN) &&
((mb->ol_flags & (PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ_STRIPPED)) == 0))
{
ethernet_vlan_header_tv_t *vlan_hdr =
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 9e7bb75d6f3..3cd040a0577 100755
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -1441,7 +1441,7 @@ dpdk_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
if (xd->pmd == VNET_DPDK_PMD_BOND)
{
u8 addr[6];
- u8 slink[16];
+ dpdk_portid_t slink[16];
int nlink = rte_eth_bond_slaves_get (i, slink, 16);
if (nlink > 0)
{