summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vnet/vnet/devices/dpdk/node.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/vnet/vnet/devices/dpdk/node.c b/vnet/vnet/devices/dpdk/node.c
index 5f9c95aada2..4e668776530 100644
--- a/vnet/vnet/devices/dpdk/node.c
+++ b/vnet/vnet/devices/dpdk/node.c
@@ -34,6 +34,15 @@ static char *dpdk_error_strings[] = {
#undef _
};
+#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0)
+always_inline int
+dpdk_mbuf_is_vlan (struct rte_mbuf *mb)
+{
+ return (mb->packet_type & RTE_PTYPE_L2_ETHER_VLAN) ==
+ RTE_PTYPE_L2_ETHER_VLAN;
+}
+#endif
+
always_inline int
dpdk_mbuf_is_ip4 (struct rte_mbuf *mb)
{
@@ -58,7 +67,13 @@ dpdk_rx_next_from_mb (struct rte_mbuf *mb, vlib_buffer_t * b0, u32 * next0)
{
u32 n0;
- if (PREDICT_FALSE ((mb->ol_flags & PKT_RX_VLAN_PKT)))
+#if RTE_VERSION < RTE_VERSION_NUM(16, 11, 0, 0)
+ if (PREDICT_FALSE
+ ((mb->ol_flags & (PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED)) ==
+ PKT_RX_VLAN_PKT))
+#else
+ if (PREDICT_FALSE (dpdk_mbuf_is_vlan (mb)))
+#endif
n0 = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT;
else if (PREDICT_TRUE (dpdk_mbuf_is_ip4 (mb)))
n0 = VNET_DEVICE_INPUT_NEXT_IP4_INPUT;