From patchwork Thu Jan 15 15:40:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 43209 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 350D0240BA for ; Thu, 15 Jan 2015 15:41:44 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id hi2sf4675985wib.3 for ; Thu, 15 Jan 2015 07:41:43 -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: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=lXEn3WQ67jQ4nxSybCJBjx9ZNs4Gl8tiuPl7/ukdrZ8=; b=KQnG28dejNW7WTFigWRg7U/VpFTO9whyyvMc/CHLydR6Kr2uu49FNDkWx49ju0Lgu4 tvdkCNM218MqnJoMLYUgNHQtVYDUA8tqXC5bjdv0x9JEU9XRwBtfGi9iYUNUUn4HkRPL TLnuIC0BfVe4VgfDo4pYXO5v2FMfLSyzNrt2P7Ub7WpCbHSf+cXE/ny/vVhawwukb0y7 lPzMDqlERLlAIDws8lK/AMackQt9bp2D3kERTShH+KZU4R9IuoQF35BjCZZ5u/K8LEtL vBkWqaxnS7ky2v3G8JT4S/SVfUiHO3pFhGYaYGOG2cFF8Kl880fj8pOX79I2ONGxVPAm /VXQ== X-Gm-Message-State: ALoCoQnGsMOJn7L64RPVJRranYTfLmsThzoFfFfyMgvPB6kU8wb0GLGQdE6T+MkDMnEbuzjliyng X-Received: by 10.194.178.234 with SMTP id db10mr1347944wjc.2.1421336503467; Thu, 15 Jan 2015 07:41:43 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.41 with SMTP id y9ls263579lag.54.gmail; Thu, 15 Jan 2015 07:41:43 -0800 (PST) X-Received: by 10.152.6.41 with SMTP id x9mr10416269lax.86.1421336503274; Thu, 15 Jan 2015 07:41:43 -0800 (PST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id v2si1718115laj.133.2015.01.15.07.41.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:43 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id f15so4360014lbj.11 for ; Thu, 15 Jan 2015 07:41:43 -0800 (PST) X-Received: by 10.112.125.41 with SMTP id mn9mr10478636lbb.80.1421336503200; Thu, 15 Jan 2015 07:41:43 -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.9.200 with SMTP id c8csp21970lbb; Thu, 15 Jan 2015 07:41:42 -0800 (PST) X-Received: by 10.224.36.199 with SMTP id u7mr7370752qad.101.1421336501362; Thu, 15 Jan 2015 07:41:41 -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 u10si2410926qcd.1.2015.01.15.07.41.40 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:41 -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 1YBmYD-0007SB-Nm; Thu, 15 Jan 2015 15:41:37 +0000 Received: from mail-qc0-f170.google.com ([209.85.216.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBmXy-0007MZ-3B for lng-odp@lists.linaro.org; Thu, 15 Jan 2015 15:41:22 +0000 Received: by mail-qc0-f170.google.com with SMTP id x3so12677771qcv.1 for ; Thu, 15 Jan 2015 07:41:17 -0800 (PST) X-Received: by 10.140.31.36 with SMTP id e33mr16193813qge.36.1421336476947; Thu, 15 Jan 2015 07:41:16 -0800 (PST) Received: from mcpro03.emea.nsn-net.net (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id g12sm1563340qay.44.2015.01.15.07.41.14 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:15 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Thu, 15 Jan 2015 17:40:16 +0200 Message-Id: <1421336423-19382-9-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1421336423-19382-1-git-send-email-petri.savolainen@linaro.org> References: <1421336423-19382-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 08/15] api: packet: Removed odp_packet_from_buffer 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: petri.savolainen@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.180 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 Removed buffer to packet conversion. Signed-off-by: Petri Savolainen --- platform/linux-generic/include/api/odp_packet.h | 9 --------- platform/linux-generic/include/odp_packet_internal.h | 11 ++++------- platform/linux-generic/odp_packet.c | 2 +- platform/linux-generic/odp_packet_io.c | 4 ++-- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h index c67fd62..03f2b18 100644 --- a/platform/linux-generic/include/api/odp_packet.h +++ b/platform/linux-generic/include/api/odp_packet.h @@ -96,15 +96,6 @@ void odp_packet_free(odp_packet_t pkt); int odp_packet_reset(odp_packet_t pkt, uint32_t len); /** - * Convert a buffer handle to a packet handle - * - * @param buf Buffer handle - * - * @return Packet handle - */ -odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); - -/** * Get packet handle from event * * Converts an ODP_EVENT_PACKET type event to a packet. diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index fe4a223..33c9d92 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -257,15 +257,12 @@ odp_packet_t _odp_packet_alloc(odp_buffer_pool_t pool_hdl); int _odp_packet_parse(odp_packet_t pkt); -/* - * Convert a packet handle to a buffer handle - * - * @param pkt Packet handle - * - * @return Buffer handle - */ +/* Convert a packet handle to a buffer handle */ odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); +/* Convert a buffer handle to a packet handle */ +odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index bcbac79..3ce6f47 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -65,7 +65,7 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len) return 0; } -odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) +odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf) { return (odp_packet_t)buf; } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 7f5a95d..abbc9f6 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -454,7 +454,7 @@ odp_queue_t odp_pktio_outq_getdef(odp_pktio_t id) int pktout_enqueue(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr) { - odp_packet_t pkt = odp_packet_from_buffer(buf_hdr->handle.handle); + odp_packet_t pkt = _odp_packet_from_buffer(buf_hdr->handle.handle); int len = 1; int nbr; @@ -476,7 +476,7 @@ int pktout_enq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int i; for (i = 0; i < num; ++i) - pkt_tbl[i] = odp_packet_from_buffer(buf_hdr[i]->handle.handle); + pkt_tbl[i] = _odp_packet_from_buffer(buf_hdr[i]->handle.handle); nbr = odp_pktio_send(qentry->s.pktout, pkt_tbl, num); return (nbr == num ? 0 : -1);