summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-11-20 18:34:58 -0800
committerDave Barach <openvpp@barachs.net>2019-11-21 20:12:24 +0000
commitf4ce6ba22541de1d08b69e8123493e87ec5acef0 (patch)
tree2e10baf1593e22095d1a75b286df054a87dcbc85 /src/vnet/tcp/tcp.c
parentff31ac6809d9913ebd2f58a3a4153a0f419b9a77 (diff)
tcp: add no csum offload config option
Type: feature Change-Id: I77b3ee74229f3c85e99f74bf9000cb5aedbc1760 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 86729011f8f..baa5c0daa61 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -705,6 +705,9 @@ tcp_init_snd_vars (tcp_connection_t * tc)
tc->snd_nxt = tc->iss + 1;
tc->snd_una_max = tc->snd_nxt;
tc->srtt = 100; /* 100 ms */
+
+ if (!tcp_cfg.csum_offload)
+ tc->cfg_flags |= TCP_CFG_F_NO_CSUM_OFFLOAD;
}
void
@@ -1656,6 +1659,7 @@ tcp_configuration_init (void)
tcp_cfg.initial_cwnd_multiplier = 0;
tcp_cfg.enable_tx_pacing = 1;
tcp_cfg.allow_tso = 0;
+ tcp_cfg.csum_offload = 1;
tcp_cfg.cc_algo = TCP_CC_NEWRENO;
tcp_cfg.rwnd_min_update_ack = 1;
@@ -1797,6 +1801,8 @@ tcp_config_fn (vlib_main_t * vm, unformat_input_t * input)
tcp_cfg.enable_tx_pacing = 0;
else if (unformat (input, "tso"))
tcp_cfg.allow_tso = 1;
+ else if (unformat (input, "no-csum-offload"))
+ tcp_cfg.csum_offload = 0;
else if (unformat (input, "cc-algo %U", unformat_tcp_cc_algo,
&tcp_cfg.cc_algo))
;