From patchwork Thu Aug 28 22:02:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 36265 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 165E4202DD for ; Thu, 28 Aug 2014 22:02:52 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf25727303pab.5 for ; Thu, 28 Aug 2014 15:02:51 -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=EEWYTis4Defla30uABYiNjl5DXDV4ybUwZni3gpszqo=; b=j3Ih8Oyh5HJwXsaMd/lcCCbFJXFX/4MchjIqKJPc3/kbwQxlh4sJD4EmSEPvqIhC7d dxIRsmVxSJz8RxgLQDz3rvhqegwCFKM/99bWBOiMNgg1MyyRCCaiClbAr0lPzSRee0rV IETYpGGYbAuYgE8DYcUEoSCajFhopQSWbmAZpwDolEF2hBZIXGUouWePXs57QYjA5xNR IYepJ79hKwAH5XM8Ducn98Ln6NdHSho7LAIXBMfYjDq/p8lbTi7aX06HZNnSR7DtMqXK MB9rc7ElPK+HzA9ByCyhLWQYiQ8D2AXaNYlE5jF0VSO5krK5YE9VymW0Qfy2CT4izUlX GruA== X-Gm-Message-State: ALoCoQngmjFXF3pbWOXajOjD5Q5qKQZMgSrrAwjCQZvb67cF8ICwczx08hCt02FxQyPDg0x1YZQP X-Received: by 10.66.220.37 with SMTP id pt5mr3656441pac.24.1409263371300; Thu, 28 Aug 2014 15:02:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.113 with SMTP id e104ls740760qgd.33.gmail; Thu, 28 Aug 2014 15:02:51 -0700 (PDT) X-Received: by 10.221.64.142 with SMTP id xi14mr5320707vcb.31.1409263371163; Thu, 28 Aug 2014 15:02:51 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id pr2si5337830vdb.23.2014.08.28.15.02.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 15:02:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so1618643vcb.2 for ; Thu, 28 Aug 2014 15:02:51 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr4445041vcy.45.1409263371042; Thu, 28 Aug 2014 15:02:51 -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 uj3csp302674vcb; Thu, 28 Aug 2014 15:02:50 -0700 (PDT) X-Received: by 10.140.51.166 with SMTP id u35mr10719373qga.68.1409263370548; Thu, 28 Aug 2014 15:02:50 -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 p95si7746412qgp.16.2014.08.28.15.02.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 28 Aug 2014 15:02:50 -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 1XN7mK-0003bT-M0; Thu, 28 Aug 2014 22:02:48 +0000 Received: from mail-lb0-f171.google.com ([209.85.217.171]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XN7m1-0003aQ-1Q for lng-odp@lists.linaro.org; Thu, 28 Aug 2014 22:02:29 +0000 Received: by mail-lb0-f171.google.com with SMTP id n15so1634852lbi.2 for ; Thu, 28 Aug 2014 15:02:22 -0700 (PDT) X-Received: by 10.152.7.177 with SMTP id k17mr7618543laa.10.1409263342802; Thu, 28 Aug 2014 15:02:22 -0700 (PDT) Received: from localhost (c-853670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.133]) by mx.google.com with ESMTPSA id i3sm3195848laa.8.2014.08.28.15.02.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 28 Aug 2014 15:02:21 -0700 (PDT) From: Anders Roxell To: lng-odp@lists.linaro.org Date: Fri, 29 Aug 2014 00:02:09 +0200 Message-Id: <1409263329-26011-3-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409263329-26011-1-git-send-email-anders.roxell@linaro.org> References: <1409263329-26011-1-git-send-email-anders.roxell@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 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.171 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_helper.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 70c0353..246bccf 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_helper.h b/helper/include/odph_packet_helper.h index c18f48d..c5315a9 100644 --- a/helper/include/odph_packet_helper.h +++ b/helper/include/odph_packet_helper.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); /**