From: Nathan Skrzypczak Date: Thu, 27 May 2021 17:34:59 +0000 (+0200) Subject: interface: fix offload flag check X-Git-Tag: v22.06-rc0~383 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=2e55823af6c1cc6856e4a1f2cea659170bd76fb7;p=vpp.git interface: fix offload flag check 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 --- diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c index cc4997a3b49..c4a4b0f228d 100644 --- a/src/vnet/interface_output.c +++ b/src/vnet/interface_output.c @@ -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)