From patchwork Fri Oct 3 10:17:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 38311 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 4DC5A2057C for ; Fri, 3 Oct 2014 10:18:57 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id b6sf498777lbj.11 for ; Fri, 03 Oct 2014 03:18:56 -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=DpZhwOJPvpMpGjPxM7DQd3l3EWGjQHgigfLPWWUtvtU=; b=TynSGevU2nspq/HD31OgX1t2/GEqzoU9DPtBobaBXTz//53Y1rv//UhnZ92+//6S/h ruf5QEO6mgufsXSWk3lGBfbi0+ipdbhmijWiPHolMtBPFAB3CeA0u+06U9zds7exReJ0 UdWYjy8IgX7b3FUQbAANisqszFNVbkdt34OXVGfAwgBet23INlLSfzxbBw5GIxFw2M+7 w+vYIRzYvybLuKIUKHlLor4PFZQhPoFUHXTCrDm1+Lm5hJEixhFWng3q+IbwSbsd1bcW hnle2c/cBGgWCVgZG87mVukGYyI1giKU6dsqQ80dF758Ww3eWLZ8pXIwQZWkJ+1XraId 66+Q== X-Gm-Message-State: ALoCoQmChhwW16IFQNR5WPucjjzEXrJM4gpBvJalM0sISDryUsbr50P11JE/ldFq36WzmyQy6VE8 X-Received: by 10.180.109.67 with SMTP id hq3mr305148wib.1.1412331536015; Fri, 03 Oct 2014 03:18:56 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.99 with SMTP id x3ls370158laj.90.gmail; Fri, 03 Oct 2014 03:18:55 -0700 (PDT) X-Received: by 10.112.171.202 with SMTP id aw10mr4548410lbc.52.1412331535679; Fri, 03 Oct 2014 03:18:55 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by mx.google.com with ESMTPS id ee12si10295777lbd.126.2014.10.03.03.18.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 03:18:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ge10so743624lab.24 for ; Fri, 03 Oct 2014 03:18:55 -0700 (PDT) X-Received: by 10.112.75.233 with SMTP id f9mr2115302lbw.102.1412331535201; Fri, 03 Oct 2014 03:18:55 -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 of9csp201318lbb; Fri, 3 Oct 2014 03:18:54 -0700 (PDT) X-Received: by 10.229.136.133 with SMTP id r5mr1995744qct.31.1412331533969; Fri, 03 Oct 2014 03:18:53 -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 e14si11484386qaa.39.2014.10.03.03.18.52 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 03 Oct 2014 03:18:53 -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 1XZzwp-0007Ip-FP; Fri, 03 Oct 2014 10:18:51 +0000 Received: from mail-qc0-f177.google.com ([209.85.216.177]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XZzwj-0007If-Jp for lng-odp@lists.linaro.org; Fri, 03 Oct 2014 10:18:45 +0000 Received: by mail-qc0-f177.google.com with SMTP id c9so716508qcz.22 for ; Fri, 03 Oct 2014 03:18:40 -0700 (PDT) X-Received: by 10.140.101.139 with SMTP id u11mr4083610qge.48.1412331520393; Fri, 03 Oct 2014 03:18:40 -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 s49sm5370573qge.15.2014.10.03.03.18.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 03:18:39 -0700 (PDT) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Fri, 3 Oct 2014 13:17:57 +0300 Message-Id: <1412331478-30433-1-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.1.1 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] Rename packet buffer address 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.51 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 - Unify function naming between packets and segment: xxx_addr(), xxx_data() - Rename odp_packet_buf_addr() to odp_packet_addr() Signed-off-by: Petri Savolainen --- example/ipsec/odp_ipsec.c | 8 ++++---- platform/linux-generic/include/api/odp_packet.h | 8 ++++---- platform/linux-generic/odp_crypto.c | 8 ++++---- platform/linux-generic/odp_packet.c | 10 +++++----- platform/linux-generic/odp_packet_socket.c | 10 +++++----- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index cd94d9a..bca957f 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -673,7 +673,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt, pkt_ctx_t *ctx, bool *skip) { - uint8_t *buf = odp_packet_buf_addr(pkt); + uint8_t *buf = odp_packet_addr(pkt); odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); int hdr_len; odph_ahhdr_t *ah = NULL; @@ -775,7 +775,7 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt, * Finish auth */ if (ctx->ipsec.ah_offset) { - uint8_t *buf = odp_packet_buf_addr(pkt); + uint8_t *buf = odp_packet_addr(pkt); odph_ahhdr_t *ah; ah = (odph_ahhdr_t *)(ctx->ipsec.ah_offset + buf); @@ -833,7 +833,7 @@ pkt_disposition_e do_ipsec_out_classify(odp_packet_t pkt, pkt_ctx_t *ctx, bool *skip) { - uint8_t *buf = odp_packet_buf_addr(pkt); + uint8_t *buf = odp_packet_addr(pkt); odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt); uint16_t ip_data_len = ipv4_data_len(ip); uint8_t *ip_data = ipv4_data_p(ip); @@ -953,7 +953,7 @@ static pkt_disposition_e do_ipsec_out_seq(odp_packet_t pkt, pkt_ctx_t *ctx) { - uint8_t *buf = odp_packet_buf_addr(pkt); + uint8_t *buf = odp_packet_addr(pkt); bool posted = 0; /* We were dispatched from atomic queue, assign sequence numbers */ diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h index 4a089d1..83f345a 100644 --- a/platform/linux-generic/include/api/odp_packet.h +++ b/platform/linux-generic/include/api/odp_packet.h @@ -131,7 +131,7 @@ void *odp_packet_get_ctx(odp_packet_t buf); * * @see odp_packet_l2(), odp_packet_start() */ -uint8_t *odp_packet_buf_addr(odp_packet_t pkt); +uint8_t *odp_packet_addr(odp_packet_t pkt); /** * Get pointer to the start of the received frame @@ -148,7 +148,7 @@ uint8_t *odp_packet_buf_addr(odp_packet_t pkt); * * @return Pointer to the start of the received frame * - * @see odp_packet_l2(), odp_packet_buf_addr() + * @see odp_packet_l2(), odp_packet_addr() */ uint8_t *odp_packet_start(odp_packet_t pkt); @@ -156,13 +156,13 @@ uint8_t *odp_packet_start(odp_packet_t pkt); * Get pointer to the start of the L2 frame * * The L2 frame header address is not necessarily the same as the address of the - * packet buffer, see odp_packet_buf_addr() + * packet buffer, see odp_packet_addr() * * @param pkt Packet handle * * @return Pointer to L2 header or NULL if not found * - * @see odp_packet_buf_addr(), odp_packet_start() + * @see odp_packet_addr(), odp_packet_start() */ uint8_t *odp_packet_l2(odp_packet_t pkt); diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 12d0272..b37ad6b 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -78,7 +78,7 @@ static enum crypto_alg_err md5_gen(odp_crypto_op_params_t *params, odp_crypto_generic_session_t *session) { - uint8_t *data = odp_packet_buf_addr(params->out_pkt); + uint8_t *data = odp_packet_addr(params->out_pkt); uint8_t *icv = data; uint32_t len = params->auth_range.length; uint8_t hash[EVP_MAX_MD_SIZE]; @@ -106,7 +106,7 @@ static enum crypto_alg_err md5_check(odp_crypto_op_params_t *params, odp_crypto_generic_session_t *session) { - uint8_t *data = odp_packet_buf_addr(params->out_pkt); + uint8_t *data = odp_packet_addr(params->out_pkt); uint8_t *icv = data; uint32_t len = params->auth_range.length; uint32_t bytes = session->auth.data.md5.bytes; @@ -144,7 +144,7 @@ static enum crypto_alg_err des_encrypt(odp_crypto_op_params_t *params, odp_crypto_generic_session_t *session) { - uint8_t *data = odp_packet_buf_addr(params->out_pkt); + uint8_t *data = odp_packet_addr(params->out_pkt); uint32_t len = params->cipher_range.length; DES_cblock *iv; DES_cblock iv_temp; @@ -181,7 +181,7 @@ static enum crypto_alg_err des_decrypt(odp_crypto_op_params_t *params, odp_crypto_generic_session_t *session) { - uint8_t *data = odp_packet_buf_addr(params->out_pkt); + uint8_t *data = odp_packet_addr(params->out_pkt); uint32_t len = params->cipher_range.length; DES_cblock *iv = (DES_cblock *)session->cipher.iv.data; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 64fd0f8..6cd6183 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -56,14 +56,14 @@ size_t odp_packet_get_len(odp_packet_t pkt) return odp_packet_hdr(pkt)->frame_len; } -uint8_t *odp_packet_buf_addr(odp_packet_t pkt) +uint8_t *odp_packet_addr(odp_packet_t pkt) { return odp_buffer_addr(odp_buffer_from_packet(pkt)); } uint8_t *odp_packet_start(odp_packet_t pkt) { - return odp_packet_buf_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; + return odp_packet_addr(pkt) + odp_packet_hdr(pkt)->frame_offset; } @@ -74,7 +74,7 @@ uint8_t *odp_packet_l2(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_buf_addr(pkt) + offset; + return odp_packet_addr(pkt) + offset; } size_t odp_packet_l2_offset(odp_packet_t pkt) @@ -94,7 +94,7 @@ uint8_t *odp_packet_l3(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_buf_addr(pkt) + offset; + return odp_packet_addr(pkt) + offset; } size_t odp_packet_l3_offset(odp_packet_t pkt) @@ -114,7 +114,7 @@ uint8_t *odp_packet_l4(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_buf_addr(pkt) + offset; + return odp_packet_addr(pkt) + offset; } size_t odp_packet_l4_offset(odp_packet_t pkt) diff --git a/platform/linux-generic/odp_packet_socket.c b/platform/linux-generic/odp_packet_socket.c index e173c31..e3c2753 100644 --- a/platform/linux-generic/odp_packet_socket.c +++ b/platform/linux-generic/odp_packet_socket.c @@ -190,7 +190,7 @@ int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev, if (!odph_packet_is_valid(pkt)) return -1; - pkt_buf = odp_packet_buf_addr(pkt); + pkt_buf = odp_packet_addr(pkt); l2_hdr = ETHBUF_ALIGN(pkt_buf); /* Store eth buffer offset for pkt buffers from this pool */ pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf; @@ -302,7 +302,7 @@ int recv_pkt_sock_basic(pkt_sock_t *const pkt_sock, break; } - pkt_buf = odp_packet_buf_addr(pkt); + pkt_buf = odp_packet_addr(pkt); l2_hdr = pkt_buf + pkt_sock->frame_offset; recv_bytes = recvfrom(sockfd, l2_hdr, @@ -399,7 +399,7 @@ int recv_pkt_sock_mmsg(pkt_sock_t *const pkt_sock, if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) break; - pkt_buf = odp_packet_buf_addr(pkt_table[i]); + pkt_buf = odp_packet_addr(pkt_table[i]); l2_hdr = pkt_buf + pkt_sock->frame_offset; iovecs[i].iov_base = l2_hdr; iovecs[i].iov_len = pkt_sock->max_frame_len; @@ -573,7 +573,7 @@ static inline unsigned pkt_mmap_v2_rx(int sock, struct ring *ring, if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) break; - l2_hdr = odp_packet_buf_addr(pkt_table[i]) + l2_hdr = odp_packet_addr(pkt_table[i]) + frame_offset; memcpy(l2_hdr, pkt_buf, pkt_len); @@ -819,7 +819,7 @@ int setup_pkt_sock_mmap(pkt_sock_mmap_t *const pkt_sock, const char *netdev, if (!odph_packet_is_valid(pkt)) return -1; - pkt_buf = odp_packet_buf_addr(pkt); + pkt_buf = odp_packet_addr(pkt); l2_hdr = ETHBUF_ALIGN(pkt_buf); /* Store eth buffer offset for pkt buffers from this pool */ pkt_sock->frame_offset = (uintptr_t)l2_hdr - (uintptr_t)pkt_buf;