aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Uvarov <maxim.uvarov@linaro.org>2018-08-09 14:52:43 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-08-20 16:53:14 +0300
commit048f089a6b5fec94c09d9c3ba60105fe89b43c90 (patch)
tree6e1f8cc63730cc40a5e5289319f9b9c961165a80
parentbb4c8fb4e9311401acf31756d746b91fbd949699 (diff)
example: tm: use 0 array index for queues
For some reason 0 array index was skipped and loop started from 1. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
-rw-r--r--example/traffic_mgmt/odp_traffic_mgmt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c
index 42fff66fe..6a60993da 100644
--- a/example/traffic_mgmt/odp_traffic_mgmt.c
+++ b/example/traffic_mgmt/odp_traffic_mgmt.c
@@ -230,7 +230,7 @@ static odp_tm_t odp_tm_test;
static odp_pool_t odp_pool;
-static odp_tm_queue_t queue_num_tbls[NUM_SVC_CLASSES][TM_QUEUES_PER_CLASS + 1];
+static odp_tm_queue_t queue_num_tbls[NUM_SVC_CLASSES][TM_QUEUES_PER_CLASS];
static uint32_t next_queue_nums[NUM_SVC_CLASSES];
static uint8_t random_buf[RANDOM_BUF_LEN];
@@ -434,7 +434,7 @@ static int config_example_user(odp_tm_node_t cos_tm_node,
return rc;
svc_class_queue_num = next_queue_nums[svc_class]++;
- queue_num_tbls[svc_class][svc_class_queue_num + 1] =
+ queue_num_tbls[svc_class][svc_class_queue_num] =
tm_queue;
}
}
@@ -633,7 +633,7 @@ static int traffic_generator(uint32_t pkts_to_send)
while (pkt_cnt < pkts_to_send) {
svc_class = pkt_service_class();
queue_num = random_16() & (TM_QUEUES_PER_CLASS - 1);
- tm_queue = queue_num_tbls[svc_class][queue_num + 1];
+ tm_queue = queue_num_tbls[svc_class][queue_num];
pkt_len = ((uint32_t)((random_8() & 0x7F) + 2)) * 32;
pkt_len = MIN(pkt_len, 1500);
pkt = make_odp_packet(pkt_len);
@@ -754,7 +754,7 @@ static int destroy_tm_queues(void)
odp_tm_queue_t tm_queue;
odp_tm_queue_info_t info;
- tm_queue = queue_num_tbls[i][class + 1];
+ tm_queue = queue_num_tbls[i][class];
ret = odp_tm_queue_info(tm_queue, &info);
if (ret) {