X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_vhost%2Fvirtio_net.c;h=1f555539211c27ed153edf5ec7e3d948cd2e0500;hb=09d9ae1ac9820c216991edc0d3c853fe28d37a66;hp=f97ec76f9b9498957bc65857dda2a0f1953a8f94;hpb=6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1;p=dpdk.git diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index f97ec76f9b..1f55553921 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -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,8 +966,8 @@ 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 rte_ether_hdr *eth_hdr; uint16_t ethertype; @@ -977,7 +977,7 @@ parse_ethernet(struct rte_mbuf *m, uint16_t *l4_proto, void **l4_hdr) m->l2_len = sizeof(struct rte_ether_hdr); ethertype = rte_be_to_cpu_16(eth_hdr->ether_type); - if (ethertype == ETHER_TYPE_VLAN) { + if (ethertype == RTE_ETHER_TYPE_VLAN) { struct rte_vlan_hdr *vlan_hdr = (struct rte_vlan_hdr *)(eth_hdr + 1); @@ -988,17 +988,17 @@ parse_ethernet(struct rte_mbuf *m, uint16_t *l4_proto, void **l4_hdr) 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; @@ -1032,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;