} __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. */
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 *)