diff options
author | 2017-05-08 11:04:07 +0530 | |
---|---|---|
committer | 2017-06-01 11:56:00 +0000 | |
commit | cd7ce8f25a81fb390ed0cc66992fda8ab1b021cb (patch) | |
tree | 2213d3f98ebd409e01d443fac783f132bbbd21dd /common/VIL/conntrack/rte_ct_udp.c | |
parent | b04a6e5dacc458f81097c9b8a172dcbf16d8fd50 (diff) |
CT: Perf optimization through prefetch and condition checks in CT
JIRA: SAMPLEVNF-10
LLC miss is possible when the connection data structure is accessed
after retrieved from hash table entries for TCP/UDP connection.
CPI for rte_ct_udp_packet() is not good due to if/else condition checks.
This patch provide a prefetch instructions to pre-fetch the cnxn data entry
structure to avoid the LLC miss and also optimize the if/else condition check
to improve the CPI for rte_ct_udp_packet() function.
Change-Id: Ieaf70815c919ddbe1ff34921222eac030fb41756
Signed-off-by: Anand B Jyoti <anand.b.jyoti@intel.com>
Diffstat (limited to 'common/VIL/conntrack/rte_ct_udp.c')
-rw-r--r-- | common/VIL/conntrack/rte_ct_udp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/common/VIL/conntrack/rte_ct_udp.c b/common/VIL/conntrack/rte_ct_udp.c index 88f3a9a4..6caa788f 100644 --- a/common/VIL/conntrack/rte_ct_udp.c +++ b/common/VIL/conntrack/rte_ct_udp.c @@ -33,17 +33,17 @@ enum rte_ct_packet_action rte_ct_udp_packet(struct rte_ct_cnxn_tracker *ct, uint8_t key_was_flipped) { enum rte_ct_pkt_direction dir; - + enum rte_ct_udp_states ustate = RTE_CT_UDP_UNREPLIED; dir = (cd->key_is_client_order == !key_was_flipped); /* printf("packet received verify"); */ - if (dir == RTE_CT_DIR_REPLY && - cd->connstatus == RTE_INIT_CONN) { - rte_ct_set_cnxn_timer_for_udp(ct, cd, RTE_CT_UDP_REPLIED); + if (dir == RTE_CT_DIR_REPLY && ( + (cd->connstatus == RTE_INIT_CONN) || + (cd->connstatus == RTE_ASSURED_CONN))) + { + ustate = RTE_CT_UDP_REPLIED; cd->connstatus = RTE_ASSURED_CONN; - } else if (dir == RTE_CT_DIR_REPLY && - cd->connstatus == RTE_ASSURED_CONN) - rte_ct_set_cnxn_timer_for_udp(ct, cd, RTE_CT_UDP_REPLIED); - else - rte_ct_set_cnxn_timer_for_udp(ct, cd, RTE_CT_UDP_UNREPLIED); + } + rte_ct_set_cnxn_timer_for_udp(ct, cd, ustate); + return RTE_CT_FORWARD_PACKET; } |