vxlan: Fixed checksum caclculation offset

VXLAN uses csum_offload for IPv6 packets.

But without gso node we have csum calculated only for inner
packet.
This patch adds support for outer header csum calculation.
Checksum for inner packet should be calculated before
interface-output node (for example in vxlan node).

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Signed-off-by: Vladimir Isaev <visaev@netgate.com>
Change-Id: Ica68429ede4426293769207cd83c791ebe72fe56
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index b76da0a..0fa9da2 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -2241,8 +2241,7 @@
 	  next[0] = next_index;
 	  if (is_midchain)
 	    vnet_calc_checksums_inline (vm, b[0], 1 /* is_ip4 */ ,
-					0 /* is_ip6 */ ,
-					0 /* with gso */ );
+					0 /* is_ip6 */ );
 	}
       else
 	{
@@ -2267,8 +2266,7 @@
 	  next[1] = next_index;
 	  if (is_midchain)
 	    vnet_calc_checksums_inline (vm, b[1], 1 /* is_ip4 */ ,
-					0 /* is_ip6 */ ,
-					0 /* with gso */ );
+					0 /* is_ip6 */ );
 	}
       else
 	{
@@ -2419,8 +2417,7 @@
 	  if (is_midchain)
 	    {
 	      vnet_calc_checksums_inline (vm, b[0], 1 /* is_ip4 */ ,
-					  0 /* is_ip6 */ ,
-					  0 /* with gso */ );
+					  0 /* is_ip6 */ );
 
 	      /* Guess we are only writing on ipv4 header. */
 	      vnet_rewrite_one_header (adj0[0], ip0, sizeof (ip4_header_t));
@@ -2527,8 +2524,7 @@
 	    {
 	      /* this acts on the packet that is about to be encapped */
 	      vnet_calc_checksums_inline (vm, b[0], 1 /* is_ip4 */ ,
-					  0 /* is_ip6 */ ,
-					  0 /* with gso */ );
+					  0 /* is_ip6 */ );
 
 	      /* Guess we are only writing on ipv4 header. */
 	      vnet_rewrite_one_header (adj0[0], ip0, sizeof (ip4_header_t));
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index e4d8fc0..d6ef8c8 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -1936,11 +1936,9 @@
 	      /* before we paint on the next header, update the L4
 	       * checksums if required, since there's no offload on a tunnel */
 	      vnet_calc_checksums_inline (vm, p0, 0 /* is_ip4 */ ,
-					  1 /* is_ip6 */ ,
-					  0 /* with gso */ );
+					  1 /* is_ip6 */ );
 	      vnet_calc_checksums_inline (vm, p1, 0 /* is_ip4 */ ,
-					  1 /* is_ip6 */ ,
-					  0 /* with gso */ );
+					  1 /* is_ip6 */ );
 
 	      /* Guess we are only writing on ipv6 header. */
 	      vnet_rewrite_two_headers (adj0[0], adj1[0],
@@ -2036,8 +2034,7 @@
 	  if (is_midchain)
 	    {
 	      vnet_calc_checksums_inline (vm, p0, 0 /* is_ip4 */ ,
-					  1 /* is_ip6 */ ,
-					  0 /* with gso */ );
+					  1 /* is_ip6 */ );
 
 	      /* Guess we are only writing on ip6 header. */
 	      vnet_rewrite_one_header (adj0[0], ip0, sizeof (ip6_header_t));