aboutsummaryrefslogtreecommitdiff
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
parent9ce4c3abbcf10d13f17e43db9fa0346698e32bc5 (diff)
parentf98df8bbdb991fa1257d42924c75847122549db6 (diff)
Merge branch 'master' into api-next
-rw-r--r--test/performance/odp_pktio_perf.c10
-rw-r--r--test/performance/odp_scheduling.c8
-rw-r--r--test/validation/pktio/pktio.c3
-rw-r--r--test/validation/queue/queue.c4
4 files changed, 22 insertions, 3 deletions
diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
index f75bafd..8f61932 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 8fa7734..889ce1c 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;
}
}
diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index 6b4f3fb..80b3840 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -397,6 +397,9 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, pktio_info_t *pktio_b,
ret = odp_queue_enq_multi(pktio_a->outq, tx_ev, num_pkts);
if (ret != num_pkts) {
CU_FAIL("failed to enqueue test packets");
+ i = ret < 0 ? 0 : ret;
+ for ( ; i < num_pkts; i++)
+ odp_packet_free(tx_pkt[i]);
return;
}
}
diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c
index b700e88..ef7c8f2 100644
--- a/test/validation/queue/queue.c
+++ b/test/validation/queue/queue.c
@@ -91,6 +91,10 @@ static void queue_test_sunnydays(void)
*/
ret = odp_queue_enq_multi(queue_id, enev, MAX_BUFFER_QUEUE);
CU_ASSERT(MAX_BUFFER_QUEUE == ret);
+ i = ret < 0 ? 0 : ret;
+ for ( ; i < MAX_BUFFER_QUEUE; i++)
+ odp_event_free(enev[i]);
+
pev_tmp = deev;
do {
deq_ret = odp_queue_deq_multi(queue_id, pev_tmp,