net: add rte prefix to SCTP structure
[dpdk.git] / lib / librte_vhost / virtio_net.c
index a6a33a1..1f55553 100644 (file)
@@ -226,7 +226,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
                                                dgram_cksum));
                        break;
                case PKT_TX_SCTP_CKSUM:
-                       net_hdr->csum_offset = (offsetof(struct sctp_hdr,
+                       net_hdr->csum_offset = (offsetof(struct rte_sctp_hdr,
                                                cksum));
                        break;
                }
@@ -238,9 +238,9 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
 
        /* IP cksum verification cannot be bypassed, then calculate here */
        if (m_buf->ol_flags & PKT_TX_IP_CKSUM) {
-               struct ipv4_hdr *ipv4_hdr;
+               struct rte_ipv4_hdr *ipv4_hdr;
 
-               ipv4_hdr = rte_pktmbuf_mtod_offset(m_buf, struct ipv4_hdr *,
+               ipv4_hdr = rte_pktmbuf_mtod_offset(m_buf, struct rte_ipv4_hdr *,
                                                   m_buf->l2_len);
                ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
        }
@@ -966,38 +966,39 @@ virtio_net_with_host_offload(struct virtio_net *dev)
 static void
 parse_ethernet(struct rte_mbuf *m, uint16_t *l4_proto, void **l4_hdr)
 {
-       struct ipv4_hdr *ipv4_hdr;
-       struct ipv6_hdr *ipv6_hdr;
+       struct rte_ipv4_hdr *ipv4_hdr;
+       struct rte_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);
+               m->l3_len = sizeof(struct rte_ipv6_hdr);
                *l4_hdr = (char *)l3_hdr + m->l3_len;
                m->ol_flags |= PKT_TX_IPV6;
                break;
@@ -1031,7 +1032,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
                                if (l4_proto == IPPROTO_UDP)
                                        m->ol_flags |= PKT_TX_UDP_CKSUM;
                                break;
-                       case (offsetof(struct sctp_hdr, cksum)):
+                       case (offsetof(struct rte_sctp_hdr, cksum)):
                                if (l4_proto == IPPROTO_SCTP)
                                        m->ol_flags |= PKT_TX_SCTP_CKSUM;
                                break;