From 3642782a2748503f5b5ccf89d1575c1d489948ef Mon Sep 17 00:00:00 2001 From: Srikanth A Date: Wed, 2 Oct 2019 17:48:58 -0700 Subject: 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 Change-Id: Ic1b3fcf3040917e47ee65263694ebf7437ac5668 --- src/vnet/tcp/tcp.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/vnet/tcp/tcp.h') 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; } -- cgit 1.2.3-korg