From 8efc4c11464fd76db6c2a145664aa047615b749e Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Thu, 7 Jul 2016 20:24:24 +0100 Subject: 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 --- lib/libtle_udp/udp_impl.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'lib/libtle_udp/udp_impl.h') diff --git a/lib/libtle_udp/udp_impl.h b/lib/libtle_udp/udp_impl.h index fbdb743..af35197 100644 --- a/lib/libtle_udp/udp_impl.h +++ b/lib/libtle_udp/udp_impl.h @@ -18,10 +18,10 @@ #include #include +#include #include #include -#include "buf_cage.h" #include "port_bitmap.h" #include "osdep.h" @@ -104,16 +104,24 @@ struct tle_udp_stream { struct { rte_atomic32_t use; - rte_spinlock_t lock; + struct { + uint32_t nb_elem; /* number of obects per drb. */ + uint32_t nb_max; /* number of drbs per stream. */ + struct rte_ring *r; + } drb; struct tle_event *ev; struct tle_udp_stream_cb cb; - struct bcg_store *st; - struct buf_cage *cg[RTE_MAX_ETHPORTS]; } tx __rte_cache_aligned; struct tle_udp_stream_param prm; } __rte_cache_aligned; +#define UDP_STREAM_TX_PENDING(s) \ + ((s)->tx.drb.nb_max != rte_ring_count((s)->tx.drb.r)) + +#define UDP_STREAM_TX_FINISHED(s) \ + ((s)->tx.drb.nb_max == rte_ring_count((s)->tx.drb.r)) + struct tle_udp_dport { struct udp_pbm use; /* ports in use. */ struct tle_udp_stream *streams[MAX_PORT_NUM]; /* port to stream. */ @@ -128,11 +136,9 @@ struct tle_udp_dev { /* used by FE. */ uint64_t ol_flags[TLE_UDP_VNUM]; rte_atomic32_t packet_id[TLE_UDP_VNUM]; - struct bcg_queue feq; - /* used by BE only. */ - struct bcg_queue beq __rte_cache_min_aligned; - struct buf_cage *bc; + /* used by FE & BE. */ + struct tle_dring dr; } tx; struct tle_udp_dev_param prm; /* copy of device paramaters. */ struct tle_udp_dport *dp[TLE_UDP_VNUM]; /* device udp ports */ @@ -140,7 +146,6 @@ struct tle_udp_dev { struct tle_udp_ctx { struct tle_udp_ctx_param prm; - struct { rte_spinlock_t lock; uint32_t nb_free; /* number of free streams. */ -- cgit 1.2.3-korg