From patchwork Wed Jul 1 17:06:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 50537 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 922CF214B3 for ; Wed, 1 Jul 2015 17:10:52 +0000 (UTC) Received: by wian6 with SMTP id n6sf16493764wia.2 for ; Wed, 01 Jul 2015 10:10:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=79lffY7LMp1UGi56W74tpTkcBfrOoalDAAMtpiQSxAk=; b=E/eRBllL/De6Er021oxVpzoZtguYsOcYgGHfGA9NIVuJRd1eISNTvqk+a2z8Oh9ngW rTh7qdUUUAR/qyCFGaizkGRz0fGn7vK1VsrjBbNTUmHU3c8SGn3t9tdHTVam+ToXDOVn X0dbwnewiqY16R/tvVK+aPleAVJZmoNBqJjV2KGxC00eLlcozPBenyrbZKZHZNc2MYKP Cf/vg25qieimU3zqyL/nhrNEWEld94vqqO57tEaJJkMAqWH63CVjpCi0cjkmFZYTaL3I 3KT+S61+qsvFYFbQUgh3C796ViC6sTkNTzVZVFrpxZ5Fc2IsF2sgCtrQ+Yj0dMeGGx// NkkA== X-Gm-Message-State: ALoCoQkw0YfybzXBcWsRtoO1JK/QDwtaCq+XKAfnAYrk1UZ8sUpGaVq28EiLfZAhuFewRCC2BZca X-Received: by 10.180.198.172 with SMTP id jd12mr15451230wic.5.1435770651873; Wed, 01 Jul 2015 10:10:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.1 with SMTP id o1ls233311lao.12.gmail; Wed, 01 Jul 2015 10:10:51 -0700 (PDT) X-Received: by 10.112.55.70 with SMTP id q6mr23515137lbp.99.1435770651574; Wed, 01 Jul 2015 10:10:51 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id u2si2217447laa.81.2015.07.01.10.10.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jul 2015 10:10:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lagh6 with SMTP id h6so45039141lag.2 for ; Wed, 01 Jul 2015 10:10:51 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr26376670lbc.86.1435770651456; Wed, 01 Jul 2015 10:10:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp744356lbb; Wed, 1 Jul 2015 10:10:50 -0700 (PDT) X-Received: by 10.140.233.214 with SMTP id e205mr37561035qhc.68.1435770649628; Wed, 01 Jul 2015 10:10:49 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id j202si2992823qhc.29.2015.07.01.10.10.46; Wed, 01 Jul 2015 10:10:49 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 5C38661D21; Wed, 1 Jul 2015 17:10:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 8FE7661F5A; Wed, 1 Jul 2015 17:07:40 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 50E6B61F6F; Wed, 1 Jul 2015 17:07:34 +0000 (UTC) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by lists.linaro.org (Postfix) with ESMTPS id EBA3C61F5D for ; Wed, 1 Jul 2015 17:06:44 +0000 (UTC) Received: by wguu7 with SMTP id u7so42311520wgu.3 for ; Wed, 01 Jul 2015 10:06:44 -0700 (PDT) X-Received: by 10.194.83.70 with SMTP id o6mr49508924wjy.44.1435770404202; Wed, 01 Jul 2015 10:06:44 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id fi6sm4335895wib.6.2015.07.01.10.06.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jul 2015 10:06:43 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 1 Jul 2015 18:06:18 +0100 Message-Id: <1435770379-30000-9-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435770379-30000-1-git-send-email-zoltan.kiss@linaro.org> References: <1435770379-30000-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Cc: Petri Savolainen Subject: [lng-odp] [API-NEXT PATCH v4 8/9] queue: handle return value of odp_queue_enq() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zoltan.kiss@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Unsent packet has to be released. If the event type is obvious from the context, use directly the relevant release functions, otherwise odp_event(free). Wider error handling is attempted, but this patch can't fix all the flaws in the many calling functions of odp_queue_enq() Signed-off-by: Zoltan Kiss --- v4: abort when scheduling fails. example/classifier/odp_classifier.c | 7 ++++++- example/generator/odp_generator.c | 1 + example/ipsec/odp_ipsec.c | 11 ++++++++--- example/ipsec/odp_ipsec_stream.c | 6 +++++- example/packet/odp_pktio.c | 6 +++++- platform/linux-generic/include/odp_schedule_internal.h | 4 ++-- platform/linux-generic/odp_crypto.c | 5 ++++- platform/linux-generic/odp_queue.c | 8 ++++---- platform/linux-generic/odp_schedule.c | 13 +++++++++---- platform/linux-generic/odp_timer.c | 4 +++- test/performance/odp_l2fwd.c | 6 +++++- test/performance/odp_pktio_perf.c | 10 ++++++++-- test/performance/odp_scheduling.c | 7 +++++++ test/validation/classification/odp_classification_tests.c | 3 ++- test/validation/pktio/pktio.c | 1 + test/validation/queue/queue.c | 9 ++++++--- test/validation/scheduler/scheduler.c | 12 ++++++++---- 17 files changed, 84 insertions(+), 29 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 643e16c..7de11c6 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -294,7 +294,12 @@ static void *pktio_receive_thread(void *arg) if (appl->appl_mode == APPL_MODE_DROP) odp_packet_free(pkt); else - odp_queue_enq(outq_def, ev); + if (odp_queue_enq(outq_def, ev)) { + EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", + thr); + odp_packet_free(pkt); + continue; + } } return NULL; diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 0ff264c..afbac86 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -410,6 +410,7 @@ static void *gen_send_thread(void *arg) err = odp_queue_enq(outq_def, odp_packet_to_event(pkt)); if (err != 0) { EXAMPLE_ERR(" [%02i] send pkt err!\n", thr); + odp_packet_free(pkt); return NULL; } diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 4928985..089015f 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1157,7 +1157,8 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) ctx->state = PKT_STATE_TRANSMIT; } else { ctx->state = PKT_STATE_IPSEC_OUT_SEQ; - odp_queue_enq(seqnumq, ev); + if (odp_queue_enq(seqnumq, ev)) + rc = PKT_DROP; } break; @@ -1175,8 +1176,12 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) case PKT_STATE_TRANSMIT: - odp_queue_enq(ctx->outq, ev); - rc = PKT_DONE; + if (odp_queue_enq(ctx->outq, ev)) { + odp_event_free(ev); + rc = PKT_DROP; + } else { + rc = PKT_DONE; + } break; default: diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index a140d36..f533c40 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -566,7 +566,11 @@ int create_stream_db_inputs(void) break; } stream->created++; - odp_queue_enq(queue, odp_packet_to_event(pkt)); + if (odp_queue_enq(queue, odp_packet_to_event(pkt))) { + odp_packet_free(pkt); + printf("Queue enqueue failed\n"); + break; + } /* Count this stream when we create first packet */ if (1 == stream->created) diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 0b4a8f1..8004d69 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -233,7 +233,11 @@ static void *pktio_queue_thread(void *arg) swap_pkt_addrs(&pkt, 1); /* Enqueue the packet for output */ - odp_queue_enq(outq_def, ev); + if (odp_queue_enq(outq_def, ev)) { + EXAMPLE_ERR(" [%i] Queue enqueue failed.\n", thr); + odp_packet_free(pkt); + continue; + } /* Print packet counts every once in a while */ if (odp_unlikely(pkt_cnt++ % 100000 == 0)) { diff --git a/platform/linux-generic/include/odp_schedule_internal.h b/platform/linux-generic/include/odp_schedule_internal.h index 904bfbd..4c6577d 100644 --- a/platform/linux-generic/include/odp_schedule_internal.h +++ b/platform/linux-generic/include/odp_schedule_internal.h @@ -23,9 +23,9 @@ extern "C" { int schedule_queue_init(queue_entry_t *qe); void schedule_queue_destroy(queue_entry_t *qe); -static inline void schedule_queue(const queue_entry_t *qe) +static inline int schedule_queue(const queue_entry_t *qe) { - odp_queue_enq(qe->s.pri_queue, qe->s.cmd_ev); + return odp_queue_enq(qe->s.pri_queue, qe->s.cmd_ev); } diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 515f508..d49e256 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -413,7 +413,10 @@ odp_crypto_operation(odp_crypto_op_params_t *params, op_result = get_op_result_from_event(completion_event); op_result->magic = OP_RESULT_MAGIC; op_result->result = local_result; - odp_queue_enq(session->compl_queue, completion_event); + if (odp_queue_enq(session->compl_queue, completion_event)) { + odp_event_free(completion_event); + return -1; + } /* Indicate to caller operation was async */ *posted = 1; diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 4a0465b..d1c2cfc 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -355,8 +355,8 @@ int queue_enq(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr) UNLOCK(&queue->s.lock); /* Add queue to scheduling */ - if (sched) - schedule_queue(queue); + if (sched && schedule_queue(queue)) + ODP_ABORT("schedule_queue failed\n"); return 0; } @@ -395,8 +395,8 @@ int queue_enq_multi(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num) UNLOCK(&queue->s.lock); /* Add queue to scheduling */ - if (sched) - schedule_queue(queue); + if (sched && schedule_queue(queue)) + ODP_ABORT("schedule_queue failed\n"); return num; /* All events enqueued */ } diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 9206d5c..7a61a42 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -355,7 +355,9 @@ int schedule_pktio_start(odp_pktio_t pktio, int prio) pri_queue = pri_set_pktio(pktio, prio); - odp_queue_enq(pri_queue, odp_buffer_to_event(buf)); + if (odp_queue_enq(pri_queue, odp_buffer_to_event(buf))) + ODP_ABORT("schedule_pktio_start failed\n"); + return 0; } @@ -365,7 +367,8 @@ void odp_schedule_release_atomic(void) if (sched_local.pri_queue != ODP_QUEUE_INVALID && sched_local.num == 0) { /* Release current atomic queue */ - odp_queue_enq(sched_local.pri_queue, sched_local.cmd_ev); + if (odp_queue_enq(sched_local.pri_queue, sched_local.cmd_ev)) + ODP_ABORT("odp_schedule_release_atomic failed\n"); sched_local.pri_queue = ODP_QUEUE_INVALID; } } @@ -456,7 +459,8 @@ static int schedule(odp_queue_t *out_queue, odp_event_t out_ev[], odp_buffer_free(buf); } else { /* Continue scheduling the pktio */ - odp_queue_enq(pri_q, ev); + if (odp_queue_enq(pri_q, ev)) + ODP_ABORT("schedule failed\n"); } continue; @@ -487,7 +491,8 @@ static int schedule(odp_queue_t *out_queue, odp_event_t out_ev[], sched_local.cmd_ev = ev; } else { /* Continue scheduling the queue */ - odp_queue_enq(pri_q, ev); + if (odp_queue_enq(pri_q, ev)) + ODP_ABORT("schedule failed\n"); } /* Output the source queue handle */ diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index d0c1f30..f3de486 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -578,9 +578,11 @@ static unsigned timer_expire(odp_timer_pool *tp, uint32_t idx, uint64_t tick) /* Post the timeout to the destination queue */ int rc = odp_queue_enq(tim->queue, odp_buffer_to_event(tmo_buf)); - if (odp_unlikely(rc != 0)) + if (odp_unlikely(rc != 0)) { + odp_buffer_free(tmo_buf); ODP_ABORT("Failed to enqueue timeout buffer (%d)\n", rc); + } return 1; } else { /* Else false positive, ignore */ diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index dd0b4b1..9cc201f 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -152,7 +152,11 @@ static void *pktio_queue_thread(void *arg) outq_def = lookup_dest_q(pkt); /* Enqueue the packet for output */ - odp_queue_enq(outq_def, ev); + if (odp_queue_enq(outq_def, ev)) { + printf(" [%i] Queue enqueue failed.\n", thr); + odp_packet_free(pkt); + continue; + } stats->packets += 1; } diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 686056e..52bddc4 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -272,8 +272,14 @@ static int send_packets(odp_queue_t outq, { if (num_pkts == 0) return 0; - else if (num_pkts == 1) - return odp_queue_enq(outq, event_tbl[0]) == 0 ? 1 : 0; + else if (num_pkts == 1) { + if (odp_queue_enq(outq, event_tbl[0])) { + odp_event_free(event_tbl[0]); + return 0; + } else { + return 1; + } + } return odp_queue_enq_multi(outq, event_tbl, num_pkts); } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 558fec8..1283986 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -114,6 +114,7 @@ static int create_queue(int thr, odp_pool_t msg_pool, int prio) if (odp_queue_enq(queue, odp_buffer_to_event(buf))) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); + odp_buffer_free(buf); return -1; } @@ -161,6 +162,7 @@ static int create_queues(int thr, odp_pool_t msg_pool, int prio) if (odp_queue_enq(queue, odp_buffer_to_event(buf))) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); + odp_buffer_free(buf); return -1; } } @@ -294,6 +296,7 @@ static int test_poll_queue(int thr, odp_pool_t msg_pool) if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); + odp_buffer_free(buf); return -1; } @@ -352,6 +355,7 @@ static int test_schedule_single(const char *str, int thr, if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); + odp_event_free(ev); return -1; } } @@ -371,6 +375,7 @@ static int test_schedule_single(const char *str, int thr, if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); + odp_event_free(ev); return -1; } } @@ -431,6 +436,7 @@ static int test_schedule_many(const char *str, int thr, if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); + odp_event_free(ev); return -1; } } @@ -450,6 +456,7 @@ static int test_schedule_many(const char *str, int thr, if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); + odp_event_free(ev); return -1; } } diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 0aa4998..4382aee 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -109,7 +109,8 @@ void enqueue_loop_interface(odp_packet_t pkt) odp_queue_t defqueue = odp_pktio_outq_getdef(pktio_loop); ev = odp_packet_to_event(pkt); - CU_ASSERT(odp_queue_enq(defqueue, ev) == 0); + if (!(CU_ASSERT(odp_queue_enq(defqueue, ev) == 0))) + odp_packet_free(pkt); } static inline diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index ab9a305..9d5af22 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -382,6 +382,7 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, pktio_info_t *pktio_b, ret = odp_queue_enq(pktio_a->outq, tx_ev[0]); if (ret != 0) { CU_FAIL("failed to enqueue test packet"); + odp_packet_free(tx_pkt[0]); return; } } else { diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c index f686b71..5f05e49 100644 --- a/test/validation/queue/queue.c +++ b/test/validation/queue/queue.c @@ -72,9 +72,12 @@ static void queue_test_sunnydays(void) CU_ASSERT_FATAL(buf != ODP_BUFFER_INVALID); ev = odp_buffer_to_event(buf); - odp_queue_enq(queue_id, ev); - CU_ASSERT_EQUAL(ev, odp_queue_deq(queue_id)); - odp_buffer_free(buf); + if (!(CU_ASSERT(odp_queue_enq(queue_id, ev) == 0))) { + odp_buffer_free(buf); + } else { + CU_ASSERT_EQUAL(ev, odp_queue_deq(queue_id)); + odp_buffer_free(buf); + } for (i = 0; i < MAX_BUFFER_QUEUE; i++) { odp_buffer_t buf = odp_buffer_alloc(msg_pool); diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index d7f2ac3..7f1b81a 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -139,7 +139,8 @@ static void scheduler_test_queue_destroy(void) u32[0] = MAGIC; ev = odp_buffer_to_event(buf); - CU_ASSERT(odp_queue_enq(queue, ev) == 0); + if (!(CU_ASSERT(odp_queue_enq(queue, ev) == 0))) + odp_buffer_free(buf); ev = odp_schedule(&from, ODP_SCHED_WAIT); @@ -289,8 +290,10 @@ static void fill_queues(thread_args_t *args) buf = odp_buffer_alloc(pool); CU_ASSERT_FATAL(buf != ODP_BUFFER_INVALID); ev = odp_buffer_to_event(buf); - CU_ASSERT(odp_queue_enq(queue, ev) == 0); - buf_count++; + if (!(CU_ASSERT(odp_queue_enq(queue, ev) == 0))) + odp_buffer_free(buf); + else + buf_count++; } } } @@ -572,7 +575,8 @@ static void scheduler_test_pause_resume(void) buf = odp_buffer_alloc(pool); CU_ASSERT_FATAL(buf != ODP_BUFFER_INVALID); ev = odp_buffer_to_event(buf); - odp_queue_enq(queue, ev); + if (odp_queue_enq(queue, ev)) + odp_buffer_free(buf); } for (i = 0; i < NUM_BUFS_BEFORE_PAUSE; i++) {