This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via b018868aa429fd25dae1137490419784e8e569f9 (commit) via 8d020fe812be982564465c0812468ce6194a5025 (commit) via cb9b43cc218eb4304c508f577293d401180da0ae (commit) from 2b9f90dc54c5d699083970cbd359db4f137faa31 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit b018868aa429fd25dae1137490419784e8e569f9 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 22 13:11:40 2016 +0300
linux-gen: tm: use directly ODP_PACKET_INVALID
Removed INVALID_PKT define and used directly ODP_PACKET_INVALID, which makes it easier to e.g. grep for invalid packets over entire implementation.
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_traffic_mngr_internal.h b/platform/linux-generic/include/odp_traffic_mngr_internal.h index 8585b0a..85a31e9 100644 --- a/platform/linux-generic/include/odp_traffic_mngr_internal.h +++ b/platform/linux-generic/include/odp_traffic_mngr_internal.h @@ -38,8 +38,6 @@ typedef struct stat file_stat_t;
#define INPUT_WORK_RING_SIZE (16 * 1024)
-#define INVALID_PKT ODP_PACKET_INVALID - #define TM_QUEUE_MAGIC_NUM 0xBABEBABE #define TM_NODE_MAGIC_NUM 0xBEEFBEEF
diff --git a/platform/linux-generic/odp_pkt_queue.c b/platform/linux-generic/odp_pkt_queue.c index cbaea64..cbe1e74 100644 --- a/platform/linux-generic/odp_pkt_queue.c +++ b/platform/linux-generic/odp_pkt_queue.c @@ -17,7 +17,6 @@ #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define INVALID_PKT ODP_PACKET_INVALID #define NUM_PKTS 7
typedef struct /* Must be exactly 64 bytes long AND cacheline aligned! */ { @@ -70,7 +69,7 @@ static inline void init_queue_blk(queue_blk_t *queue_blk) memset(queue_blk, 0, sizeof(queue_blk_t));
for (i = 0; i < NUM_PKTS; i++) - queue_blk->pkts[i] = INVALID_PKT; + queue_blk->pkts[i] = ODP_PACKET_INVALID; }
static queue_blk_t *blk_idx_to_queue_blk(queue_pool_t *queue_pool, @@ -259,7 +258,7 @@ int _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool, if ((queue_num == 0) || (pool->max_queue_num < queue_num)) return -2;
- if (pkt == INVALID_PKT) + if (pkt == ODP_PACKET_INVALID) return -3;
pool->total_pkt_appends++; @@ -284,7 +283,7 @@ int _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool,
/* Find first empty slot and insert pkt there. */ for (idx = 0; idx < NUM_PKTS; idx++) { - if (tail_blk->pkts[idx] == INVALID_PKT) { + if (tail_blk->pkts[idx] == ODP_PACKET_INVALID) { tail_blk->pkts[idx] = pkt; return 0; } @@ -323,13 +322,13 @@ int _odp_pkt_queue_remove(_odp_int_queue_pool_t queue_pool, /* Now remove the first valid odp_packet_t handle value we find. */ first_blk = blk_idx_to_queue_blk(pool, first_blk_idx); for (idx = 0; idx < NUM_PKTS; idx++) { - if (first_blk->pkts[idx] != INVALID_PKT) { + if (first_blk->pkts[idx] != ODP_PACKET_INVALID) { *pkt = first_blk->pkts[idx]; - first_blk->pkts[idx] = INVALID_PKT; + first_blk->pkts[idx] = ODP_PACKET_INVALID;
/* Now see if there are any more pkts in this queue. */ if ((idx == 6) || - (first_blk->pkts[idx + 1] == INVALID_PKT)) { + (first_blk->pkts[idx + 1] == ODP_PACKET_INVALID)) { /* We have reached the end of this queue_blk. * Check to see if there is a following block * or not diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index 1fa2d27..681df00 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -2096,7 +2096,7 @@ static void tm_send_pkt(tm_system_t *tm_system, uint32_t max_sends) return;
odp_pkt = tm_queue_obj->pkt; - if (odp_pkt == INVALID_PKT) { + if (odp_pkt == ODP_PACKET_INVALID) { tm_system->egress_pkt_desc = EMPTY_PKT_DESC; return; } @@ -2114,10 +2114,10 @@ static void tm_send_pkt(tm_system_t *tm_system, uint32_t max_sends)
tm_queue_obj->sent_pkt = tm_queue_obj->pkt; tm_queue_obj->sent_pkt_desc = tm_queue_obj->in_pkt_desc; - tm_queue_obj->pkt = INVALID_PKT; + tm_queue_obj->pkt = ODP_PACKET_INVALID; tm_queue_obj->in_pkt_desc = EMPTY_PKT_DESC; tm_consume_sent_pkt(tm_system, &tm_queue_obj->sent_pkt_desc); - tm_queue_obj->sent_pkt = INVALID_PKT; + tm_queue_obj->sent_pkt = ODP_PACKET_INVALID; tm_queue_obj->sent_pkt_desc = EMPTY_PKT_DESC; if (tm_system->egress_pkt_desc.queue_num == 0) return; @@ -2152,7 +2152,7 @@ static int tm_process_input_work_queue(tm_system_t *tm_system, }
tm_queue_obj->pkts_rcvd_cnt++; - if (tm_queue_obj->pkt != INVALID_PKT) { + if (tm_queue_obj->pkt != ODP_PACKET_INVALID) { /* If the tm_queue_obj already has a pkt to work with, * then just add this new pkt to the associated * _odp_int_pkt_queue. */ @@ -3674,7 +3674,7 @@ odp_tm_queue_t odp_tm_queue_create(odp_tm_t odp_tm, tm_queue_obj->queue_num = tm_system->next_queue_num++; tm_queue_obj->tm_wred_node = tm_wred_node; tm_queue_obj->_odp_int_pkt_queue = _odp_int_pkt_queue; - tm_queue_obj->pkt = INVALID_PKT; + tm_queue_obj->pkt = ODP_PACKET_INVALID; odp_ticketlock_init(&tm_wred_node->tm_wred_node_lock);
tm_queue_obj->tm_qentry.s.type = ODP_QUEUE_TYPE_TM; @@ -3727,7 +3727,7 @@ int odp_tm_queue_destroy(odp_tm_queue_t tm_queue) * current pkt, otherwise the destroy fails. */ shaper_obj = &tm_queue_obj->shaper_obj; if ((shaper_obj->next_tm_node != NULL) || - (tm_queue_obj->pkt != INVALID_PKT)) + (tm_queue_obj->pkt != ODP_PACKET_INVALID)) return -1;
/* Check that there is no shaper profile, threshold profile or wred
commit 8d020fe812be982564465c0812468ce6194a5025 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 22 13:11:39 2016 +0300
linux-gen: sched: remove dummy pool from SP scheduler
Dummy pool creation is not needed anymore since timer and TM bugs (zero as invalid handle) have been corrented.
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 0973239..8c45123 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -14,9 +14,6 @@ #include <odp_align_internal.h> #include <odp_config_internal.h>
-/* Dummy pool */ -#include <odp/api/pool.h> - #define NUM_QUEUE ODP_CONFIG_QUEUES #define NUM_PKTIO ODP_CONFIG_PKTIO_ENTRIES #define NUM_PRIO 3 @@ -95,13 +92,9 @@ typedef struct { static sched_global_t sched_global; static __thread sched_local_t sched_local;
-/* Dummy pool */ -static odp_pool_t dummy_pool; - static int init_global(void) { int i; - odp_pool_param_t params; sched_group_t *sched_group = &sched_global.sched_group;
ODP_DBG("Using SP scheduler\n"); @@ -139,16 +132,6 @@ static int init_global(void) odp_thrmask_zero(&sched_group->s.group[GROUP_CONTROL].mask); sched_group->s.group[GROUP_CONTROL].allocated = 1;
- /* REMOVE dummy pool after a bug has been fixed in pool or timer code. - * If scheduler does not create a pool, timer validation test fails !!! - */ - odp_pool_param_init(¶ms); - params.buf.size = 48; - params.buf.align = 0; - params.buf.num = NUM_QUEUE + NUM_PKTIO; - params.type = ODP_POOL_BUFFER; - dummy_pool = odp_pool_create("dummy_sched_pool", ¶ms); - return 0; }
@@ -171,8 +154,6 @@ static int term_global(void) } }
- odp_pool_destroy(dummy_pool); - return 0; }
commit cb9b43cc218eb4304c508f577293d401180da0ae Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 22 13:11:38 2016 +0300
linux-gen: tm: correct invalid packet handle definitions
TM code used zero as the invalid packet handle value. Use ODP_PACKET_INVALID instead, which currently has a non-zero value. This mismatch caused bugs when packet handle value was zero (first packet from pool 0).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_traffic_mngr_internal.h b/platform/linux-generic/include/odp_traffic_mngr_internal.h index 3586889..8585b0a 100644 --- a/platform/linux-generic/include/odp_traffic_mngr_internal.h +++ b/platform/linux-generic/include/odp_traffic_mngr_internal.h @@ -38,7 +38,7 @@ typedef struct stat file_stat_t;
#define INPUT_WORK_RING_SIZE (16 * 1024)
-#define INVALID_PKT 0 +#define INVALID_PKT ODP_PACKET_INVALID
#define TM_QUEUE_MAGIC_NUM 0xBABEBABE #define TM_NODE_MAGIC_NUM 0xBEEFBEEF diff --git a/platform/linux-generic/odp_pkt_queue.c b/platform/linux-generic/odp_pkt_queue.c index 949cf74..cbaea64 100644 --- a/platform/linux-generic/odp_pkt_queue.c +++ b/platform/linux-generic/odp_pkt_queue.c @@ -17,12 +17,13 @@ #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define INVALID_PKT 0 +#define INVALID_PKT ODP_PACKET_INVALID +#define NUM_PKTS 7
typedef struct /* Must be exactly 64 bytes long AND cacheline aligned! */ { uint32_t next_queue_blk_idx; uint32_t tail_queue_blk_idx; - odp_packet_t pkts[7]; + odp_packet_t pkts[NUM_PKTS]; } ODP_ALIGNED_CACHE queue_blk_t;
typedef struct { @@ -62,6 +63,16 @@ typedef struct { uint8_t all_regions_used; } queue_pool_t;
+static inline void init_queue_blk(queue_blk_t *queue_blk) +{ + int i; + + memset(queue_blk, 0, sizeof(queue_blk_t)); + + for (i = 0; i < NUM_PKTS; i++) + queue_blk->pkts[i] = INVALID_PKT; +} + static queue_blk_t *blk_idx_to_queue_blk(queue_pool_t *queue_pool, uint32_t queue_blk_idx) { @@ -91,9 +102,13 @@ static int pkt_queue_free_list_add(queue_pool_t *pool, num_blks = region_desc->num_blks; queue_blks = region_desc->queue_blks; if (!queue_blks) { + uint32_t i; malloc_len = num_blks * sizeof(queue_blk_t); queue_blks = malloc(malloc_len); - memset(queue_blks, 0, malloc_len); + + for (i = 0; i < num_blks; i++) + init_queue_blk(&queue_blks->blks[i]); + region_desc->queue_blks = queue_blks; }
@@ -146,7 +161,7 @@ static queue_blk_t *queue_blk_alloc(queue_pool_t *pool, if (pool->free_list_size < pool->min_free_list_size) pool->min_free_list_size = pool->free_list_size;
- memset(head_queue_blk, 0, sizeof(queue_blk_t)); + init_queue_blk(head_queue_blk); return head_queue_blk; }
@@ -255,7 +270,7 @@ int _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool, return -1;
pool->queue_num_tbl[queue_num] = first_blk_idx; - memset(first_blk, 0, sizeof(queue_blk_t)); + init_queue_blk(first_blk); first_blk->pkts[0] = pkt; return 0; } @@ -268,7 +283,7 @@ int _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool, tail_blk = blk_idx_to_queue_blk(pool, tail_blk_idx);
/* Find first empty slot and insert pkt there. */ - for (idx = 0; idx < 7; idx++) { + for (idx = 0; idx < NUM_PKTS; idx++) { if (tail_blk->pkts[idx] == INVALID_PKT) { tail_blk->pkts[idx] = pkt; return 0; @@ -282,7 +297,7 @@ int _odp_pkt_queue_append(_odp_int_queue_pool_t queue_pool, if (!new_tail_blk) return -1;
- memset(new_tail_blk, 0, sizeof(queue_blk_t)); + init_queue_blk(new_tail_blk); new_tail_blk->pkts[0] = pkt; tail_blk->next_queue_blk_idx = new_tail_blk_idx; first_blk->tail_queue_blk_idx = new_tail_blk_idx; @@ -307,7 +322,7 @@ int _odp_pkt_queue_remove(_odp_int_queue_pool_t queue_pool,
/* Now remove the first valid odp_packet_t handle value we find. */ first_blk = blk_idx_to_queue_blk(pool, first_blk_idx); - for (idx = 0; idx < 7; idx++) { + for (idx = 0; idx < NUM_PKTS; idx++) { if (first_blk->pkts[idx] != INVALID_PKT) { *pkt = first_blk->pkts[idx]; first_blk->pkts[idx] = INVALID_PKT; diff --git a/test/validation/traffic_mngr/traffic_mngr.c b/test/validation/traffic_mngr/traffic_mngr.c index 0645370..1c4e90b 100644 --- a/test/validation/traffic_mngr/traffic_mngr.c +++ b/test/validation/traffic_mngr/traffic_mngr.c @@ -2086,14 +2086,14 @@ int traffic_mngr_suite_term(void) /* Close the pktios and associated packet pools. */ free_rcvd_pkts(); for (iface = 0; iface < num_ifaces; iface++) { - if (odp_pool_destroy(pools[iface]) != 0) - return -1; - if (odp_pktio_stop(pktios[iface]) != 0) return -1;
if (odp_pktio_close(pktios[iface]) != 0) return -1; + + if (odp_pool_destroy(pools[iface]) != 0) + return -1; }
return 0;
-----------------------------------------------------------------------
Summary of changes: .../include/odp_traffic_mngr_internal.h | 2 -- platform/linux-generic/odp_pkt_queue.c | 40 +++++++++++++++------- platform/linux-generic/odp_schedule_sp.c | 19 ---------- platform/linux-generic/odp_traffic_mngr.c | 12 +++---- test/validation/traffic_mngr/traffic_mngr.c | 6 ++-- 5 files changed, 36 insertions(+), 43 deletions(-)
hooks/post-receive