From patchwork Fri Aug 29 13:14:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 36286 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9281E2054D for ; Fri, 29 Aug 2014 13:15:44 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf4849451pde.10 for ; Fri, 29 Aug 2014 06:15:43 -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:in-reply-to :references: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=ptkC30OwslN8IEzZH8nQMHJG37BFBf7vwfMfEvwUOPo=; b=YvkuSNYEOdHlggu72/x1sBQIiIfBjJ7cZU4C7p7Yc7xTCwRqAZjAJ4vBYrDXocApLw z7mG7y3FKI4IQ+6L6mRkvjwq3BElju27Ib8GUs0Ti35cyQ+7KdTNtbeL9+bvDfmQKaN3 t3AlMki6dl+2hzSt1AIWXzNjTu/6ffiIupbyAnTINC5HNbvudS9074v/mHkA1+vHppNR S/pfAiDZDwq3W77rYUJgUM0RescvFFBqbKoSupCkuiJ5jV/2gIqM10dTprLpXyNG3rYe Fzlt4PVrCbrOC5T+2l0mV6MRgcdcWM2ggWGXP540ppuAHp5KfiQ+ZQa4Vz7FRP/eax9c VxOQ== X-Gm-Message-State: ALoCoQkcurr+bhyCbB+QS7btdyJBWauYXKpsJoIgXyL+PLNgf7Bhqv8Qk3JwqXkZgLuPVynZD2Xs X-Received: by 10.68.222.194 with SMTP id qo2mr5785421pbc.6.1409318143836; Fri, 29 Aug 2014 06:15:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.176 with SMTP id l45ls1017386qgd.81.gmail; Fri, 29 Aug 2014 06:15:43 -0700 (PDT) X-Received: by 10.221.49.133 with SMTP id va5mr7893926vcb.37.1409318143653; Fri, 29 Aug 2014 06:15:43 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id h6si3489194vdc.96.2014.08.29.06.15.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Aug 2014 06:15:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so2374602vcb.20 for ; Fri, 29 Aug 2014 06:15:43 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr7705442vcy.45.1409318143567; Fri, 29 Aug 2014 06:15:43 -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.221.45.67 with SMTP id uj3csp14413vcb; Fri, 29 Aug 2014 06:15:43 -0700 (PDT) X-Received: by 10.224.156.194 with SMTP id y2mr13886255qaw.15.1409318142932; Fri, 29 Aug 2014 06:15:42 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id g6si103677qai.19.2014.08.29.06.15.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 29 Aug 2014 06:15:42 -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-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XNM1l-0008Ih-1B; Fri, 29 Aug 2014 13:15:41 +0000 Received: from mail-la0-f52.google.com ([209.85.215.52]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XNM1S-0008I0-01 for lng-odp@lists.linaro.org; Fri, 29 Aug 2014 13:15:22 +0000 Received: by mail-la0-f52.google.com with SMTP id ty20so2718293lab.11 for ; Fri, 29 Aug 2014 06:15:16 -0700 (PDT) X-Received: by 10.112.165.68 with SMTP id yw4mr10826715lbb.5.1409318116053; Fri, 29 Aug 2014 06:15:16 -0700 (PDT) Received: from localhost (c-853670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.133]) by mx.google.com with ESMTPSA id rl10sm4517850lac.28.2014.08.29.06.15.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 29 Aug 2014 06:15:15 -0700 (PDT) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Fri, 29 Aug 2014 15:14:54 +0200 Message-Id: <1409318094-27641-3-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409318094-27641-1-git-send-email-anders.roxell@linaro.org> References: <1409318094-27641-1-git-send-email-anders.roxell@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 2/2] odph_icmp: add ODPH_ prefix 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: anders.roxell@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.220.175 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 Signed-off-by: Anders Roxell Reviewed-by:Mike Holmes Acked-by: Petri Savolainen --- example/generator/odp_generator.c | 6 +-- helper/include/odph_chksum.h | 2 +- helper/include/odph_eth.h | 2 +- helper/include/odph_icmp.h | 79 +++++++++++++++++++-------------------- helper/include/odph_ip.h | 2 +- helper/include/odph_linux.h | 2 +- helper/include/odph_packet.h | 2 +- helper/include/odph_ring.h | 2 +- 8 files changed, 48 insertions(+), 49 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 65c2034..cd71bc9 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -264,7 +264,7 @@ static void pack_icmp_pkt(odp_buffer_t obuf) odph_ipv4_csum_update(pkt); /* icmp */ icmp = (odph_icmphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN); - icmp->type = ICMP_ECHO; + icmp->type = ODPH_ICMP_ECHO; icmp->code = 0; icmp->un.echo.id = 0; icmp->un.echo.sequence = ip->id; @@ -419,7 +419,7 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len) if (ip->proto == ODPH_IPPROTO_ICMP) { icmp = (odph_icmphdr_t *)(buf + offset); /* echo reply */ - if (icmp->type == ICMP_ECHOREPLY) { + if (icmp->type == ODPH_ICMP_ECHOREPLY) { odp_atomic_inc_u64(&counters.icmp); memcpy(&tvsend, buf + offset + ODPH_ICMPHDR_LEN, sizeof(struct timeval)); @@ -432,7 +432,7 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len) "ICMP Echo Reply seq %d time %.1f ", odp_be_to_cpu_16(icmp->un.echo.sequence) , rtt); - } else if (icmp->type == ICMP_ECHO) { + } else if (icmp->type == ODPH_ICMP_ECHO) { rlen += sprintf(msg + rlen, "Icmp Echo Request"); } diff --git a/helper/include/odph_chksum.h b/helper/include/odph_chksum.h index 710711a..3bcc2b6 100644 --- a/helper/include/odph_chksum.h +++ b/helper/include/odph_chksum.h @@ -8,7 +8,7 @@ /** * @file * - * ODP Checksum + * ODPH Checksum */ #ifndef ODP_CHKSUM_H_ #define ODP_CHKSUM_H_ diff --git a/helper/include/odph_eth.h b/helper/include/odph_eth.h index 55a2b1e..45f7fea 100644 --- a/helper/include/odph_eth.h +++ b/helper/include/odph_eth.h @@ -8,7 +8,7 @@ /** * @file * - * ODP ethernet header + * ODPH ethernet header */ #ifndef ODPH_ETH_H_ diff --git a/helper/include/odph_icmp.h b/helper/include/odph_icmp.h index 8414d7e..622f48b 100644 --- a/helper/include/odph_icmp.h +++ b/helper/include/odph_icmp.h @@ -8,7 +8,7 @@ /** * @file * - * ODP ICMP header + * ODPH ICMP header */ #ifndef ODPH_ICMP_H_ @@ -43,51 +43,50 @@ typedef struct ODPH_PACKED { } un; /**< icmp sub header */ } odph_icmphdr_t; -#define ICMP_ECHOREPLY 0 /**< Echo Reply */ -#define ICMP_DEST_UNREACH 3 /**< Destination Unreachable */ -#define ICMP_SOURCE_QUENCH 4 /**< Source Quench */ -#define ICMP_REDIRECT 5 /**< Redirect (change route) */ -#define ICMP_ECHO 8 /**< Echo Request */ -#define ICMP_TIME_EXCEEDED 11 /**< Time Exceeded */ -#define ICMP_PARAMETERPROB 12 /**< Parameter Problem */ -#define ICMP_TIMESTAMP 13 /**< Timestamp Request */ -#define ICMP_TIMESTAMPREPLY 14 /**< Timestamp Reply */ -#define ICMP_INFO_REQUEST 15 /**< Information Request */ -#define ICMP_INFO_REPLY 16 /**< Information Reply */ -#define ICMP_ADDRESS 17 /**< Address Mask Request */ -#define ICMP_ADDRESSREPLY 18 /**< Address Mask Reply */ -#define NR_ICMP_TYPES 18 /**< Number of icmp types */ +#define ODPH_ICMP_ECHOREPLY 0 /**< Echo Reply */ +#define ODPH_ICMP_DEST_UNREACH 3 /**< Destination Unreachable */ +#define ODPH_ICMP_SOURCE_QUENCH 4 /**< Source Quench */ +#define ODPH_ICMP_REDIRECT 5 /**< Redirect (change route) */ +#define ODPH_ICMP_ECHO 8 /**< Echo Request */ +#define ODPH_ICMP_TIME_EXCEEDED 11 /**< Time Exceeded */ +#define ODPH_ICMP_PARAMETERPROB 12 /**< Parameter Problem */ +#define ODPH_ICMP_TIMESTAMP 13 /**< Timestamp Request */ +#define ODPH_ICMP_TIMESTAMPREPLY 14 /**< Timestamp Reply */ +#define ODPH_ICMP_INFO_REQUEST 15 /**< Information Request */ +#define ODPH_ICMP_INFO_REPLY 16 /**< Information Reply */ +#define ODPH_ICMP_ADDRESS 17 /**< Address Mask Request */ +#define ODPH_ICMP_ADDRESSREPLY 18 /**< Address Mask Reply */ +#define ODPH_NR_ICMP_TYPES 18 /**< Number of icmp types */ /** Codes for UNREACH. */ -#define ICMP_NET_UNREACH 0 /**< Network Unreachable */ -#define ICMP_HOST_UNREACH 1 /**< Host Unreachable */ -#define ICMP_PROT_UNREACH 2 /**< Protocol Unreachable */ -#define ICMP_PORT_UNREACH 3 /**< Port Unreachable */ -#define ICMP_FRAG_NEEDED 4 /**< Fragmentation Needed/DF set*/ -#define ICMP_SR_FAILED 5 /**< Source Route failed */ -#define ICMP_NET_UNKNOWN 6 /**< Network Unknown */ -#define ICMP_HOST_UNKNOWN 7 /**< Host Unknown */ -#define ICMP_HOST_ISOLATED 8 /**< Host Isolated */ -#define ICMP_NET_ANO 9 /**< ICMP_NET_ANO */ -#define ICMP_HOST_ANO 10 /**< ICMP_HOST_ANO */ -#define ICMP_NET_UNR_TOS 11 /**< ICMP_NET_UNR_TOS */ -#define ICMP_HOST_UNR_TOS 12 /**< ICMP_HOST_UNR_TOS */ -#define ICMP_PKT_FILTERED 13 /**< Packet filtered */ -#define ICMP_PREC_VIOLATION 14 /**< Precedence violation */ -#define ICMP_PREC_CUTOFF 15 /**< Precedence cut off */ -#define NR_ICMP_UNREACH 15 /**< instead of hardcoding - immediate value */ +#define ODPH_ICMP_NET_UNREACH 0 /**< Network Unreachable */ +#define ODPH_ICMP_HOST_UNREACH 1 /**< Host Unreachable */ +#define ODPH_ICMP_PROT_UNREACH 2 /**< Protocol Unreachable */ +#define ODPH_ICMP_PORT_UNREACH 3 /**< Port Unreachable */ +#define ODPH_ICMP_FRAG_NEEDED 4 /**< Fragmentation Needed/DF set */ +#define ODPH_ICMP_SR_FAILED 5 /**< Source Route failed */ +#define ODPH_ICMP_NET_UNKNOWN 6 /**< Network Unknown */ +#define ODPH_ICMP_HOST_UNKNOWN 7 /**< Host Unknown */ +#define ODPH_ICMP_HOST_ISOLATED 8 /**< Host Isolated */ +#define ODPH_ICMP_NET_ANO 9 /**< ICMP_NET_ANO */ +#define ODPH_ICMP_HOST_ANO 10 /**< ICMP_HOST_ANO */ +#define ODPH_ICMP_NET_UNR_TOS 11 /**< ICMP_NET_UNR_TOS */ +#define ODPH_ICMP_HOST_UNR_TOS 12 /**< ICMP_HOST_UNR_TOS */ +#define ODPH_ICMP_PKT_FILTERED 13 /**< Packet filtered */ +#define ODPH_ICMP_PREC_VIOLATION 14 /**< Precedence violation */ +#define ODPH_ICMP_PREC_CUTOFF 15 /**< Precedence cut off */ +#define ODPH_NR_ICMP_UNREACH 15 /**< instead of hardcoding + immediate value */ /** Codes for REDIRECT. */ -#define ICMP_REDIR_NET 0 /**< Redirect Net */ -#define ICMP_REDIR_HOST 1 /**< Redirect Host */ -#define ICMP_REDIR_NETTOS 2 /**< Redirect Net for TOS */ -#define ICMP_REDIR_HOSTTOS 3 /**< Redirect Host for TOS */ +#define ODPH_ICMP_REDIR_NET 0 /**< Redirect Net */ +#define ODPH_ICMP_REDIR_HOST 1 /**< Redirect Host */ +#define ODPH_ICMP_REDIR_NETTOS 2 /**< Redirect Net for TOS */ +#define ODPH_ICMP_REDIR_HOSTTOS 3 /**< Redirect Host for TOS */ /** Codes for TIME_EXCEEDED. */ -#define ICMP_EXC_TTL 0 /**< TTL count exceeded */ -#define ICMP_EXC_FRAGTIME 1 /**< Fragment Reass time - exceeded*/ +#define ODPH_ICMP_EXC_TTL 0 /**< TTL count exceeded */ +#define ODPH_ICMP_EXC_FRAGTIME 1 /**< Fragment Reass time exceeded*/ /** @internal Compile time assert */ ODP_STATIC_ASSERT(sizeof(odph_icmphdr_t) == ODPH_ICMPHDR_LEN, "ODPH_ICMPHDR_T__SIZE_ERROR"); diff --git a/helper/include/odph_ip.h b/helper/include/odph_ip.h index ca71c44..4fb9c12 100644 --- a/helper/include/odph_ip.h +++ b/helper/include/odph_ip.h @@ -8,7 +8,7 @@ /** * @file * - * ODP IP header + * ODPH IP header */ #ifndef ODPH_IP_H_ diff --git a/helper/include/odph_linux.h b/helper/include/odph_linux.h index 1ea349a..be91dd3 100644 --- a/helper/include/odph_linux.h +++ b/helper/include/odph_linux.h @@ -8,7 +8,7 @@ /** * @file * - * ODP Linux helper API + * ODPH Linux helper API * * This file is an optional helper to odp.h APIs. Application can manage * pthreads also by other means. diff --git a/helper/include/odph_packet.h b/helper/include/odph_packet.h index c18f48d..c5315a9 100644 --- a/helper/include/odph_packet.h +++ b/helper/include/odph_packet.h @@ -8,7 +8,7 @@ /** * @file * - * Optional ODP packet helper functions + * Optional ODPH packet helper functions */ #ifndef ODPH_PACKET_HELPER_H_ diff --git a/helper/include/odph_ring.h b/helper/include/odph_ring.h index 76c1db8..82d2d13 100644 --- a/helper/include/odph_ring.h +++ b/helper/include/odph_ring.h @@ -192,7 +192,7 @@ typedef struct odph_ring { * - ENOMEM - no appropriate memory area found in which to create memzone */ odph_ring_t *odph_ring_create(const char *name, unsigned count, - unsigned flags); + unsigned flags); /**