aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_l4p/syncookie.h
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2017-07-27 12:00:57 +0100
committerKonstantin Ananyev <konstantin.ananyev@intel.com>2017-07-27 20:24:53 +0100
commit7e18fa1bf263822c46d7431a911b41d6377d5f69 (patch)
treeddf5ce05545419d6d77bb9d8b3c48fc90d221a7a /lib/libtle_l4p/syncookie.h
parente151ee29d02d7802fab9e32b50ced54fd8d64160 (diff)
- 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 <konstantin.ananyev@intel.com> Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Diffstat (limited to 'lib/libtle_l4p/syncookie.h')
-rw-r--r--lib/libtle_l4p/syncookie.h51
1 files changed, 27 insertions, 24 deletions
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;
}