diff options
author | Klement Sekera <ksekera@cisco.com> | 2021-11-02 15:33:55 +0100 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-11-04 13:30:21 +0000 |
commit | d4ba0d1883d24cc03f5435fe71368d49e01761cb (patch) | |
tree | 974921788a927c6c537b5d28c3edcf1dc3a7b2d4 /src/vnet/ip/reass/ip4_sv_reass.c | |
parent | 5a58e7c546239da5c500611d60cf4e7635f138c5 (diff) |
ip: speed up reassembly code compilation
Refactor code so that code is inlined in one place instead of in
multiple to speed up compilation.
Type: refactor
Change-Id: I41357b89715b66ebdc8c0d5ccd69347a254fc266
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet/ip/reass/ip4_sv_reass.c')
-rw-r--r-- | src/vnet/ip/reass/ip4_sv_reass.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vnet/ip/reass/ip4_sv_reass.c b/src/vnet/ip/reass/ip4_sv_reass.c index 31177809f7b..f5fa575e64d 100644 --- a/src/vnet/ip/reass/ip4_sv_reass.c +++ b/src/vnet/ip/reass/ip4_sv_reass.c @@ -846,24 +846,24 @@ slow_path: ip4_sv_reass_rc_t rc = ip4_sv_reass_update (vm, node, rm, ip0, reass, bi0); + u32 counter = ~0; switch (rc) { case IP4_SV_REASS_RC_OK: /* nothing to do here */ break; case IP4_SV_REASS_RC_TOO_MANY_FRAGMENTS: - vlib_node_increment_counter (vm, node->node_index, - IP4_ERROR_REASS_FRAGMENT_CHAIN_TOO_LONG, - 1); - ip4_sv_reass_free (vm, rm, rt, reass); - goto next_packet; + counter = IP4_ERROR_REASS_FRAGMENT_CHAIN_TOO_LONG; break; case IP4_SV_REASS_RC_UNSUPP_IP_PROTO: - vlib_node_increment_counter (vm, node->node_index, - IP4_ERROR_REASS_UNSUPP_IP_PROT, 1); + counter = IP4_ERROR_REASS_UNSUPP_IP_PROT; + break; + } + if (~0 != counter) + { + vlib_node_increment_counter (vm, node->node_index, counter, 1); ip4_sv_reass_free (vm, rm, rt, reass); goto next_packet; - break; } if (reass->is_complete) { |