summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2018-06-05 19:44:01 +0530
committerDeepak S <deepak.s@linux.intel.com>2018-06-29 17:48:01 +0530
commitbc032eefb98358a4741caf732c475258ebbd5850 (patch)
tree5492f552544a3bc452fca4845bbf6a41be34c308
parent0b9315e16642bc554427d47f20ee9ba8590fe625 (diff)
TempFix: vCGNAPT/vACL ipv4 perf issue
Change-Id: I924fcac7a65c0d221d5d422f419deb9c0f864172 Signed-off-by: Deepak S <deepak.s@linux.intel.com>
-rw-r--r--VNFs/vACL/pipeline/pipeline_acl_be.c15
-rw-r--r--VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c40
2 files changed, 38 insertions, 17 deletions
diff --git a/VNFs/vACL/pipeline/pipeline_acl_be.c b/VNFs/vACL/pipeline/pipeline_acl_be.c
index d4b92109..5da2e36f 100644
--- a/VNFs/vACL/pipeline/pipeline_acl_be.c
+++ b/VNFs/vACL/pipeline/pipeline_acl_be.c
@@ -777,7 +777,13 @@ pkt_work_acl_key(struct rte_pipeline *p,
uint32_t packet_length = rte_pktmbuf_pkt_len(pkt);
uint32_t dest_if = INVALID_DESTIF;
+ uint32_t dst_phy_port = INVALID_DESTIF;
uint32_t src_phy_port = pkt->port;
+ if(is_phy_port_privte(src_phy_port))
+ dst_phy_port = prv_to_pub_map[src_phy_port];
+ else
+ dst_phy_port = pub_to_prv_map[src_phy_port];
+
if(is_gateway()){
@@ -794,7 +800,7 @@ pkt_work_acl_key(struct rte_pipeline *p,
uint32_t nhip = 0;
uint32_t dst_ip_addr = rte_bswap32(ipv4hdr->dst_addr);
- gw_get_nh_port_ipv4(dst_ip_addr, &dest_if, &nhip);
+ gw_get_route_nh_port_ipv4(dst_ip_addr, &dest_if, &nhip, dst_phy_port);
ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if, &dst_mac);
@@ -1475,6 +1481,11 @@ pkt_work_acl_ipv4_key(struct rte_pipeline *p,
uint32_t dest_if = INVALID_DESTIF;
uint32_t src_phy_port = pkt->port;
+ uint32_t dst_phy_port = INVALID_DESTIF;
+ if(is_phy_port_privte(src_phy_port))
+ dst_phy_port = prv_to_pub_map[src_phy_port];
+ else
+ dst_phy_port = pub_to_prv_map[src_phy_port];
if(is_gateway()){
@@ -1493,7 +1504,7 @@ pkt_work_acl_ipv4_key(struct rte_pipeline *p,
uint32_t src_phy_port = pkt->port;
uint32_t dst_ip_addr = rte_bswap32(ipv4hdr->dst_addr);
- gw_get_nh_port_ipv4(dst_ip_addr, &dest_if, &nhip);
+ gw_get_route_nh_port_ipv4(dst_ip_addr, &dest_if, &nhip, dst_phy_port);
ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if, &dst_mac);
diff --git a/VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c b/VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c
index a1779aa0..a5f9e4ef 100644
--- a/VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c
+++ b/VNFs/vCGNAPT/pipeline/pipeline_cgnapt_be.c
@@ -1972,8 +1972,9 @@ static int cgnapt_in_port_ah_mix(struct rte_pipeline *rte_p,
struct arp_entry_data *ret_arp_data = NULL;
uint32_t src_phy_port = *src_port;
- gw_get_nh_port_ipv4(dest_address,
- &dest_if, &nhip);
+ dest_if = prv_to_pub_map[src_phy_port];
+ gw_get_route_nh_port_ipv4(dest_address,
+ &dest_if, &nhip, dest_if);
if (dest_if == INVALID_DESTIF) {
p_nat->invalid_packets |=
@@ -2218,9 +2219,9 @@ static int cgnapt_in_port_ah_mix(struct rte_pipeline *rte_p,
struct arp_entry_data *ret_arp_data = NULL;
dest_if = INVALID_DESTIF;
uint32_t src_phy_port = *src_port;
-
- gw_get_nh_port_ipv4(dest_address,
- &dest_if, &nhip);
+ dest_if = pub_to_prv_map[src_phy_port];
+ gw_get_route_nh_port_ipv4(dest_address,
+ &dest_if, &nhip, dest_if);
if (dest_if == INVALID_DESTIF) {
p_nat->invalid_packets |=
@@ -3728,8 +3729,9 @@ pkt_work_cgnapt_ipv4_prv(
struct arp_entry_data *ret_arp_data = NULL;
uint32_t src_phy_port = *src_port;
-
- gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip);
+ dest_if = prv_to_pub_map[src_phy_port];
+ gw_get_route_nh_port_ipv4(dest_address,
+ &dest_if, &nhip, dest_if);
ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if,
(struct ether_addr *)eth_dest);
@@ -4082,7 +4084,10 @@ pkt_work_cgnapt_ipv4_pub(
uint32_t src_phy_port = *src_port;
- gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip);
+
+ dest_if = pub_to_prv_map[src_phy_port];
+ gw_get_route_nh_port_ipv4(dest_address,
+ &dest_if, &nhip, dest_if);
ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if,
(struct ether_addr *)eth_dest);
@@ -4530,8 +4535,9 @@ pkt4_work_cgnapt_ipv4_prv(
struct arp_entry_data *ret_arp_data = NULL;
uint64_t start, end;
uint32_t src_phy_port = *src_port;
-
- gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip);
+ dest_if = prv_to_pub_map[src_phy_port];
+ gw_get_route_nh_port_ipv4(dest_address,
+ &dest_if, &nhip, dest_if);
ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if,
(struct ether_addr *)eth_dest);
@@ -4900,8 +4906,9 @@ pkt4_work_cgnapt_ipv4_pub(
dest_address = entry->data.u.prv_ip;
struct arp_entry_data *ret_arp_data = NULL;
uint32_t src_phy_port = *src_port;
-
- gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip);
+ dest_if = pub_to_prv_map[src_phy_port];
+ gw_get_route_nh_port_ipv4(dest_address,
+ &dest_if, &nhip, dest_if);
ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if,
(struct ether_addr *)eth_dest);
@@ -6080,7 +6087,9 @@ pkt_work_cgnapt_ipv6_prv(
uint32_t src_phy_port = *src_port;
- gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip);
+ dest_if = prv_to_pub_map[src_phy_port];
+ gw_get_route_nh_port_ipv4(dest_address,
+ &dest_if, &nhip, dest_if);
ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if,
(struct ether_addr *)eth_dest);
@@ -6570,8 +6579,9 @@ pkt4_work_cgnapt_ipv6_prv(
{
struct arp_entry_data *ret_arp_data;
uint32_t src_phy_port = *src_port;
-
- gw_get_nh_port_ipv4(dest_address, &dest_if, &nhip);
+ dest_if = prv_to_pub_map[src_phy_port];
+ gw_get_route_nh_port_ipv4(dest_address,
+ &dest_if, &nhip, dest_if);
ret_arp_data = get_dest_mac_addr_ipv4(nhip, dest_if,
(struct ether_addr *)eth_dest);