From patchwork Tue Jan 27 09:47:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 43835 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0023823FFF for ; Tue, 27 Jan 2015 09:47:55 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id k14sf7011439wgh.3 for ; Tue, 27 Jan 2015 01:47:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id: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=F11prXtLEcgJ5SqgtwVnl2TioHniBhlPwFo8mS1I3TQ=; b=DXM0E76qDeObCMPZlgrMBQPlikomakyDnu5p1K8kBhqQwN1/KGFJaBnqV57X7Hl9Ur Nbk+1fM6Ed2XjIbufj/nVSPTDVdGo0zomTrXW/q3TA6Y5WSG8p2P9+7hQvEoVVr+ibck bpWZbrhtEqBed6fgiHIJZurAg6o/Kr7rxPbTbQNYLJd8lPjD9yUEqnihvjYLfzYSvyM+ JOAwuoc5GkTQ4v8/B/VfP3MMOLkFjsJPznZMsb1kLou//Yk8V7/htZxyGhSzyPltpakU OLx5Q0MWdLqoczVJPin0YRovsuWdjrZ3KMER42l840Px8vU2Qk9gsLVHaXeX+Vnfy1+e sdBA== X-Gm-Message-State: ALoCoQl789i8wfXxZ3o60atzspBbkFlrtvzLZO/MUhglZczdfuq/MJLdnq08kKeryEUM74PVAvbw X-Received: by 10.180.108.197 with SMTP id hm5mr2442440wib.4.1422352074301; Tue, 27 Jan 2015 01:47:54 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.232 with SMTP id h8ls13132lam.3.gmail; Tue, 27 Jan 2015 01:47:54 -0800 (PST) X-Received: by 10.112.54.167 with SMTP id k7mr486589lbp.72.1422352074070; Tue, 27 Jan 2015 01:47:54 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id to9si753991lbb.15.2015.01.27.01.47.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 01:47:53 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id z12so12076292lbi.7 for ; Tue, 27 Jan 2015 01:47:53 -0800 (PST) X-Received: by 10.152.5.226 with SMTP id v2mr524414lav.34.1422352073555; Tue, 27 Jan 2015 01:47:53 -0800 (PST) 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.35.133 with SMTP id h5csp1041553lbj; Tue, 27 Jan 2015 01:47:52 -0800 (PST) X-Received: by 10.224.24.132 with SMTP id v4mr472230qab.17.1422352072321; Tue, 27 Jan 2015 01:47:52 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id w34si785556qgw.36.2015.01.27.01.47.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 27 Jan 2015 01:47:52 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YG2kP-0007tK-9e; Tue, 27 Jan 2015 09:47:49 +0000 Received: from mail-pd0-f180.google.com ([209.85.192.180]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YG2kJ-0007tF-E4 for lng-odp@lists.linaro.org; Tue, 27 Jan 2015 09:47:43 +0000 Received: by mail-pd0-f180.google.com with SMTP id ft15so17874190pdb.11 for ; Tue, 27 Jan 2015 01:47:38 -0800 (PST) X-Received: by 10.68.135.226 with SMTP id pv2mr735346pbb.48.1422352058007; Tue, 27 Jan 2015 01:47:38 -0800 (PST) Received: from localhost.localdomain ([59.90.234.135]) by mx.google.com with ESMTPSA id zb8sm1024501pac.45.2015.01.27.01.47.36 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 01:47:37 -0800 (PST) From: bala.manoharan@linaro.org To: lng-odp@lists.linaro.org Date: Tue, 27 Jan 2015 15:17:26 +0530 Message-Id: <1422352046-8618-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 2.0.1.472.g6f92e5f X-Topics: Classification patch Subject: [lng-odp] [PATCH v1] validation: classification: Use events instead of buffers X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bala.manoharan@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.217.176 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 From: Balasubramanian Manoharan Replaces odp_buffer_t and odp_buffer_pool_t into odp_event_t and odp_pool_t respectively Signed-off-by: Balasubramanian Manoharan --- .../classification/odp_classification_tests.c | 39 +++++++++++----------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 4ab8b0d..8a65920 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -58,7 +58,7 @@ static odp_pmr_t pmr_list[CLS_ENTRIES]; static odp_queue_t queue_list[CLS_ENTRIES]; static odp_pmr_set_t pmr_set; -static odp_buffer_pool_t pool_default; +static odp_pool_t pool_default; static odp_pktio_t pktio_loop; /** sequence number of IP packets */ @@ -104,18 +104,18 @@ int parse_ipv4_string(const char *ipaddress, uint32_t *addr, uint32_t *mask) static inline void enqueue_loop_interface(odp_packet_t pkt) { + odp_event_t ev; odp_queue_t defqueue = odp_pktio_outq_getdef(pktio_loop); - odp_queue_enq(defqueue, odp_packet_to_buffer(pkt)); + ev = odp_packet_to_event(pkt); + CU_ASSERT(odp_queue_enq(defqueue, ev) == 0); } static inline odp_packet_t receive_packet(odp_queue_t *queue, uint64_t ns) { - odp_buffer_t buf; - odp_packet_t pkt; - buf = odp_schedule(queue, ns); - pkt = odp_packet_from_buffer(buf); - return pkt; + odp_event_t ev; + ev = odp_schedule(queue, ns); + return odp_packet_from_event(ev); } static int cls_pkt_set_seq(odp_packet_t pkt) @@ -238,26 +238,27 @@ odp_packet_t create_packet(bool vlan) int classification_tests_init(void) { - odp_buffer_pool_t pool; - odp_buffer_pool_param_t param; + odp_pool_t pool; + odp_pool_param_t param; odp_queue_t inq_def; odp_queue_param_t qparam; char queuename[ODP_QUEUE_NAME_LEN]; int i; - param.buf_size = SHM_PKT_BUF_SIZE; - param.num_bufs = SHM_PKT_NUM_BUFS; - param.buf_type = ODP_BUFFER_TYPE_PACKET; - param.buf_align = 0; - pool = odp_buffer_pool_create("classification_pool", + param.buf.size = SHM_PKT_BUF_SIZE; + param.buf.num = SHM_PKT_NUM_BUFS; + param.buf.align = 0; + param.type = ODP_POOL_PACKET; + + pool = odp_pool_create("classification_pool", ODP_SHM_NULL, ¶m); - if (ODP_BUFFER_POOL_INVALID == pool) { + if (ODP_POOL_INVALID == pool) { fprintf(stderr, "Packet pool creation failed.\n"); return -1; } - pool_default = odp_buffer_pool_lookup("classification_pool"); - if (pool_default == ODP_BUFFER_POOL_INVALID) + pool_default = odp_pool_lookup("classification_pool"); + if (pool_default == ODP_POOL_INVALID) goto error_pool_default; pktio_loop = odp_pktio_open("loop", pool_default); @@ -284,7 +285,7 @@ int classification_tests_init(void) return 0; error_pktio_loop: - odp_buffer_pool_destroy(pool_default); + odp_pool_destroy(pool_default); error_pool_default: return -1; @@ -296,7 +297,7 @@ int classification_tests_finalize(void) if (0 > odp_pktio_close(pktio_loop)) return -1; - if (0 != odp_buffer_pool_destroy(pool_default)) + if (0 != odp_pool_destroy(pool_default)) return -1; for (i = 0; i < CLS_ENTRIES; i++)