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/udp_stream.c | |
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/udp_stream.c')
-rw-r--r-- | lib/libtle_l4p/udp_stream.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libtle_l4p/udp_stream.c b/lib/libtle_l4p/udp_stream.c index 9f379d9..29f5a40 100644 --- a/lib/libtle_l4p/udp_stream.c +++ b/lib/libtle_l4p/udp_stream.c @@ -69,7 +69,7 @@ init_stream(struct tle_ctx *ctx, struct tle_udp_stream *s) n = RTE_MAX(ctx->prm.max_stream_rbufs, 1U); n = rte_align32pow2(n); - sz = sizeof(*s->rx.q) + n * sizeof(s->rx.q->ring[0]); + sz = rte_ring_get_memsize(n); s->rx.q = rte_zmalloc_socket(NULL, sz, RTE_CACHE_LINE_SIZE, ctx->prm.socket_id); @@ -90,7 +90,7 @@ init_stream(struct tle_ctx *ctx, struct tle_udp_stream *s) n = rte_align32pow2(k); /* size of the drbs ring */ - rsz = sizeof(*s->tx.drb.r) + n * sizeof(s->tx.drb.r->ring[0]); + rsz = rte_ring_get_memsize(n); rsz = RTE_ALIGN_CEIL(rsz, RTE_CACHE_LINE_SIZE); /* size of the drb. */ @@ -137,7 +137,7 @@ udp_free_drbs(struct tle_stream *s, struct tle_drb *drb[], uint32_t nb_drb) struct tle_udp_stream *us; us = (struct tle_udp_stream *)s; - rte_ring_enqueue_burst(us->tx.drb.r, (void **)drb, nb_drb); + _rte_ring_enqueue_burst(us->tx.drb.r, (void **)drb, nb_drb); } static int |