interface: fix offload flag check 82/32482/9
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>
Thu, 27 May 2021 17:34:59 +0000 (19:34 +0200)
committerDamjan Marion <dmarion@me.com>
Sat, 16 Oct 2021 08:34:09 +0000 (08:34 +0000)
We should compute offloads in interface_ouput.c
in the case when any of the UDP, TCP or IP
offload flags is not present in the interface
capabilities.

e.g. if the interface supports IP cksum offload
but not tcp/udp we should still compute cksums
here.

Type: fix

Change-Id: Ibaa3a56dbc92938dca45311c38f079d040052194
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
src/vnet/interface_output.c

index cc4997a..c4a4b0f 100644 (file)
@@ -475,7 +475,10 @@ VLIB_NODE_FN (vnet_interface_output_node)
 
   ccm = im->combined_sw_if_counters + VNET_INTERFACE_COUNTER_TX;
 
-  if ((hi->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_TX_CKSUM) == 0)
+  /* if not all three flags IP4_,TCP_,UDP_CKSUM set, do compute them
+   * here before sending to the interface */
+  if ((hi->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_TX_CKSUM) !=
+      VNET_HW_INTERFACE_CAP_SUPPORTS_TX_CKSUM)
     do_tx_offloads = 1;
 
   if (do_tx_offloads == 0 && arc_or_subif == 0)