From: Matias Elo <matias....@nokia.com>

Increase maximum number of workers to 128. Also, fixes a buffer overflow
which happened when system's maximum thread count  was larger than the
value of MAX_WORKERS.

Signed-off-by: Matias Elo <matias....@nokia.com>
---
/** Email created from pull request 226 (matiaselo:fix/pktio_perf)
 ** https://github.com/Linaro/odp/pull/226
 ** Patch: https://github.com/Linaro/odp/pull/226.patch
 ** Base sha: a63f25ff2994b2df78c24f1f8b63d0e06628eb68
 ** Merge commit sha: f27f6508db5e35f224cef05813351dc07ab30569
 **/
 test/common_plat/performance/odp_pktio_perf.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/common_plat/performance/odp_pktio_perf.c 
b/test/common_plat/performance/odp_pktio_perf.c
index a170e1285..80ff66843 100644
--- a/test/common_plat/performance/odp_pktio_perf.c
+++ b/test/common_plat/performance/odp_pktio_perf.c
@@ -39,7 +39,7 @@
 #define PKT_BUF_NUM       (32 * 1024)
 #define MAX_NUM_IFACES    2
 #define TEST_HDR_MAGIC    0x92749451
-#define MAX_WORKERS       32
+#define MAX_WORKERS       128
 #define BATCH_LEN_MAX     32
 
 /* Packet rate at which to start when using binary search */
@@ -563,6 +563,12 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx,
                return TEST_SKIP;
        }
 
+       if (num_workers > MAX_WORKERS) {
+               LOG_DBG("Worker count limited to MAX_WORKERS define (=%d)\n",
+                       MAX_WORKERS);
+               num_workers = MAX_WORKERS;
+       }
+
        if (gbl_args->args.num_tx_workers) {
                if (gbl_args->args.num_tx_workers > (num_workers - 1)) {
                        LOG_ERR("Invalid TX worker count\n");

Reply via email to