From patchwork Mon Oct 6 14:25:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 38368 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 1CF7A202E7 for ; Mon, 6 Oct 2014 14:26:40 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id b6sf2849394lbj.3 for ; Mon, 06 Oct 2014 07:26: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:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=lnV39r7H0PQV+yqNx4RgoQKED/1KqJpSR5OrV2NNYL0=; b=SfkNAhw9y8+8ui8ID6OuF9SkzSbbt1FD1xywdIYZ3T2Lit444JdJQWRdFIy2KdNBnf Yd67KIH7tRn2j9IOtXCoDR6zbnqDTE7XxP/ChUAtT9tZbaVKhfzq0wGQmMs5K9R2eU/t CwuzyUlRhInvGNXh6wyF2lJ7Q+64sEbVsZSpinu9UKrbdFGmPztA1vPeWRjIyJcgoBVU NV6+Oma2F/hAIDcxGxX2pRDJt6IchgwA0um36BfYrO7SDcj83rusLoq/GElWFsqoqxSi D82bMPGQb/LAJM9Ht2Ryo7Q8aFRSYbFq77S1JuPTbbcaP+SOyra2hI5CRjoFwD7FYRBH cFlw== X-Gm-Message-State: ALoCoQm1qByGsrxLTe8tsTZCZw5Baecfw60EbWvwgl3JjH0hNUYTuW4bc8mIsTFDZMhx6+12svSP X-Received: by 10.194.92.13 with SMTP id ci13mr143373wjb.5.1412605599879; Mon, 06 Oct 2014 07:26:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.132 with SMTP id ay4ls559860lab.46.gmail; Mon, 06 Oct 2014 07:26:39 -0700 (PDT) X-Received: by 10.112.130.4 with SMTP id oa4mr19156895lbb.37.1412605599630; Mon, 06 Oct 2014 07:26:39 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx.google.com with ESMTPS id k3si24282333lbd.26.2014.10.06.07.26.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Oct 2014 07:26:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id gm9so4358302lab.41 for ; Mon, 06 Oct 2014 07:26:39 -0700 (PDT) X-Received: by 10.112.130.226 with SMTP id oh2mr3225195lbb.100.1412605599498; Mon, 06 Oct 2014 07:26: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.130.169 with SMTP id of9csp191965lbb; Mon, 6 Oct 2014 07:26:38 -0700 (PDT) X-Received: by 10.220.251.13 with SMTP id mq13mr9071429vcb.25.1412605592928; Mon, 06 Oct 2014 07:26:32 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id nv6si7969278vcb.47.2014.10.06.07.26.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 06 Oct 2014 07:26:32 -0700 (PDT) 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 1Xb9F7-00052i-W5; Mon, 06 Oct 2014 14:26:30 +0000 Received: from mail-vc0-f176.google.com ([209.85.220.176]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xb9F0-00052d-OF for lng-odp@lists.linaro.org; Mon, 06 Oct 2014 14:26:22 +0000 Received: by mail-vc0-f176.google.com with SMTP id hq11so3172216vcb.35 for ; Mon, 06 Oct 2014 07:26:17 -0700 (PDT) X-Received: by 10.221.21.134 with SMTP id qs6mr535981vcb.72.1412605577509; Mon, 06 Oct 2014 07:26:17 -0700 (PDT) Received: from localhost.localdomain (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id tr2sm1775241vdc.13.2014.10.06.07.26.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Oct 2014 07:26:16 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Mon, 6 Oct 2014 17:25:52 +0300 Message-Id: <1412605552-11129-1-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.1.1 X-Topics: patch Subject: [lng-odp] [PATCH] Rename buffer_from_packet function 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.215.54 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 Rename odp_buffer_from_packet() to odp_packet_to_buffer(). It's a function of packet API vs buffer API. Signed-off-by: Petri Savolainen Tested-by: Anders Roxel --- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 10 +++++----- helper/include/odph_packet.h | 6 +++--- platform/linux-generic/include/api/odp_packet.h | 6 +++--- platform/linux-generic/odp_crypto.c | 4 ++-- platform/linux-generic/odp_packet.c | 8 ++++---- platform/linux-generic/odp_packet_io.c | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 6055324..5538d0c 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -397,7 +397,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_buffer_from_packet(pkt)); + buf = odp_buffer_addr(odp_packet_to_buffer(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 ec6c87a..56539ba 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -738,7 +738,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt, *skip = FALSE; if (odp_crypto_operation(¶ms, &posted, - odp_buffer_from_packet(pkt))) { + odp_packet_to_buffer(pkt))) { abort(); } return (posted) ? PKT_POSTED : PKT_CONTINUE; @@ -764,7 +764,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, int trl_len = 0; /* Check crypto result */ - event = odp_buffer_from_packet(pkt); + event = odp_packet_to_buffer(pkt); odp_crypto_get_operation_compl_status(event, &cipher_rc, &auth_rc); if (!is_crypto_compl_status_ok(&cipher_rc)) return PKT_DROP; @@ -935,7 +935,7 @@ pkt_disposition_e do_ipsec_out_classify(odp_packet_t pkt, /* Send packet to the atmoic queue to assign sequence numbers */ *skip = FALSE; - odp_queue_enq(seqnumq, odp_buffer_from_packet(pkt)); + odp_queue_enq(seqnumq, odp_packet_to_buffer(pkt)); return PKT_POSTED; } @@ -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_buffer_from_packet(pkt))) { + odp_packet_to_buffer(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_buffer_from_packet(pkt); + event = odp_packet_to_buffer(pkt); odp_crypto_get_operation_compl_status(event, &cipher_rc, &auth_rc); if (!is_crypto_compl_status_ok(&cipher_rc)) return PKT_DROP; diff --git a/helper/include/odph_packet.h b/helper/include/odph_packet.h index c18f48d..3d53593 100644 --- a/helper/include/odph_packet.h +++ b/helper/include/odph_packet.h @@ -31,7 +31,7 @@ extern "C" { */ static inline int odph_packet_is_valid(odp_packet_t pkt) { - odp_buffer_t buf = odp_buffer_from_packet(pkt); + odp_buffer_t buf = odp_packet_to_buffer(pkt); return odp_buffer_is_valid(buf); } @@ -67,7 +67,7 @@ static inline odp_packet_t odph_packet_alloc(odp_buffer_pool_t pool_id) */ static inline void odph_packet_free(odp_packet_t pkt) { - odp_buffer_t buf = odp_buffer_from_packet(pkt); + odp_buffer_t buf = odp_packet_to_buffer(pkt); odp_buffer_free(buf); } @@ -84,7 +84,7 @@ static inline void odph_packet_free(odp_packet_t pkt) */ static inline size_t odph_packet_buf_size(odp_packet_t pkt) { - odp_buffer_t buf = odp_buffer_from_packet(pkt); + odp_buffer_t buf = odp_packet_to_buffer(pkt); return odp_buffer_size(buf); } diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h index 316279b..8204000 100644 --- a/platform/linux-generic/include/api/odp_packet.h +++ b/platform/linux-generic/include/api/odp_packet.h @@ -63,7 +63,7 @@ typedef struct odp_packet_seg_info_t { void odp_packet_init(odp_packet_t pkt); /** - * Convert from packet handle to buffer handle + * Convert a buffer handle to a packet handle * * @param buf Buffer handle * @@ -72,13 +72,13 @@ void odp_packet_init(odp_packet_t pkt); odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); /** - * Convert from buffer handle to packet handle + * Convert a packet handle to a buffer handle * * @param pkt Packet handle * * @return Buffer handle */ -odp_buffer_t odp_buffer_from_packet(odp_packet_t pkt); +odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); /** * Set the packet length diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index b37ad6b..1475437 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -367,9 +367,9 @@ odp_crypto_operation(odp_crypto_op_params_t *params, if (odp_unlikely(ODP_PACKET_INVALID == params->out_pkt)) abort(); odp_packet_copy(params->out_pkt, params->pkt); - if (completion_event == odp_buffer_from_packet(params->pkt)) + if (completion_event == odp_packet_to_buffer(params->pkt)) completion_event = - odp_buffer_from_packet(params->out_pkt); + odp_packet_to_buffer(params->out_pkt); odph_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 435bc8b..82ea879 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -41,7 +41,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) return (odp_packet_t)buf; } -odp_buffer_t odp_buffer_from_packet(odp_packet_t pkt) +odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) { return (odp_buffer_t)pkt; } @@ -58,7 +58,7 @@ size_t odp_packet_get_len(odp_packet_t pkt) uint8_t *odp_packet_addr(odp_packet_t pkt) { - return odp_buffer_addr(odp_buffer_from_packet(pkt)); + return odp_buffer_addr(odp_packet_to_buffer(pkt)); } uint8_t *odp_packet_data(odp_packet_t pkt) @@ -381,8 +381,8 @@ int odp_packet_copy(odp_packet_t pkt_dst, odp_packet_t pkt_src) pkt_hdr_dst->buf_hdr.cur_offset = pkt_hdr_src->buf_hdr.cur_offset; /* Create a copy of the scatter list */ - odp_buffer_copy_scatter(odp_buffer_from_packet(pkt_dst), - odp_buffer_from_packet(pkt_src)); + odp_buffer_copy_scatter(odp_packet_to_buffer(pkt_dst), + odp_packet_to_buffer(pkt_src)); return 0; } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 0c30f0f..d6f86ce 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -431,11 +431,11 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) if (pkts > 0) { pkt = pkt_tbl[0]; - buf = odp_buffer_from_packet(pkt); + buf = odp_packet_to_buffer(pkt); buf_hdr = odp_buf_to_hdr(buf); for (i = 1, j = 0; i < pkts; ++i) { - buf = odp_buffer_from_packet(pkt_tbl[i]); + buf = odp_packet_to_buffer(pkt_tbl[i]); tmp_hdr_tbl[j++] = odp_buf_to_hdr(buf); } queue_enq_multi(qentry, tmp_hdr_tbl, j); @@ -467,7 +467,7 @@ int pktin_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int num) QUEUE_MULTI_MAX); if (pkts > 0) { for (i = 0; i < pkts; ++i) { - buf = odp_buffer_from_packet(pkt_tbl[i]); + buf = odp_packet_to_buffer(pkt_tbl[i]); tmp_hdr_tbl[i] = odp_buf_to_hdr(buf); } queue_enq_multi(qentry, tmp_hdr_tbl, pkts);