bus/pci: consider only usable devices for IOVA mode
[dpdk.git] / lib / librte_net / rte_ether.h
index 3404bdd..1868cb7 100644 (file)
@@ -298,8 +298,8 @@ struct rte_vxlan_hdr {
 } __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. */
@@ -393,15 +393,8 @@ static inline int rte_vlan_insert(struct rte_mbuf **m)
        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 *)