#include <stdint.h>
#include <stdio.h>
-#include <rte_memcpy.h>
#include <rte_random.h>
#include <rte_mbuf.h>
#include <rte_byteorder.h>
(RTE_ETHER_MAX_LEN - RTE_ETHER_HDR_LEN - \
RTE_ETHER_CRC_LEN) /**< Ethernet MTU. */
+#define RTE_VLAN_HLEN 4 /**< VLAN (IEEE 802.1Q) header length. */
+/** Maximum VLAN frame length (excluding QinQ), including CRC. */
#define RTE_ETHER_MAX_VLAN_FRAME_LEN \
- (RTE_ETHER_MAX_LEN + 4)
- /**< Maximum VLAN frame length, including CRC. */
+ (RTE_ETHER_MAX_LEN + RTE_VLAN_HLEN)
#define RTE_ETHER_MAX_JUMBO_FRAME_LEN \
0x3F00 /**< Maximum Jumbo frame length, including CRC. */
return -1;
vh = (struct rte_vlan_hdr *)(eh + 1);
- m->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
+ m->ol_flags |= RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_RX_VLAN_STRIPPED;
m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci);
/* Copy ether header over rather than moving whole packet */
return -EINVAL;
oh = rte_pktmbuf_mtod(*m, struct rte_ether_hdr *);
- nh = (struct rte_ether_hdr *)
+ nh = (struct rte_ether_hdr *)(void *)
rte_pktmbuf_prepend(*m, sizeof(struct rte_vlan_hdr));
if (nh == NULL)
return -ENOSPC;
vh = (struct rte_vlan_hdr *) (nh + 1);
vh->vlan_tci = rte_cpu_to_be_16((*m)->vlan_tci);
- (*m)->ol_flags &= ~(PKT_RX_VLAN_STRIPPED | PKT_TX_VLAN);
+ (*m)->ol_flags &= ~(RTE_MBUF_F_RX_VLAN_STRIPPED | RTE_MBUF_F_TX_VLAN);
- if ((*m)->ol_flags & PKT_TX_TUNNEL_MASK)
+ if ((*m)->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)
(*m)->outer_l2_len += sizeof(struct rte_vlan_hdr);
else
(*m)->l2_len += sizeof(struct rte_vlan_hdr);