From patchwork Thu Jan 15 15:40:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 43208 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8FF88240BA for ; Thu, 15 Jan 2015 15:41:37 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf8555077eek.1 for ; Thu, 15 Jan 2015 07:41:36 -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=8MtGKDySWoyl6piAZ1/+2g6oyVMb1PGM8nekmxyo9fY=; b=QGf63um2ZgbHCR29ukOwk/DLrpWlZRufSI9dSfwspWXW0sjQk9cgxIuGH21GEOl033 u/4RfAi84XzMqUVf/HBGMb+5dmDUQ4LVQm9o/Md6wpb2P290zEAT0LjK+GouEa3o60I4 sM+bw/K5j0LBQ+lkIfv4qPOVD0fJ0MPeNKbHl2QRDzUMi48EXRqLh8pqLG4fsOLRdrtF IfoTcNhkE9lv/SsMwaT0e12ARCuO59AApcaC9+H2Otpb518wmjH/bDazUYvr7wGAWq3t /u/cEEm4KHk4EzxRMXd2gWvM9+lnKACqqRLy+67EBEW3knG65OXMw5DfIR1dDSUkqs0N m6BQ== X-Gm-Message-State: ALoCoQm+ZFronhhfULbw9l1AMkYPdaYbO2FRrqePaKc7z0/RIKTH0HYPxwpq4KuqqW3x2jEnF8D5 X-Received: by 10.180.108.101 with SMTP id hj5mr1463123wib.3.1421336496798; Thu, 15 Jan 2015 07:41:36 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.133 with SMTP id o5ls214965lal.78.gmail; Thu, 15 Jan 2015 07:41:36 -0800 (PST) X-Received: by 10.112.188.201 with SMTP id gc9mr4738920lbc.6.1421336496639; Thu, 15 Jan 2015 07:41:36 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id gy9si374189lac.53.2015.01.15.07.41.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:36 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id 10so13923049lbg.1 for ; Thu, 15 Jan 2015 07:41:36 -0800 (PST) X-Received: by 10.152.45.4 with SMTP id i4mr10660803lam.74.1421336496529; Thu, 15 Jan 2015 07:41:36 -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 c8csp21934lbb; Thu, 15 Jan 2015 07:41:35 -0800 (PST) X-Received: by 10.224.120.65 with SMTP id c1mr17123859qar.87.1421336495290; Thu, 15 Jan 2015 07:41:35 -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 g2si2349571qaq.49.2015.01.15.07.41.33 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:35 -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 1YBmY8-0007RB-Mv; Thu, 15 Jan 2015 15:41:32 +0000 Received: from mail-qc0-f182.google.com ([209.85.216.182]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBmXv-0007MC-Bc for lng-odp@lists.linaro.org; Thu, 15 Jan 2015 15:41:19 +0000 Received: by mail-qc0-f182.google.com with SMTP id l6so8651707qcy.13 for ; Thu, 15 Jan 2015 07:41:14 -0800 (PST) X-Received: by 10.224.129.132 with SMTP id o4mr16869215qas.66.1421336474191; Thu, 15 Jan 2015 07:41:14 -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.11 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:13 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Thu, 15 Jan 2015 17:40:15 +0200 Message-Id: <1421336423-19382-8-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 07/15] api: packet: Removed odp_packet_to_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.170 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 packet to buffer conversion. packet -> event -> buffer conversions are temporary. Signed-off-by: Petri Savolainen --- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 8 ++++---- platform/linux-generic/include/api/odp_packet.h | 9 --------- platform/linux-generic/include/odp_packet_internal.h | 9 +++++++++ platform/linux-generic/odp_crypto.c | 4 ++-- platform/linux-generic/odp_packet.c | 2 +- platform/linux-generic/odp_packet_io.c | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 1ed0c48..dfc5d2b 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -448,7 +448,7 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len) odp_atomic_inc_u64(&counters.ip); rlen += sprintf(msg, "receive Packet proto:IP "); - buf = odp_buffer_addr(odp_packet_to_buffer(pkt)); + buf = odp_packet_data(pkt); ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt)); rlen += sprintf(msg + rlen, "id %d ", odp_be_to_cpu_16(ip->id)); diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 6e2c8b6..fd1b9b1 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -740,7 +740,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt, *skip = FALSE; if (odp_crypto_operation(¶ms, &posted, - odp_packet_to_buffer(pkt))) { + odp_buffer_from_event(odp_packet_to_event(pkt)))) { abort(); } return (posted) ? PKT_POSTED : PKT_CONTINUE; @@ -766,7 +766,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, int trl_len = 0; /* Check crypto result */ - event = odp_packet_to_buffer(pkt); + event = odp_buffer_from_event(odp_packet_to_event(pkt)); odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); if (!is_crypto_compl_status_ok(&cipher_rc)) return PKT_DROP; @@ -974,7 +974,7 @@ pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, /* Issue crypto request */ if (odp_crypto_operation(&ctx->ipsec.params, &posted, - odp_packet_to_buffer(pkt))) { + odp_buffer_from_event(odp_packet_to_event(pkt)))) { abort(); } return (posted) ? PKT_POSTED : PKT_CONTINUE; @@ -998,7 +998,7 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt, odph_ipv4hdr_t *ip; /* Check crypto result */ - event = odp_packet_to_buffer(pkt); + event = odp_buffer_from_event(odp_packet_to_event(pkt)); odp_crypto_get_operation_compl_status(event, &auth_rc, &cipher_rc); if (!is_crypto_compl_status_ok(&cipher_rc)) return PKT_DROP; diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h index 5ab96c6..c67fd62 100644 --- a/platform/linux-generic/include/api/odp_packet.h +++ b/platform/linux-generic/include/api/odp_packet.h @@ -105,15 +105,6 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len); odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); /** - * Convert a packet handle to a buffer handle - * - * @param pkt Packet handle - * - * @return Buffer handle - */ -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); - -/** * 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 179330c..fe4a223 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -257,6 +257,15 @@ 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 + */ +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index b468262..ab76484 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -364,9 +364,9 @@ odp_crypto_operation(odp_crypto_op_params_t *params, ODP_ABORT(); _odp_packet_copy_to_packet(params->pkt, 0, params->out_pkt, 0, odp_packet_len(params->pkt)); - if (completion_event == odp_packet_to_buffer(params->pkt)) + if (completion_event == _odp_packet_to_buffer(params->pkt)) completion_event = - odp_packet_to_buffer(params->out_pkt); + _odp_packet_to_buffer(params->out_pkt); odp_packet_free(params->pkt); params->pkt = ODP_PACKET_INVALID; } diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index ebe3b55..bcbac79 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -70,7 +70,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) return (odp_packet_t)buf; } -odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) +odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt) { return (odp_buffer_t)pkt; } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index cd109d2..7f5a95d 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -515,7 +515,7 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) return NULL; for (i = 0, j = 0; i < pkts; ++i) { - buf = odp_packet_to_buffer(pkt_tbl[i]); + buf = _odp_packet_to_buffer(pkt_tbl[i]); buf_hdr = odp_buf_to_hdr(buf); if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) tmp_hdr_tbl[j++] = buf_hdr; @@ -561,7 +561,7 @@ int pktin_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int num) return nbr; for (i = 0, j = 0; i < pkts; ++i) { - buf = odp_packet_to_buffer(pkt_tbl[i]); + buf = _odp_packet_to_buffer(pkt_tbl[i]); tmp_hdr = odp_buf_to_hdr(buf); if (0 > packet_classifier(qentry->s.pktin, pkt_tbl[i])) tmp_hdr_tbl[j++] = tmp_hdr;