diff options
author | Klement Sekera <ksekera@cisco.com> | 2020-05-11 08:58:05 +0000 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2020-05-13 11:36:42 +0000 |
commit | bc752e432ff3e252f6e1a3f0372c9532f14909cd (patch) | |
tree | 5399347c1e469d21529a0bc20ffd2d0783434e40 /src/plugins/nat/nat44_classify.c | |
parent | 1d61c2194d21df2003ff07ff5feae4130de6277e (diff) |
nat: perf improvement - replace branchy code
Use a lookup table instead.
Type: improvement
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: Ia8461099828bb8824bf016201f135e6b69c444d1
Diffstat (limited to 'src/plugins/nat/nat44_classify.c')
-rw-r--r-- | src/plugins/nat/nat44_classify.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/nat/nat44_classify.c b/src/plugins/nat/nat44_classify.c index b4645dc42b9..9adef3ba64a 100644 --- a/src/plugins/nat/nat44_classify.c +++ b/src/plugins/nat/nat44_classify.c @@ -147,7 +147,7 @@ nat44_classify_node_fn_inline (vlib_main_t * vm, } m_key0.port = clib_net_to_host_u16 (vnet_buffer (b0)->ip.reass.l4_dst_port); - m_key0.protocol = ip_proto_to_snat_proto (ip0->protocol); + m_key0.protocol = ip_proto_to_nat_proto (ip0->protocol); kv0.key = m_key0.as_u64; if (!clib_bihash_search_8_8 (&sm->static_mapping_by_external, &kv0, &value0)) @@ -407,7 +407,7 @@ nat44_ed_classify_node_fn_inline (vlib_main_t * vm, } m_key0.port = clib_net_to_host_u16 (vnet_buffer (b0)->ip.reass.l4_dst_port); - m_key0.protocol = ip_proto_to_snat_proto (ip0->protocol); + m_key0.protocol = ip_proto_to_nat_proto (ip0->protocol); kv0.key = m_key0.as_u64; if (!clib_bihash_search_8_8 (&sm->static_mapping_by_external, &kv0, &value0)) |