From 47eb00f25ab06a699dc27507814c7656940340af Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Fri, 25 Oct 2019 11:56:34 +0100 Subject: v6 rework TCP stream allocation Allocate TCP stream and all necessary metadata (RX/TX queues, OFO queue, DRBs, etc.) as one big buffer, instead of separate alloc() calls for each of the sub-components. Signed-off-by: Konstantin Ananyev Change-Id: Idc9f3e9329920dfb34916f9bff28664ee5e99a42 --- lib/libtle_l4p/tcp_stream.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'lib/libtle_l4p/tcp_stream.h') diff --git a/lib/libtle_l4p/tcp_stream.h b/lib/libtle_l4p/tcp_stream.h index 4629fe6..1bb2a42 100644 --- a/lib/libtle_l4p/tcp_stream.h +++ b/lib/libtle_l4p/tcp_stream.h @@ -150,11 +150,34 @@ struct sdr { STAILQ_HEAD(, tle_stream) be; }; +/* tempalte sizes/offsets/etc. for tcp stream */ +struct stream_szofs { + uint32_t size; + struct { + uint32_t ofs; + uint32_t nb_obj; + uint32_t nb_max; + } ofo; + struct { + uint32_t ofs; + uint32_t nb_obj; + } rxq, txq; + struct { + uint32_t ofs; + uint32_t blk_sz; + uint32_t rng_sz; + uint32_t nb_rng; + uint32_t nb_obj; + uint32_t nb_max; + } drb; +}; + struct tcp_streams { struct stbl st; struct tle_timer_wheel *tmr; /* timer wheel */ struct rte_ring *tsq; /* to-send streams queue */ struct sdr dr; /* death row for zombie streams */ + struct stream_szofs szofs; /* size and offsets for stream data */ struct tle_tcp_stream s[]; /* array of allocated streams. */ }; -- cgit 1.2.3-korg