net: add rte prefix to ether defines
[dpdk.git] / lib / librte_vhost / virtio_net.c
index 37a4c00..2394178 100644 (file)
@@ -969,32 +969,33 @@ parse_ethernet(struct rte_mbuf *m, uint16_t *l4_proto, void **l4_hdr)
        struct ipv4_hdr *ipv4_hdr;
        struct ipv6_hdr *ipv6_hdr;
        void *l3_hdr = NULL;
-       struct ether_hdr *eth_hdr;
+       struct rte_ether_hdr *eth_hdr;
        uint16_t ethertype;
 
-       eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+       eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
-       m->l2_len = sizeof(struct ether_hdr);
+       m->l2_len = sizeof(struct rte_ether_hdr);
        ethertype = rte_be_to_cpu_16(eth_hdr->ether_type);
 
-       if (ethertype == ETHER_TYPE_VLAN) {
-               struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1);
+       if (ethertype == RTE_ETHER_TYPE_VLAN) {
+               struct rte_vlan_hdr *vlan_hdr =
+                       (struct rte_vlan_hdr *)(eth_hdr + 1);
 
-               m->l2_len += sizeof(struct vlan_hdr);
+               m->l2_len += sizeof(struct rte_vlan_hdr);
                ethertype = rte_be_to_cpu_16(vlan_hdr->eth_proto);
        }
 
        l3_hdr = (char *)eth_hdr + m->l2_len;
 
        switch (ethertype) {
-       case ETHER_TYPE_IPv4:
+       case RTE_ETHER_TYPE_IPv4:
                ipv4_hdr = l3_hdr;
                *l4_proto = ipv4_hdr->next_proto_id;
                m->l3_len = (ipv4_hdr->version_ihl & 0x0f) * 4;
                *l4_hdr = (char *)l3_hdr + m->l3_len;
                m->ol_flags |= PKT_TX_IPV4;
                break;
-       case ETHER_TYPE_IPv6:
+       case RTE_ETHER_TYPE_IPv6:
                ipv6_hdr = l3_hdr;
                *l4_proto = ipv6_hdr->proto;
                m->l3_len = sizeof(struct ipv6_hdr);
@@ -1063,12 +1064,6 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
        }
 }
 
-static __rte_always_inline void
-put_zmbuf(struct zcopy_mbuf *zmbuf)
-{
-       zmbuf->in_use = 0;
-}
-
 static __rte_always_inline int
 copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
                  struct buf_vector *buf_vec, uint16_t nr_vec,
@@ -1306,34 +1301,6 @@ again:
        return NULL;
 }
 
-static __rte_always_inline bool
-mbuf_is_consumed(struct rte_mbuf *m)
-{
-       while (m) {
-               if (rte_mbuf_refcnt_read(m) > 1)
-                       return false;
-               m = m->next;
-       }
-
-       return true;
-}
-
-static __rte_always_inline void
-restore_mbuf(struct rte_mbuf *m)
-{
-       uint32_t mbuf_size, priv_size;
-
-       while (m) {
-               priv_size = rte_pktmbuf_priv_size(m->pool);
-               mbuf_size = sizeof(struct rte_mbuf) + priv_size;
-               /* start of buffer is after mbuf structure and priv data */
-
-               m->buf_addr = (char *)m + mbuf_size;
-               m->buf_iova = rte_mempool_virt2iova(m) + mbuf_size;
-               m = m->next;
-       }
-}
-
 static __rte_always_inline uint16_t
 virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,
        struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count)