History log of /tldk/lib/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
71ba97fe 11-Mar-2020 Mariusz Drost <mariuszx.drost@intel.com>

l4p/tcp: Reset wscale when timestamp is not set

wscale value calculation and handling is tightly coupled with timestamp
value. When timestamp sending is off on the other end of the connection,
wscale is being wrongly calculated, which leads to traffic being stuck.
To overcome that issue, wscale value needs to be reset during handshake
when timestamps are off. It results with slower connection, but traffic
is sustained.

Here are ofo/lost segment test script results, which were run with and
without timestamps set.

Test Protocol File Status Time Time
timestmaps on timestamps off
Reorder 4 ipv4 8MB [OK] 1m12.594s 0m58.419s
Reorder 9 ipv4 8MB [OK] 0m27.260s 0m31.142s
Reorder 4 ipv4 8MB [OK] 0m58.093s 1m34.772s
Reorder 9 ipv4 8MB [OK] 0m28.798s 0m34.016s
Loss 0 ipv4 8MB [OK] 0m0.047s 0m0.046s
Loss 20 ipv4 8MB [OK] 2m34.807s 2m20.491s
Loss 0 ipv4 8MB [OK] 0m0.047s 0m0.047s
Loss 20 ipv4 8MB [OK] 0m57.360s 2m15.736s
Reorder 4 ipv6 8MB [OK] 1m0.237s 0m46.347s
Reorder 9 ipv6 8MB [OK] 0m25.977s 0m32.035s
Reorder 4 ipv6 8MB [OK] 0m53.248s 0m50.953s
Reorder 9 ipv6 8MB [OK] 0m26.501s 0m29.248s
Loss 0 ipv6 8MB [OK] 0m0.044s 0m0.042s
Loss 20 ipv6 8MB [OK] 1m0.388s 2m14.005s
Loss 0 ipv6 8MB [OK] 0m0.045s 0m0.042s
Loss 20 ipv6 8MB [OK] 0m58.344s 2m1.191s

Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com>
Change-Id: Id89823409e5e6a87722689d0c2322de7ef0f6cf9

b8f1ef2b 04-Nov-2019 Konstantin Ananyev <konstantin.ananyev@intel.com>

v6: make TCP stream alloc/free to use memtank API

Introduce two extra parameters for TCP context creation:
struct {
uint32_t min;
/**< min number of free streams (grow threshold). */
uint32_t max;
/**< max number of free streams (shrink threshold). */
} free_streams;

By default these params are equal to max_streams value
(avoid dynamic allocation and preserve current beahviour).

grow() is invoked from accept() FE call to refill streams tank for BE.
shrink() is invoked from close() FE call.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Change-Id: I7af6a76d64813ee4a535323e27ffbfd75037fc92

47eb00f2 25-Oct-2019 Konstantin Ananyev <konstantin.ananyev@intel.com>

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 <konstantin.ananyev@intel.com>
Change-Id: Idc9f3e9329920dfb34916f9bff28664ee5e99a42

703faabf 27-Jun-2019 Konstantin Ananyev <konstantin.ananyev@intel.com>

v6: memtank introduction

For analogy with mempool, named this structure memtank.
Same a s mempool it allows to alloc/free objects of fixed size
in a lightweight manner (not as lightweight as mempool,
but hopefully close enough).
The whole idea is that alloc/free is used at fast-path and don't
allocate/free more than *min_free* objects at one call.
So for majority of cases our fast-path alloc/free should be lightweight
(LIFO enqueue/dequeue operations).
Also user will need to call grow/shrink periodically
(ideally from the slow-path) to make sure there is enough
free objects in the tank.
Internally it is just a simple LIFO for up to *max_free* objects plus
a list of memory buffers (memchunk) from where these objects were

v1 -> v2
- Added UT
- Fixed few bugs

v2 -> v3
- extend UT with more parameters

v3 -> v4
- add object alignement as parameter for memtank_create
- extend UT with more parameters
- added memtank dump routine

v4 -> v5
- fixed few bugs inside memtank lib
- extend UT with:
- new test case
- new command-line options: '-s <obj_size>', '-m <mem_func>'

v5 -> v6
- extend memtank dump to collect/display extra information
- make memtank dump routine MT safe
- add memtank sanity check function
- add proper comments for pubic API

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Change-Id: I8939772577f5d9e293088eaa9a9fe316c3fe8f87

0e37b2e9 09-Oct-2019 Mariusz Drost <mariuszx.drost@intel.com>

l4p/tcp: fix SIGSEGV when reading IPv6 address

IPv6 address is obtained through pointer to mbuf (part storing IPv6
addr). Structure which then holds that pointer defines it as a pointer
to _m128i data type. Because of that, when code is optimized,
instruction vmovdqa is used, which requires data to be aligned to
16-bytes. Pointer from mbuf does not have to be aligned in that way,
which may cause SIGSEGV.

Solution is to add attribute packed and aligned(1) to structure holding
IPv6 address. With that, vmovdqu assembly instruction is used, which is
the equivalent of vmovdqa, but for unaligned data.

Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com>
Change-Id: I66e7ce2a317de2cdbc763ec8e31141605b5e5469

e4380f48 02-Jul-2019 Jielong Zhou <jielong.zjl@antfin.com>

l4p/tcp: fix removing overlapped data

rte_pktmbuf_adj and rte_pktmbuf_trim don't support removing data more than
one segment. We reimplemented these funtions to support removing multiple

Change-Id: I3e2d48310595ecae0acef0674ea2c78fa1068c5b
Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

17f6b7ad 02-Jul-2019 Jielong Zhou <jielong.zjl@antfin.com>

l4p/tcp_ofo: fix handling out-of-order packets

Problems are:
1. ofodb could not be assigned directly, as direct assignment does not
copy the mbuf pointer area belonging to it.

2. _ofo_insert_new and _ofo_insert_right doesn't remove overlap correctly.

3. _ofo_insert_new insert new db in wrong position.

4. rx_ofo_reduce sets wrong seq, and would insert overlapped data into
rx queue.

5. _ofo_compact may miss compacting some ofodbs and doesn't update partly
moved ofodb correctly.

Change-Id: I03f1065ef5a15ef2abc664f9cc98910aab72d39b
Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com>

3fbc22a6 28-Jun-2019 Jielong Zhou <jielong.zjl@antfin.com>

l4p/udp: enqueue fragmented packets as a whole

Send or discard fragments of single IP/UDP packet as a whole, because part
of fragments could not be reassembled. Also avoid mbuf leak, for former
version would never free part of segments which are not sended.

Change-Id: I8cd13e60ced973a8f5d7d24369c3cbee64a38836
Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com>

c5f8f7f0 14-Jun-2019 Jianfeng Tan <henry.tjf@antfin.com>

l4p: refactor rx checksum check

For rx checksum check, we put HW and SW ways into one function, with
some code clean up.
As now we do have CKSUM_UNKNOWN, no need to have dev->rx.ol_flags
at all.

Change-Id: Ied77e63e1ec6f5569d16d4ba666fcc968479197d
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

deb5f499 14-Jun-2019 Jianfeng Tan <henry.tjf@antfin.com>

l4p/tcp: few fixes for sending RST packet logic

- for RST on RTO use SND.NXT instead of SND.UNA
- for RST on invalid SEQSEG.ACK in SYN-SENT state:
- use SEG.ACK
- don't terminate the connection

Change-Id: I9943f6fdfb89493af4b0437c5a81af34c450c630
Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com>
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

85b0a328 13-Jun-2019 Jianfeng Tan <henry.tjf@antfin.com>

dpdk: automate make config

Users need two steps to compile DPDK:
$ make config -C dpdk
$ make -C dpdk

We don't see the value for that. Add config as a dependency so that we
can compile it with only one step:
$ make -C dpdk

Change-Id: I78bc728e904d969be9ef7575029eea9fda105bc6
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>


37854f54 13-Jun-2019 Jianfeng Tan <henry.tjf@antfin.com>

l4p: fix compile error

Fix below compile error:

error: ‘d6’ may be used uninitialized in this function
const struct in6_addr *d6;

Change-Id: Ie8c7fb797e5c5d934651973669b3eee791c35ad3
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>

0104c556 18-Dec-2018 Jianfeng Tan <henry.tjf@antfin.com>

l4p/udp: fix errno not set

Return EAGAIN as errno properly.

Change-Id: I056e34e6eca4955e1938bd00d86965236eef55fd
Signed-off-by: Jian Zhang <wuzai.zj@antfin.com>
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>

5740a1da 17-Dec-2018 Jielong Zhou <jielong.zjl@antfin.com>

l4p/tcp: fix seq calculation in partial ack

Change-Id: I46fc0eb7f32dfafd22527c7711520cd3a1a0f48a
Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com>

0852bebf 07-Jan-2019 Jielong Zhou <jielong.zjl@antfin.com>

l4p/tcp: fix dropping sequential packet

When grouping sequential rx packets, some packet may be dropped incorrectly
because of total length of packets are larger than receive window size
which is out of date.

We do not drop the packet, but check it again with updated receive window

Change-Id: I656864a5f029850da5148b07279a34f22081a342
Signed-off-by: Jielong Zhou <jielong.zjl@antfin.com>

b419e591 20-May-2019 Jianfeng Tan <henry.tjf@antfin.com>

fix implicit-fallthrough error

On gcc 7.0+, we could encounter this error.

Change-Id: I7399197b91ce0c8b3106c08b573469c15c2075b9
Signed-off-by: Jianfeng Tan <henry.tjf@antfin.com>

d8967fb1 09-Feb-2018 Konstantin Ananyev <konstantin.ananyev@intel.com>

tldk: introduce versioning, follow DPDK notation

Change-Id: I9d83b254fa66ff72dd2faddf366f35ecda13a6ea
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

5c795f7b 06-Feb-2018 Konstantin Ananyev <konstantin.ananyev@intel.com>

tldk: make sure it builds/works with latest dpdk (17.11/18.02)

Change-Id: I460b88661656b64558b442c7800b4edc20ad4b56
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

c1b4951c 01-Nov-2017 Konstantin Ananyev <konstantin.ananyev@intel.com>

tle_tcp: return ENODATA for unprocessed/unused packets that belong to existing stream.

Change-Id: I3109b843178cc8576ebaa6eae6c3f75081067feb
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

7e18fa1b 26-Jul-2017 Konstantin Ananyev <konstantin.ananyev@intel.com>

- 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>

e151ee29 30-May-2017 Remy Horton <remy.horton@intel.com>

Add l4fwd RXTX mode

This mode allows for transactions where the request and response
are of different payload sizes

Change-Id: I0744159f0618c9241e576a4af1c02765bbf1dd9f
Signed-off-by: Remy Horton <remy.horton@intel.com>

6e95f5ec 20-Jun-2017 Konstantin Ananyev <konstantin.ananyev@intel.com>

libtle_l4p: fix both wl1 and wl2 should coexist inside union wui.

Change-Id: Ied0e976aa26f71dc4ccbf62deae9cd756ee4b82d
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

2c33ba7b 11-Jun-2017 Konstantin Ananyev <konstantin.ananyev@intel.com>

libtle_l4p: fix at termination tcp stream not always cleanup it's send queue.

Change-Id: I8ab713c98712fafe2550a6954224ebc741cf9029
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

e49446d6 05-Jun-2017 Konstantin Ananyev <konstantin.ananyev@intel.com>

tle_tcp_proces: fix the issue when strem can sit in the txs queue forever.

Change-Id: I313f048fc0888d661f8b0e34af6256afc516670a
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

fbba0a3b 11-May-2017 Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

Added rte_ring wrapper functions to support dpdk-17.05 and older version

Change-Id: I5cfcff8be275ab2a2fb4ad6a62777a8cb88f425b
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

36d90e3a 03-May-2017 Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

two fixes. - allow conditional jumbo frame based on rx_max_pkt_len - fix mss size for rx_synack

Change-Id: I47b7775445bc4ba647f9da9edafc4b255082e926
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

9fa82a63 07-Apr-2017 Reshma Pattan <reshma.pattan@intel.com>

* Add siphash file for calculating the sequence number.
* l4fwd app changed to include new command line parameters
hash and secret key for hash calculation.
* Changed l4fwd library to integrate siphash support for
calculating the sequence number.

Change-Id: I29c60836c8b17a118d76b619fd79398fac200f67
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>

4e3cb261 10-Apr-2017 Tomasz Kopec <tomaszx.kopec@intel.com>

tcp_stream_close issue fixed, added tcp_stream tests (FPP-350)

Change-Id: I0332d1cc4ce3acc993da0037614f59102d059690
Signed-off-by: Tomasz Kopec <tomaszx.kopec@intel.com>

9af556f2 27-Mar-2017 Konstantin Ananyev <konstantin.ananyev@intel.com>

tcp: fix RCV.WND set incorreclty when peer doesn't support WSCALE option

Change-Id: I911fdeeb25bc1112cd38eaa96c34f47a7bf49060
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

c4c44906 03-Mar-2017 Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

implement sw segmentation for tcp

Change-Id: Ibe3ac4b401ea9c7680ab5d3e8c73557d95402ff2
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

21e7392f 03-Mar-2017 Konstantin Ananyev <konstantin.ananyev@intel.com>

Rewrite accept() code-path and make l4fwd not to close() on FIN immediatelly.

Changes in public API:
- removes tle_tcp_stream_synreqs() and tle_tcp_reject()
- adds tle_tcp_stream_update_cfg
Allocates and fills new stream when final ACK for 3-way handshake
is received.

Changes in l4fwd sample application:
prevents l4fwd to call close() on error event immediately:
first try to recv/send remaining data.

Change-Id: I8c5b9d365353084083731a4ce582197a8268688f
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

aa97dd1c 21-Feb-2017 Konstantin Ananyev <konstantin.ananyev@intel.com>

Introduce first version of TCP code.

Supported functionality:
- open/close
- listen/accept/connect
- send/recv
In order to achieve that libtle_udp library was
reworked into libtle_l4p library that supports
both TCP and UDP protocols.
New libtle_timer library was introduced
(thanks to Cisco guys and Dave Barach <dbarach@cisco.com>
for sharing their timer code with us).
Sample application was also reworked significantly
to support both TCP and UDP traffic handling.
New UT were introduced.

Change-Id: I806b05011f521e89b58db403cfdd484a37beb775
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Signed-off-by: Karol Latecki <karolx.latecki@intel.com>
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

c603d3ed 21-Oct-2016 Karol Latecki <karolx.latecki@intel.com>

tldk: fix possibility of tle_event_active() from DOWN to UP

Docstring in tle_event.h for tle_event_active() only describes
possibility of activating event from IDLE state.
Also re-added previously failing test case.

Change-Id: Ib9e19b6b3e64cc2836337b6a86884f312df73858
Signed-off-by: Karol Latecki <karolx.latecki@intel.com>
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

663163e5 19-Oct-2016 Karol Latecki <karolx.latecki@intel.com>

tldk: fix for positive errno return values in udp_ctl.c

'Public' functions should return negative values.

Change-Id: I88eaf76f882eee08a4198543d0c8531656530360
Signed-off-by: Karol Latecki <karolx.latecki@intel.com>

7a7ef4de 19-Oct-2016 Karol Latecki <karolx.latecki@intel.com>

tldk: fix for wrong rte_errno value in event.c

Change-Id: Ia4890e174fa5e19ccfaeb23c1ba3e3d69f841af7
Signed-off-by: Karol Latecki <karolx.latecki@intel.com>

2fea8d3d 07-Oct-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

libtle_udp: don't allow to open stream for unsupported family

Change-Id: Ice9cc37ff538af185c8fcb18bedd007c175299e7
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

1c436f7f 07-Oct-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

libtle_udp: fix possible dereference of NULL ptr in tle_udp_del_dev()

Change-Id: I09661a97206e8714c05f4c4f31d23d250cd0933a
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

300fdaf8 07-Oct-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

libtle_udp: fix incorrect comparision in ymm_mask_cmp()

Change-Id: I804ab3bbbfe8c64adebfbf8ed2135d0aded509e3
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

5d0ab6ce 06-Aug-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

Enable C++ files compilation

Change-Id: I28b180a6c91165049cd7cc58a64f1e5e1698da61
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

e57f675d 09-Sep-2016 Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

add list of blocked ports for IPv6

Change-Id: Iefc866e71e887fe23ff9473b23577b6e576f18b1
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

8ae38dfb 15-Jun-2016 Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

Initial working version of RSS

The patch enables RSS support for TLDK udpfwd application.
The number of rx queues and tx queues are equal to the number of lcore
enabled for backend operation. NICs calculate the RSS hash based on the
UDP dest port only. The RSS hash key is calculated at runtime based on
the number of queues enebaled.

Change-Id: I06006a4606f8faad8f16241348b2ce19b70335e5
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>

9c7aa95e 18-Jul-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

fix segfault on input packets with invalid checksum

libtle_udp: prevent receive code-path to reference packets
that were already freed.

udpfwd: if input device doesn't support IPV4 checksum offload,
we need to recalculate IPV4 header checksum of the
reassembled packet.

fixes 3395610ea65d ("Initial commit of tldk code").
fixes 8efc4c11464f ("Change libtle_udp to use dring").

Change-Id: I77523b1ba63b0f8d25d5f0b3bc777a338ad8acf5
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

8efc4c11 07-Jul-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

Change libtle_udp to use dring.

Right now didn't see any noticeable performance boost with these changes.
Though it allowed to get rid of using locks at UDP TX code-path
and simplify the code quite a lot.

Change-Id: If865abd3db9127f510df670d9a8edb168b915770
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

a633eec7 07-Jul-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

initial tle_dring implementation

The Dynamic Ring (dring) is a implementation of unbounded FIFO queue,
that supports lockless bulk enqueue/dequeue for multiple producers/consumers.
Internally it contains producer/consumer head/tail indexes
(same as DPDK rte_ring), plus linked list of Dynamic Ring Blocks (drb)s.
Each drb contains some metadata plus array of pointers to queued objects.
It is a caller responsibility to provide sufficient number of drbs for
enqueue operation, and manage unused drbs returned by dequeue operation.
dring features:
- FIFO (First In First Out)
- Lockless implementation.
- Multi- or single-consumer dequeue.
- Multi- or single-producer enqueue.
- Bulk dequeue.
- Bulk enqueue.

Change-Id: I3621c99c6b114a387036a397e79baa8d1588bdb5
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

c034e691 07-Jul-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

Introduce extra layer of hierarchy to the makefiles.

Now each subdir in the TLDK_ROOT has it's own Makefile.
In preparation for further project expansion.

Change-Id: I80560680a8538734986941e8df343c5393c621cc
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

06ac4c87 28-Jun-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

libtle_udp: add missing license header for udp_rxtx.c

Change-Id: If31a72e07ffe4947297c722ce5624ea8ed5f101f
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

3395610e 03-Jun-2016 Konstantin Ananyev <konstantin.ananyev@intel.com>

Initial commit of tldk code.

Change-Id: Ib96fdd2c57bae0a51ed420137c35eb8e2ee58473
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Ed Warnicke <eaw@cisco.com>