summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-05-27 19:34:59 +0200
committerDamjan Marion <dmarion@me.com>2021-10-16 08:34:09 +0000
commit2e55823af6c1cc6856e4a1f2cea659170bd76fb7 (patch)
treec0a45d5af21b8864462061a07dcaa4f3cd65b496
parent27c56681d81c814be15f69bd41f98ef7b3606564 (diff)
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 <nathan.skrzypczak@gmail.com>
-rw-r--r--src/vnet/interface_output.c5
1 files changed, 4 insertions, 1 deletions
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)