From patchwork Fri Jun 5 11:53:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 49567 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5F94F2154F for ; Fri, 5 Jun 2015 11:57:40 +0000 (UTC) Received: by wgez8 with SMTP id z8sf16780906wge.2 for ; Fri, 05 Jun 2015 04:57:39 -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=lNzK1EJkQYKoZYN83OyRj67ns/BRILRl/A9ZQzEpvwI=; b=ZFEQiJb+00iDPQ8kaXr720Lxij9x3oZVeZmGPS2ogpvHZfXFE0O6NJEnlM8WjCNqCr NcbT8RDyTwhwzD9anard3+Dq2H+MFzPY4JEM2eo95dv4L79IDREQCyg6KmAYftWtR2MH I9fIt0SWoIbbGGHL3eNJB/qFYsCjqDhL6dkfc0XSuSva2Y5h442ywliEGuCmeDKNVUtl BMoelNvuZaCckmDhetLlfmzWuT55R+WNaXeYGkI+4m0u86y4KG2S0EBSDs/JOhXiYCpm Hn3+Su9tpA7YmSoWPyJm/POzBhCOGHQtRibS8lOVKrGDksDInFUAWqUPEUERu8sAJ+qr jqdw== X-Gm-Message-State: ALoCoQl9f+/Cipf/xfcTytDPOez0afoDwhpJbhsOfySsc4+8SXKkTFNN7nCxgCVBXqxGFkC8he1f X-Received: by 10.152.26.134 with SMTP id l6mr2927840lag.10.1433505459638; Fri, 05 Jun 2015 04:57:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls347514laj.72.gmail; Fri, 05 Jun 2015 04:57:39 -0700 (PDT) X-Received: by 10.112.157.164 with SMTP id wn4mr3053476lbb.100.1433505459359; Fri, 05 Jun 2015 04:57:39 -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 e7si4635025lbc.62.2015.06.05.04.57.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 04:57:39 -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 labpy14 with SMTP id py14so52564561lab.0 for ; Fri, 05 Jun 2015 04:57:39 -0700 (PDT) X-Received: by 10.112.97.194 with SMTP id ec2mr3021917lbb.88.1433505459138; Fri, 05 Jun 2015 04:57:39 -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 hn6csp1369752lbb; Fri, 5 Jun 2015 04:57:37 -0700 (PDT) X-Received: by 10.55.20.17 with SMTP id e17mr5697990qkh.102.1433505456768; Fri, 05 Jun 2015 04:57:36 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f10si7242863qga.90.2015.06.05.04.57.35; Fri, 05 Jun 2015 04:57:36 -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 ADB9F61D4C; Fri, 5 Jun 2015 11:57:35 +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 4B90E61FF3; Fri, 5 Jun 2015 11:55:13 +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 372DA61D3D; Fri, 5 Jun 2015 11:55:06 +0000 (UTC) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by lists.linaro.org (Postfix) with ESMTPS id 192AC61F9D for ; Fri, 5 Jun 2015 11:54:21 +0000 (UTC) Received: by wgme6 with SMTP id e6so54895758wgm.2 for ; Fri, 05 Jun 2015 04:54:20 -0700 (PDT) X-Received: by 10.180.36.193 with SMTP id s1mr16548672wij.62.1433505260264; Fri, 05 Jun 2015 04:54:20 -0700 (PDT) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id b20sm10268741wjb.46.2015.06.05.04.54.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 04:54:19 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 5 Jun 2015 12:53:49 +0100 Message-Id: <1433505231-28843-8-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433505231-28843-1-git-send-email-zoltan.kiss@linaro.org> References: <1433505231-28843-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH v2 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 --- 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 fbe27a0..d362669 100644 --- a/test/performance/odp_pktio_perf.c +++ b/test/performance/odp_pktio_perf.c @@ -395,7 +395,7 @@ static void *run_thread_rx(void *arg TEST_UNUSED) stats->s.rx_ignore++; } - odp_buffer_free(odp_buffer_from_event(ev)); + odp_event_free(ev); } else if (odp_atomic_load_u32(&shutdown)) { break; } @@ -732,7 +732,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);