} __attribute__((__packed__));
/* Ethernet frame types */
-#define RTE_ETHER_TYPE_IPv4 0x0800 /**< IPv4 Protocol. */
-#define RTE_ETHER_TYPE_IPv6 0x86DD /**< IPv6 Protocol. */
+#define RTE_ETHER_TYPE_IPV4 0x0800 /**< IPv4 Protocol. */
+#define RTE_ETHER_TYPE_IPV6 0x86DD /**< IPv6 Protocol. */
#define RTE_ETHER_TYPE_ARP 0x0806 /**< Arp Protocol. */
#define RTE_ETHER_TYPE_RARP 0x8035 /**< Reverse Arp Protocol. */
#define RTE_ETHER_TYPE_VLAN 0x8100 /**< IEEE 802.1Q VLAN tagging. */
#define RTE_ETHER_TYPE_MPLSM 0x8848 /**< MPLS multicast ethertype. */
#define RTE_ETHER_VXLAN_HLEN \
- (sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr))
+ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr))
/**< VXLAN tunnel header length. */
/**
#define RTE_VXLAN_GPE_TYPE_GBP 6 /**< GBP Protocol. */
#define RTE_VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
-#define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+#define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \
sizeof(struct rte_vxlan_gpe_hdr))
/**< VXLAN-GPE tunnel header length. */
struct rte_vlan_hdr *vh;
/* Can't insert header if mbuf is shared */
- if (rte_mbuf_refcnt_read(*m) > 1) {
- struct rte_mbuf *copy;
-
- copy = rte_pktmbuf_clone(*m, (*m)->pool);
- if (unlikely(copy == NULL))
- return -ENOMEM;
- rte_pktmbuf_free(*m);
- *m = copy;
- }
+ if (!RTE_MBUF_DIRECT(*m) || rte_mbuf_refcnt_read(*m) > 1)
+ return -EINVAL;
oh = rte_pktmbuf_mtod(*m, struct rte_ether_hdr *);
nh = (struct rte_ether_hdr *)