diff options
author | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2017-06-11 13:22:41 +0100 |
---|---|---|
committer | Konstantin Ananyev <konstantin.ananyev@intel.com> | 2017-06-11 13:23:51 +0100 |
commit | 2c33ba7b74d4e61a29db34c650d96eef9134f6a7 (patch) | |
tree | 02c32f69a9fcb3a2add74efe01b3786a2a473049 /lib/libtle_l4p/tcp_rxtx.c | |
parent | e49446d6c07fd64b2b40d6a9a6ccec7c06a88366 (diff) |
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>
Diffstat (limited to 'lib/libtle_l4p/tcp_rxtx.c')
-rw-r--r-- | lib/libtle_l4p/tcp_rxtx.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/libtle_l4p/tcp_rxtx.c b/lib/libtle_l4p/tcp_rxtx.c index 7429bf0..a1c7d09 100644 --- a/lib/libtle_l4p/tcp_rxtx.c +++ b/lib/libtle_l4p/tcp_rxtx.c @@ -1080,8 +1080,17 @@ rx_fin(struct tle_tcp_stream *s, uint32_t state, return -ENOBUFS; } - /* process ack here */ - rx_ackdata(s, si->ack); + /* + * fast-path: all data & FIN was already sent out + * and now is acknowledged. + */ + if (s->tcb.snd.fss == s->tcb.snd.nxt && + si->ack == (uint32_t)s->tcb.snd.nxt) { + s->tcb.snd.una = s->tcb.snd.fss; + empty_tq(s); + /* conventional ACK processiing */ + } else + rx_ackdata(s, si->ack); /* some fragments still missing */ if (seq + plen != s->tcb.rcv.nxt) { @@ -1470,7 +1479,7 @@ rx_ackfin(struct tle_tcp_stream *s) uint32_t state; s->tcb.snd.una = s->tcb.snd.fss; - empty_mbuf_ring(s->tx.q); + empty_tq(s); state = s->tcb.state; if (state == TCP_ST_LAST_ACK) @@ -1656,7 +1665,7 @@ rx_stream(struct tle_tcp_stream *s, uint32_t ts, * and now is acknowledged. */ if (s->tcb.snd.fss == s->tcb.snd.nxt && - tack.ack == (uint32_t) s->tcb.snd.nxt) + tack.ack == (uint32_t)s->tcb.snd.nxt) rx_ackfin(s); else rx_process_ack(s, ts, &tack); |