aboutsummaryrefslogtreecommitdiff
path: root/test/performance
diff options
context:
space:
mode:
authorMaxim Uvarov <maxim.uvarov@linaro.org>2015-07-13 17:07:31 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-07-13 17:07:31 +0300
commit13ae91af60d74155ee3666115d7aa2ac4e441087 (patch)
tree65312c581869fa6d61952d7a2bacb1294098c5da /test/performance
parent9ce4c3abbcf10d13f17e43db9fa0346698e32bc5 (diff)
parentf98df8bbdb991fa1257d42924c75847122549db6 (diff)
Merge branch 'master' into api-next
Diffstat (limited to 'test/performance')
-rw-r--r--test/performance/odp_pktio_perf.c10
-rw-r--r--test/performance/odp_scheduling.c8
2 files changed, 15 insertions, 3 deletions
diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
index f75bafd32..8f61932c8 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -270,6 +270,9 @@ static int alloc_packets(odp_event_t *event_tbl, int num_pkts)
static int send_packets(odp_queue_t outq,
odp_event_t *event_tbl, unsigned num_pkts)
{
+ int ret;
+ unsigned i;
+
if (num_pkts == 0)
return 0;
else if (num_pkts == 1) {
@@ -281,7 +284,12 @@ static int send_packets(odp_queue_t outq,
}
}
- return odp_queue_enq_multi(outq, event_tbl, num_pkts);
+ ret = odp_queue_enq_multi(outq, event_tbl, num_pkts);
+ i = ret < 0 ? 0 : ret;
+ for ( ; i < num_pkts; i++)
+ odp_event_free(event_tbl[i]);
+ return ret;
+
}
/*
diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c
index 8fa77347d..889ce1c0d 100644
--- a/test/performance/odp_scheduling.c
+++ b/test/performance/odp_scheduling.c
@@ -535,9 +535,13 @@ static int test_schedule_multi(const char *str, int thr,
}
/* Assume we can enqueue all events */
- if (odp_queue_enq_multi(queue, ev, MULTI_BUFS_MAX) !=
- MULTI_BUFS_MAX) {
+ num = odp_queue_enq_multi(queue, ev, MULTI_BUFS_MAX);
+ if (num != MULTI_BUFS_MAX) {
LOG_ERR(" [%i] Queue enqueue failed.\n", thr);
+ j = num < 0 ? 0 : num;
+ for ( ; j < MULTI_BUFS_MAX; j++)
+ odp_event_free(ev[j]);
+
return -1;
}
}