diff options
author | Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> | 2017-05-11 13:36:12 +0100 |
---|---|---|
committer | Mohammad Abdul Awal <mohammad.abdul.awal@intel.com> | 2017-05-15 15:11:36 +0100 |
commit | fbba0a3bf2dbfd86e48efe9745af9f94203d5f80 (patch) | |
tree | 69ba709ff7ebc503fc2036324c1ffa09037a9f7d /lib/libtle_l4p/tcp_txq.h | |
parent | 8d020909941acca43cf7e772a99682a894347526 (diff) |
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>
Diffstat (limited to 'lib/libtle_l4p/tcp_txq.h')
-rw-r--r-- | lib/libtle_l4p/tcp_txq.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libtle_l4p/tcp_txq.h b/lib/libtle_l4p/tcp_txq.h index 0b199ba..78f1d56 100644 --- a/lib/libtle_l4p/tcp_txq.h +++ b/lib/libtle_l4p/tcp_txq.h @@ -27,15 +27,15 @@ tcp_txq_get_nxt_objs(const struct tle_tcp_stream *s, uint32_t *num) struct rte_ring *r; r = s->tx.q; - sz = r->prod.size; - mask = r->prod.mask; + sz = _rte_ring_get_size(r); + mask = _rte_ring_get_mask(r); head = r->cons.head & mask; tail = r->prod.tail & mask; cnt = (tail >= head) ? tail - head : sz - head; *num = cnt; - return (struct rte_mbuf **)(r->ring + head); + return (struct rte_mbuf **)(_rte_ring_get_data(r) + head); } static inline struct rte_mbuf ** @@ -45,15 +45,15 @@ tcp_txq_get_una_objs(const struct tle_tcp_stream *s, uint32_t *num) struct rte_ring *r; r = s->tx.q; - sz = r->prod.size; - mask = r->prod.mask; + sz = _rte_ring_get_size(r); + mask = _rte_ring_get_mask(r); head = r->prod.tail & mask; tail = r->cons.tail & mask; cnt = (head >= tail) ? head - tail : sz - tail; *num = cnt; - return (struct rte_mbuf **)(r->ring + tail); + return (struct rte_mbuf **)(_rte_ring_get_data(r) + tail); } static inline void @@ -90,7 +90,7 @@ tcp_txq_nxt_cnt(struct tle_tcp_stream *s) struct rte_ring *r; r = s->tx.q; - return (r->prod.tail - r->cons.head) & r->prod.mask; + return (r->prod.tail - r->cons.head) & _rte_ring_get_mask(r); } static inline void @@ -101,7 +101,7 @@ txs_enqueue(struct tle_ctx *ctx, struct tle_tcp_stream *s) if (rte_atomic32_add_return(&s->tx.arm, 1) == 1) { r = CTX_TCP_TSQ(ctx); - n = rte_ring_enqueue_burst(r, (void * const *)&s, 1); + n = _rte_ring_enqueue_burst(r, (void * const *)&s, 1); RTE_VERIFY(n == 1); } } @@ -112,7 +112,7 @@ txs_dequeue_bulk(struct tle_ctx *ctx, struct tle_tcp_stream *s[], uint32_t num) struct rte_ring *r; r = CTX_TCP_TSQ(ctx); - return rte_ring_dequeue_burst(r, (void **)s, num); + return _rte_ring_dequeue_burst(r, (void **)s, num); } #ifdef __cplusplus |