From patchwork Fri Jun 5 17:51:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 49589 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2E39F2154F for ; Fri, 5 Jun 2015 17:55:30 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf19707309lbc.2 for ; Fri, 05 Jun 2015 10:55:29 -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: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=UOWP9gFvqEAMk1eszUmyLk7xvrPvxWWCRU0O/wlnE5M=; b=WvSSU1NF3gBslI89+rEZGfKQyonIEyrSxd+ep4wfMlSHQGhc30jf+hf/LVFai7bHN6 DIywPDcofCb+/WclOqg3rZGuwMc2iW6GXq9tt97XM/ojQHRVzteyCX9VcBoKVezRYh/a Na9bQqLmMS980ahI8fnbPkm91cxvUx1TVRipBCsYEP//tXvDbSiqPxNJDowd40KTC3eQ mh9jkoyzjjKzeomC80WAsvfAJ+YCfTpNBaPvhQj6q8FiglgIdtT6N+coh703/8ZsMile qws8nQVYzBw3kt6mUrlEVoPGxJl+qnxwhrXcFwOohm5MWTxKTlmZKWL+Rt6RVnLupJpm /kWQ== X-Gm-Message-State: ALoCoQlltRHtUP/ObNlkiUFGpRLHY0gMgAHKF2ctU5H4Tx7T5H29ZsX+094ZCNj6Hs+5lLqV9q1Y X-Received: by 10.112.148.101 with SMTP id tr5mr4198806lbb.13.1433526929063; Fri, 05 Jun 2015 10:55:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.226 with SMTP id q2ls395369lae.73.gmail; Fri, 05 Jun 2015 10:55:28 -0700 (PDT) X-Received: by 10.112.171.68 with SMTP id as4mr4499286lbc.64.1433526928895; Fri, 05 Jun 2015 10:55:28 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id k7si5396673lbv.58.2015.06.05.10.55.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 10:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by laar3 with SMTP id r3so10439758laa.3 for ; Fri, 05 Jun 2015 10:55:28 -0700 (PDT) X-Received: by 10.112.97.194 with SMTP id ec2mr4474010lbb.88.1433526928784; Fri, 05 Jun 2015 10:55:28 -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 hn6csp45323lbb; Fri, 5 Jun 2015 10:55:27 -0700 (PDT) X-Received: by 10.140.25.208 with SMTP id 74mr5364545qgt.104.1433526926814; Fri, 05 Jun 2015 10:55:26 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v11si8098727qgv.72.2015.06.05.10.55.24; Fri, 05 Jun 2015 10:55:26 -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 CF4DE62126; Fri, 5 Jun 2015 17:55:24 +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 B9C6A62129; Fri, 5 Jun 2015 17:52:45 +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 55EEC62130; Fri, 5 Jun 2015 17:52:41 +0000 (UTC) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by lists.linaro.org (Postfix) with ESMTPS id 98D9162128 for ; Fri, 5 Jun 2015 17:51:56 +0000 (UTC) Received: by wibut5 with SMTP id ut5so28478093wib.1 for ; Fri, 05 Jun 2015 10:51:55 -0700 (PDT) X-Received: by 10.194.57.211 with SMTP id k19mr8536754wjq.53.1433526715874; Fri, 05 Jun 2015 10:51:55 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id bg4sm11582752wjc.10.2015.06.05.10.51.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 10:51:55 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 5 Jun 2015 18:51:29 +0100 Message-Id: <1433526691-20058-8-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433526691-20058-1-git-send-email-zoltan.kiss@linaro.org> References: <1433526691-20058-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v3 7/9] event: replace complicated buffer releases with odp_event_free() 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.49 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 Instead of converting types let odp_event_free() to do the right thing. Signed-off-by: Zoltan Kiss --- Notes: v3: rebase to latest master example/timer/odp_timer_test.c | 2 +- platform/linux-generic/odp_schedule.c | 5 +---- test/performance/odp_pktio_perf.c | 4 ++-- test/performance/odp_scheduling.c | 4 +--- test/validation/classification/odp_classification_tests.c | 2 +- test/validation/odp_pktio.c | 6 +++--- test/validation/odp_scheduler.c | 11 +++-------- test/validation/odp_timer.c | 2 +- 8 files changed, 13 insertions(+), 23 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 735c4c6..6ea5773 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -167,7 +167,7 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls) /* Cancel and free last timer used */ (void)odp_timer_cancel(ttp->tim, &ttp->ev); if (ttp->ev != ODP_EVENT_INVALID) - odp_timeout_free(odp_timeout_from_event(ttp->ev)); + odp_event_free(ttp->ev); else EXAMPLE_ERR("Lost timeout event at timer cancel\n"); /* Since we have cancelled the timer, there is no timeout event to diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 7fe42d7..9206d5c 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -328,10 +328,7 @@ int schedule_queue_init(queue_entry_t *qe) void schedule_queue_destroy(queue_entry_t *qe) { - odp_buffer_t buf; - - buf = odp_buffer_from_event(qe->s.cmd_ev); - odp_buffer_free(buf); + odp_event_free(qe->s.cmd_ev); pri_clr_queue(queue_handle(qe), queue_prio(qe)); diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c index 17975bf..b746eca 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -427,7 +427,7 @@ static void *run_thread_rx(void *arg) else stats->s.rx_ignore++; } - odp_buffer_free(odp_buffer_from_event(ev[i])); + odp_event_free(ev[i]); } if (n_ev == 0 && odp_atomic_load_u32(&shutdown)) break; @@ -766,7 +766,7 @@ static int destroy_inq(odp_pktio_t pktio) ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); if (ev != ODP_EVENT_INVALID) - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); else break; } diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 99f0f9b..558fec8 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -69,7 +69,6 @@ typedef struct { static void clear_sched_queues(void) { odp_event_t ev; - odp_buffer_t buf; while (1) { ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); @@ -77,8 +76,7 @@ static void clear_sched_queues(void) if (ev == ODP_EVENT_INVALID) break; - buf = odp_buffer_from_event(ev); - odp_buffer_free(buf); + odp_event_free(ev); } } diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 131ac91..441c194 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -176,7 +176,7 @@ static int destroy_inq(odp_pktio_t pktio) ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); if (ev != ODP_EVENT_INVALID) - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); else break; } diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c index 7c1a666..090057b 100644 --- a/test/validation/odp_pktio.c +++ b/test/validation/odp_pktio.c @@ -283,7 +283,7 @@ static int destroy_inq(odp_pktio_t pktio) ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); if (ev != ODP_EVENT_INVALID) - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); else break; } @@ -332,7 +332,7 @@ static odp_packet_t wait_for_packet(odp_queue_t queue, } /* not interested in this event */ - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); } now = odp_time_cycles(); @@ -550,7 +550,7 @@ static void test_odp_pktio_inq_remdef(void) for (i = 0; i < 100; i++) { ev = odp_schedule(NULL, ODP_TIME_MSEC); if (ev != ODP_EVENT_INVALID) { - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); CU_FAIL("received unexpected event"); } } diff --git a/test/validation/odp_scheduler.c b/test/validation/odp_scheduler.c index c2eb996..e4df4f2 100644 --- a/test/validation/odp_scheduler.c +++ b/test/validation/odp_scheduler.c @@ -67,10 +67,7 @@ static int exit_schedule_loop(void) while ((ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT)) != ODP_EVENT_INVALID) { - odp_buffer_t buf; - - buf = odp_buffer_from_event(ev); - odp_buffer_free(buf); + odp_event_free(ev); ret++; } @@ -199,10 +196,8 @@ static void *schedule_common_(void *arg) CU_ASSERT(num <= BURST_BUF_SIZE); if (num == 0) continue; - for (j = 0; j < num; j++) { - buf = odp_buffer_from_event(events[j]); - odp_buffer_free(buf); - } + for (j = 0; j < num; j++) + odp_event_free(events[j]); } else { ev = odp_schedule(&from, ODP_SCHED_NO_WAIT); buf = odp_buffer_from_event(ev); diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c index 554b353..d268808 100644 --- a/test/validation/odp_timer.c +++ b/test/validation/odp_timer.c @@ -424,7 +424,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) CU_ASSERT(rc == 0); for (i = 0; i < NTIMERS; i++) { if (tt[i].ev != ODP_EVENT_INVALID) - odp_timeout_free(odp_timeout_from_event(tt[i].ev)); + odp_event_free(tt[i].ev); } free(tt);