diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 09:22:35 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 16:09:40 +0200 |
commit | 8b25d1ad5d2264bdfc2818c7bda74ee2697df6db (patch) | |
tree | 8c3c769777f7e66a2d1ba7dd7651b563cfde370b /lib/librte_sched | |
parent | 97f17497d162afdb82c8704bf097f0fee3724b2e (diff) |
Imported Upstream version 16.07-rc1
Change-Id: I40a523e52f12e8496fdd69e902824b0226c303de
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_sched')
-rw-r--r-- | lib/librte_sched/Makefile | 1 | ||||
-rw-r--r-- | lib/librte_sched/rte_red.c | 2 | ||||
-rw-r--r-- | lib/librte_sched/rte_red.h | 25 | ||||
-rw-r--r-- | lib/librte_sched/rte_sched.c | 22 |
4 files changed, 26 insertions, 24 deletions
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile index a782cd1a..44cb780f 100644 --- a/lib/librte_sched/Makefile +++ b/lib/librte_sched/Makefile @@ -59,6 +59,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_SCHED)-include := rte_sched.h rte_bitmap.h rte_sched SYMLINK-$(CONFIG_RTE_LIBRTE_SCHED)-include += rte_reciprocal.h # this lib depends upon: +DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_eal DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_mempool lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_net lib/librte_timer diff --git a/lib/librte_sched/rte_red.c b/lib/librte_sched/rte_red.c index fdf40576..ade57d1f 100644 --- a/lib/librte_sched/rte_red.c +++ b/lib/librte_sched/rte_red.c @@ -77,7 +77,7 @@ __rte_red_init_tables(void) scale = 1024.0; - RTE_RED_ASSERT(RTE_RED_WQ_LOG2_NUM == RTE_DIM(rte_red_log2_1_minus_Wq)); + RTE_ASSERT(RTE_RED_WQ_LOG2_NUM == RTE_DIM(rte_red_log2_1_minus_Wq)); for (i = RTE_RED_WQ_LOG2_MIN; i <= RTE_RED_WQ_LOG2_MAX; i++) { double n = (double)i; diff --git a/lib/librte_sched/rte_red.h b/lib/librte_sched/rte_red.h index 7f9ac901..ca122275 100644 --- a/lib/librte_sched/rte_red.h +++ b/lib/librte_sched/rte_red.h @@ -63,19 +63,6 @@ extern "C" { #define RTE_RED_INT16_NBITS (sizeof(uint16_t) * CHAR_BIT) #define RTE_RED_WQ_LOG2_NUM (RTE_RED_WQ_LOG2_MAX - RTE_RED_WQ_LOG2_MIN + 1) -#ifdef RTE_RED_DEBUG - -#define RTE_RED_ASSERT(exp) \ -if (!(exp)) { \ - rte_panic("line%d\tassert \"" #exp "\" failed\n", __LINE__); \ -} - -#else - -#define RTE_RED_ASSERT(exp) do { } while(0) - -#endif /* RTE_RED_DEBUG */ - /** * Externs * @@ -246,8 +233,8 @@ rte_red_enqueue_empty(const struct rte_red_config *red_cfg, { uint64_t time_diff = 0, m = 0; - RTE_RED_ASSERT(red_cfg != NULL); - RTE_RED_ASSERT(red != NULL); + RTE_ASSERT(red_cfg != NULL); + RTE_ASSERT(red != NULL); red->count ++; @@ -361,8 +348,8 @@ rte_red_enqueue_nonempty(const struct rte_red_config *red_cfg, struct rte_red *red, const unsigned q) { - RTE_RED_ASSERT(red_cfg != NULL); - RTE_RED_ASSERT(red != NULL); + RTE_ASSERT(red_cfg != NULL); + RTE_ASSERT(red != NULL); /** * EWMA filter (Sally Floyd and Van Jacobson): @@ -424,8 +411,8 @@ rte_red_enqueue(const struct rte_red_config *red_cfg, const unsigned q, const uint64_t time) { - RTE_RED_ASSERT(red_cfg != NULL); - RTE_RED_ASSERT(red != NULL); + RTE_ASSERT(red_cfg != NULL); + RTE_ASSERT(red != NULL); if (q != 0) { return rte_red_enqueue_nonempty(red_cfg, red, q); diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index 1609ea87..86964234 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -1084,10 +1084,17 @@ rte_sched_port_update_subport_stats(struct rte_sched_port *port, uint32_t qindex s->stats.n_bytes_tc[tc_index] += pkt_len; } +#ifdef RTE_SCHED_RED static inline void rte_sched_port_update_subport_stats_on_drop(struct rte_sched_port *port, - uint32_t qindex, - struct rte_mbuf *pkt, uint32_t red) + uint32_t qindex, + struct rte_mbuf *pkt, uint32_t red) +#else +static inline void +rte_sched_port_update_subport_stats_on_drop(struct rte_sched_port *port, + uint32_t qindex, + struct rte_mbuf *pkt, __rte_unused uint32_t red) +#endif { struct rte_sched_subport *s = port->subport + (qindex / rte_sched_port_queues_per_subport(port)); uint32_t tc_index = (qindex >> 2) & 0x3; @@ -1110,10 +1117,17 @@ rte_sched_port_update_queue_stats(struct rte_sched_port *port, uint32_t qindex, qe->stats.n_bytes += pkt_len; } +#ifdef RTE_SCHED_RED static inline void rte_sched_port_update_queue_stats_on_drop(struct rte_sched_port *port, - uint32_t qindex, - struct rte_mbuf *pkt, uint32_t red) + uint32_t qindex, + struct rte_mbuf *pkt, uint32_t red) +#else +static inline void +rte_sched_port_update_queue_stats_on_drop(struct rte_sched_port *port, + uint32_t qindex, + struct rte_mbuf *pkt, __rte_unused uint32_t red) +#endif { struct rte_sched_queue_extra *qe = port->queue_extra + qindex; uint32_t pkt_len = pkt->pkt_len; |