From 1bd2c019eba5c893d634cc496bd6d54c00020d7e Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Sun, 12 Apr 2020 08:31:39 -0400 Subject: misc: refactor calc_checksums Merge two mildly incompatible static inlines, and rename the results vnet_calc_checksums_inline (...). The resulting inline has three additional parameters: int is_ip4, int is_ip6, and int with_gso. All calls manage to pass one or more as compile-time constants, which causes a certain amount of code to disappear in each instantiation. Type: refactor Signed-off-by: Dave Barach Change-Id: I1a2a0e353b9a7bca20bc81318e8c915617261e1a --- src/vnet/ip/ip6_forward.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/vnet/ip/ip6_forward.c') diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c index b7cdb1af8bb..9c195e68802 100644 --- a/src/vnet/ip/ip6_forward.c +++ b/src/vnet/ip/ip6_forward.c @@ -1859,8 +1859,12 @@ ip6_rewrite_inline_with_gso (vlib_main_t * vm, { /* before we paint on the next header, update the L4 * checksums if required, since there's no offload on a tunnel */ - calc_checksums (vm, p0); - calc_checksums (vm, p1); + vnet_calc_checksums_inline (vm, p0, 0 /* is_ip4 */ , + 1 /* is_ip6 */ , + 0 /* with gso */ ); + vnet_calc_checksums_inline (vm, p1, 0 /* is_ip4 */ , + 1 /* is_ip6 */ , + 0 /* with gso */ ); } /* Guess we are only writing on simple Ethernet header. */ @@ -1955,7 +1959,9 @@ ip6_rewrite_inline_with_gso (vlib_main_t * vm, if (is_midchain) { - calc_checksums (vm, p0); + vnet_calc_checksums_inline (vm, p0, 0 /* is_ip4 */ , + 1 /* is_ip6 */ , + 0 /* with gso */ ); } /* Guess we are only writing on simple Ethernet header. */ -- cgit 1.2.3-korg