From 7e18fa1bf263822c46d7431a911b41d6377d5f69 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Thu, 27 Jul 2017 12:00:57 +0100 Subject: - Introduce tle_tcp_stream_readv() and tle_tcp_stream_writev(). - Introduce flags for tle_ctx_param. - Introduce TLE_CTX_FLAG_ST - indicates that given ctx will be used by single thread only. - Introduce new parameters for tcp context: timewait - allows user to configure max timeout in TCP_TIMEWAIT state. icw - allows user to specify desired initial congestion window for new connections. -Few optimisations: cache tx.ol_flags inside tle destination. calcualte and cache inside ctx cycles_to_ms shift value. reorder restoring SYN opts and filling TCB a bit. Change-Id: Ie05087783b3b7f1e4ce99d3555bc5bd098f83fe0 Signed-off-by: Konstantin Ananyev Signed-off-by: Mohammad Abdul Awal --- lib/libtle_l4p/syncookie.h | 51 ++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 24 deletions(-) (limited to 'lib/libtle_l4p/syncookie.h') diff --git a/lib/libtle_l4p/syncookie.h b/lib/libtle_l4p/syncookie.h index da2e166..61bfce4 100644 --- a/lib/libtle_l4p/syncookie.h +++ b/lib/libtle_l4p/syncookie.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Intel Corporation. + * Copyright (c) 2016-2017 Intel Corporation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -178,37 +178,40 @@ sync_check_ack(const union pkt_info *pi, uint32_t seq, uint32_t ack, } static inline void -sync_get_opts(struct syn_opts *so, uintptr_t p, uint32_t len) +sync_fill_tcb(struct tcb *tcb, const union seg_info *si, const union tsopt *to) { - so->ts = get_tms_opts(p, len); - so->wscale = so->ts.ecr & SYNC_TMS_WSCALE_MASK; -} + uint32_t ack, mss, seq, wscale; -static inline void -sync_fill_tcb(struct tcb *tcb, const union seg_info *si, - const struct syn_opts *so) -{ - tcb->rcv.nxt = si->seq; - tcb->rcv.irs = si->seq - 1; + seq = si->seq; + + tcb->rcv.nxt = seq; + tcb->rcv.irs = seq - 1; + tcb->snd.wu.wl1 = seq; + + ack = si->ack; + + tcb->snd.nxt = ack; + tcb->snd.una = ack; + tcb->snd.iss = ack - 1; + tcb->snd.rcvr = ack - 1; + tcb->snd.wu.wl2 = ack; - tcb->snd.nxt = si->ack; - tcb->snd.una = si->ack; - tcb->snd.iss = si->ack - 1; - tcb->snd.rcvr = tcb->snd.iss; + mss = si->mss; - tcb->snd.wu.wl1 = si->seq; - tcb->snd.wu.wl2 = si->ack; + tcb->snd.mss = mss; + tcb->so.mss = mss; - tcb->so = *so; + tcb->snd.ts = to->ecr; + tcb->rcv.ts = to->val; + tcb->so.ts.raw = to->raw; - tcb->snd.wscale = tcb->so.wscale; - tcb->snd.mss = tcb->so.mss; - tcb->snd.wnd = si->wnd << tcb->snd.wscale; + wscale = to->ecr & SYNC_TMS_WSCALE_MASK; - tcb->snd.ts = tcb->so.ts.ecr; - tcb->rcv.ts = tcb->so.ts.val; + tcb->snd.wscale = wscale; + tcb->snd.wnd = si->wnd << wscale; + tcb->so.wscale = wscale; - tcb->rcv.wscale = (tcb->so.wscale == TCP_WSCALE_NONE) ? + tcb->rcv.wscale = (wscale == TCP_WSCALE_NONE) ? TCP_WSCALE_NONE : TCP_WSCALE_DEFAULT; } -- cgit 1.2.3-korg