aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@linaro.org>2018-10-12 16:02:50 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-10-15 16:59:32 +0300
commitcd760151e86ac1276906edc83856650b7694162e (patch)
tree9f09114e63bb381d42b7eeb3760cff68c2cfa424
parent99a96552ddc57fa93af1eb041b71c55e0927fa75 (diff)
test: scheduling: honor pool capability
Limit pool size to maximum pool capability. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--test/performance/odp_scheduling.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c
index 3b75f635e..5eeb69264 100644
--- a/test/performance/odp_scheduling.c
+++ b/test/performance/odp_scheduling.c
@@ -30,7 +30,7 @@
/* GNU lib C */
#include <getopt.h>
-#define NUM_MSG (512 * 1024) /**< Number of msg in pool */
+#define MAX_BUF (512 * 1024) /**< Maximum pool size */
#define MAX_ALLOCS 32 /**< Alloc burst size */
#define QUEUES_PER_PRIO 64 /**< Queue per priority */
#define NUM_PRIOS 2 /**< Number of tested priorities */
@@ -813,7 +813,8 @@ int main(int argc, char *argv[])
odp_instance_t instance;
odph_odpthread_params_t thr_params;
odp_queue_capability_t capa;
- uint32_t num_queues;
+ odp_pool_capability_t pool_capa;
+ uint32_t num_queues, num_buf;
printf("\nODP example starts\n\n");
@@ -869,11 +870,19 @@ int main(int argc, char *argv[])
/*
* Create message pool
*/
+ if (odp_pool_capability(&pool_capa)) {
+ LOG_ERR("Pool capabilities failed.\n");
+ return -1;
+ }
+
+ num_buf = MAX_BUF;
+ if (pool_capa.buf.max_num && pool_capa.buf.max_num < MAX_BUF)
+ num_buf = pool_capa.buf.max_num;
odp_pool_param_init(&params);
params.buf.size = sizeof(test_message_t);
params.buf.align = 0;
- params.buf.num = NUM_MSG;
+ params.buf.num = num_buf;
params.type = ODP_POOL_BUFFER;
pool = odp_pool_create("msg_pool", &params);