aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libtle_udp/udp_impl.h
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2016-07-07 20:24:24 +0100
committerKonstantin Ananyev <konstantin.ananyev@intel.com>2016-07-07 23:41:30 +0100
commit8efc4c11464fd76db6c2a145664aa047615b749e (patch)
tree3061254b813f3c5592d7f92788f7abe2f155f791 /lib/libtle_udp/udp_impl.h
parenta633eec74619a96925285ac4dcf0154fbfafb855 (diff)
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 <konstantin.ananyev@intel.com>
Diffstat (limited to 'lib/libtle_udp/udp_impl.h')
-rw-r--r--lib/libtle_udp/udp_impl.h23
1 files changed, 14 insertions, 9 deletions
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 <rte_spinlock.h>
#include <rte_vect.h>
+#include <tle_dring.h>
#include <tle_udp_impl.h>
#include <tle_event.h>
-#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. */