summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.h
diff options
context:
space:
mode:
authorSrikanth A <srakula@cisco.com>2019-10-02 17:48:58 -0700
committerJohn Lo <loj@cisco.com>2019-10-10 16:37:40 +0000
commit02833ff3294f4abbd8e3d52b38446e0f8f533ffc (patch)
treee2e9de14d3939938e502347723006f7bb374a02d /src/vnet/tcp/tcp.h
parent8a047ed741072bdb8d93b0841473eae06ae3c9d0 (diff)
tcp: custom checksum calculations for Ipv4/Ipv6
Type: feature Based on the configuration, we can disable checksum offload capability and calculate checksum while pushing the TCP & IP header. This saves some cycles when VPP stack is used in legacy hardware devices. Signed-off-by: Srikanth A <srakula@cisco.com> Change-Id: Ic1b3fcf3040917e47ee65263694ebf7437ac5668 (cherry picked from commit 3642782a2748503f5b5ccf89d1575c1d489948ef)
Diffstat (limited to 'src/vnet/tcp/tcp.h')
-rw-r--r--src/vnet/tcp/tcp.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h
index a1b7d4cbd0d..1bf32818171 100644
--- a/src/vnet/tcp/tcp.h
+++ b/src/vnet/tcp/tcp.h
@@ -120,6 +120,7 @@ extern timer_expiration_handler tcp_timer_retransmit_syn_handler;
_(RATE_SAMPLE, "Conn does rate sampling") \
_(TRACK_BURST, "Track burst") \
_(ZERO_RWND_SENT, "Zero RWND sent") \
+ _(NO_CSUM_OFFLOAD, "No Checksum Offload") \
typedef enum _tcp_connection_flag_bits
{
@@ -1233,6 +1234,8 @@ vlib_buffer_push_tcp_net_order (vlib_buffer_t * b, u16 sp, u16 dp, u32 seq,
th->window = wnd;
th->checksum = 0;
th->urgent_pointer = 0;
+ vnet_buffer (b)->l4_hdr_offset = (u8 *) th - b->data;
+ b->flags |= VNET_BUFFER_F_L4_HDR_OFFSET_VALID;
return th;
}