diff options
Diffstat (limited to 'lib/libtle_l4p/tcp_ctl.h')
-rw-r--r-- | lib/libtle_l4p/tcp_ctl.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/libtle_l4p/tcp_ctl.h b/lib/libtle_l4p/tcp_ctl.h index f7e70e3..32faaa2 100644 --- a/lib/libtle_l4p/tcp_ctl.h +++ b/lib/libtle_l4p/tcp_ctl.h @@ -55,8 +55,16 @@ calc_rx_wnd(const struct tle_tcp_stream *s, uint32_t scale) return _rte_ring_get_mask(s->rx.q) << scale; } +/* empty stream's send queue */ +static inline void +empty_tq(struct tle_tcp_stream *s) +{ + s->tx.q->cons.head = s->tx.q->cons.tail; + empty_mbuf_ring(s->tx.q); +} + /* empty stream's receive queue */ -static void +static inline void empty_rq(struct tle_tcp_stream *s) { empty_mbuf_ring(s->rx.q); @@ -64,7 +72,7 @@ empty_rq(struct tle_tcp_stream *s) } /* empty stream's listen queue */ -static void +static inline void empty_lq(struct tle_tcp_stream *s, struct stbl *st) { uint32_t i, n; @@ -117,7 +125,7 @@ tcp_stream_reset(struct tle_ctx *ctx, struct tle_tcp_stream *s) } /* empty TX queue */ - empty_mbuf_ring(s->tx.q); + empty_tq(s); /* * mark the stream as free again. |