diff options
author | Deepak S <deepak.s@linux.intel.com> | 2017-06-02 12:38:02 +0530 |
---|---|---|
committer | Deepak S <deepak.s@linux.intel.com> | 2017-06-02 14:21:39 +0000 |
commit | d715ad86b58b8b6632602e4ec682be4feddea9d0 (patch) | |
tree | 5c1088c4571943b8b4a06eb25531a78ca17b2c1a /VNFs | |
parent | a14f5674230cfe394ebc5e96c6473994ce8689df (diff) |
Enable UDP_replay on OVS deployment
Use ETHER_TYPE instead packet_type when hw-ip-check is disabled.
Change-Id: Iced93b78d9f4e58011dd051e88ddd312112e0cba
Signed-off-by: Deepak S <deepak.s@linux.intel.com>
Diffstat (limited to 'VNFs')
-rw-r--r-- | VNFs/UDP_Replay/main.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/VNFs/UDP_Replay/main.c b/VNFs/UDP_Replay/main.c index 944f522a..5b799a50 100644 --- a/VNFs/UDP_Replay/main.c +++ b/VNFs/UDP_Replay/main.c @@ -1049,8 +1049,9 @@ udp_replay_simple_replay(struct rte_mbuf *m, uint8_t portid, struct lcore_conf * ether_addr_copy(ð_hdr->s_addr, &tmp.s_addr); ether_addr_copy(ð_hdr->d_addr, ð_hdr->s_addr); ether_addr_copy(&tmp.s_addr, ð_hdr->d_addr); + struct ether_hdr *eth_h = rte_pktmbuf_mtod(m, struct ether_hdr *); - if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) { + if ((rte_cpu_to_be_16(eth_h->ether_type)) == ETHER_TYPE_IPv4) { /* Handle IPv4 headers.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, sizeof(struct ether_hdr)); @@ -1084,7 +1085,7 @@ udp_replay_simple_replay(struct rte_mbuf *m, uint8_t portid, struct lcore_conf * udp_hdr->src_port = temp_udp.dst_port; send_single_packet(m, dst_port); - } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) { + } else if ((rte_cpu_to_be_16(eth_h->ether_type)) == ETHER_TYPE_IPv6) { /* Handle IPv6 headers.*/ struct ipv6_hdr *ipv6_hdr,temp_ipv6; @@ -1168,12 +1169,13 @@ get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, uint8_t next_hop; struct ipv6_hdr *ipv6_hdr; struct ether_hdr *eth_hdr; + struct ether_hdr *eth_h = rte_pktmbuf_mtod(m, struct ether_hdr *); - if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) { + if ((rte_cpu_to_be_16(eth_h->ether_type)) == ETHER_TYPE_IPv4) { if (rte_lpm_lookup(qconf->ipv4_lookup_struct, dst_ipv4, &next_hop) != 0) next_hop = portid; - } else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) { + } else if ((rte_cpu_to_be_16(eth_h->ether_type)) == ETHER_TYPE_IPv6) { eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1); if (rte_lpm6_lookup(qconf->ipv6_lookup_struct, |