From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 10E1C532C for ; Wed, 10 Apr 2019 10:32:30 +0200 (CEST) Received: from glumotte.dev.6wind.com. (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id F2185295E6D; Wed, 10 Apr 2019 10:32:29 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org Cc: Ferruh Yigit Date: Wed, 10 Apr 2019 10:32:13 +0200 Message-Id: <20190410083218.17531-10-olivier.matz@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190410083218.17531-1-olivier.matz@6wind.com> References: <20181024081833.21432-1-olivier.matz@6wind.com> <20190410083218.17531-1-olivier.matz@6wind.com> Subject: [dpdk-dev] [RFC v2 09/14] net: add rte prefix to icmp defines X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Apr 2019 08:32:30 -0000 Add 'RTE_' prefix to defines: - rename IP_ICMP_ECHO_REPLY as RTE_IP_ICMP_ECHO_REPLY. - rename IP_ICMP_ECHO_REQUEST as RTE_IP_ICMP_ECHO_REQUEST. Signed-off-by: Olivier Matz --- app/test-pmd/icmpecho.c | 10 +++++----- lib/librte_net/rte_icmp.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c index 33b9e2ffd..4bf3fed64 100644 --- a/app/test-pmd/icmpecho.c +++ b/app/test-pmd/icmpecho.c @@ -428,7 +428,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) icmp_h = (struct rte_icmp_hdr *) ((char *)ip_h + sizeof(struct ipv4_hdr)); if (! ((ip_h->next_proto_id == IPPROTO_ICMP) && - (icmp_h->icmp_type == IP_ICMP_ECHO_REQUEST) && + (icmp_h->icmp_type == RTE_IP_ICMP_ECHO_REQUEST) && (icmp_h->icmp_code == 0))) { rte_pktmbuf_free(pkt); continue; @@ -452,7 +452,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) * - switch the request IP source and destination * addresses in the reply IP header, * - keep the IP header checksum unchanged. - * - set IP_ICMP_ECHO_REPLY in ICMP header. + * - set RTE_IP_ICMP_ECHO_REPLY in ICMP header. * ICMP checksum is computed by assuming it is valid in the * echo request and not verified. */ @@ -475,10 +475,10 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) ip_h->src_addr = ip_h->dst_addr; ip_h->dst_addr = ip_addr; } - icmp_h->icmp_type = IP_ICMP_ECHO_REPLY; + icmp_h->icmp_type = RTE_IP_ICMP_ECHO_REPLY; cksum = ~icmp_h->icmp_cksum & 0xffff; - cksum += ~htons(IP_ICMP_ECHO_REQUEST << 8) & 0xffff; - cksum += htons(IP_ICMP_ECHO_REPLY << 8); + cksum += ~htons(RTE_IP_ICMP_ECHO_REQUEST << 8) & 0xffff; + cksum += htons(RTE_IP_ICMP_ECHO_REPLY << 8); cksum = (cksum & 0xffff) + (cksum >> 16); cksum = (cksum & 0xffff) + (cksum >> 16); icmp_h->icmp_cksum = ~cksum; diff --git a/lib/librte_net/rte_icmp.h b/lib/librte_net/rte_icmp.h index d0309537e..3f8100a5f 100644 --- a/lib/librte_net/rte_icmp.h +++ b/lib/librte_net/rte_icmp.h @@ -32,8 +32,8 @@ struct rte_icmp_hdr { } __attribute__((__packed__)); /* ICMP packet types */ -#define IP_ICMP_ECHO_REPLY 0 -#define IP_ICMP_ECHO_REQUEST 8 +#define RTE_IP_ICMP_ECHO_REPLY 0 +#define RTE_IP_ICMP_ECHO_REQUEST 8 #ifdef __cplusplus } -- 2.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 794FCA0096 for ; Wed, 10 Apr 2019 10:33:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5BD365F51; Wed, 10 Apr 2019 10:33:00 +0200 (CEST) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 10E1C532C for ; Wed, 10 Apr 2019 10:32:30 +0200 (CEST) Received: from glumotte.dev.6wind.com. (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id F2185295E6D; Wed, 10 Apr 2019 10:32:29 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org Cc: Ferruh Yigit Date: Wed, 10 Apr 2019 10:32:13 +0200 Message-Id: <20190410083218.17531-10-olivier.matz@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190410083218.17531-1-olivier.matz@6wind.com> References: <20181024081833.21432-1-olivier.matz@6wind.com> <20190410083218.17531-1-olivier.matz@6wind.com> Subject: [dpdk-dev] [RFC v2 09/14] net: add rte prefix to icmp defines X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190410083213.ZPBpJuQL_9p_8RyMzMs8SpzirJMusYJocMaif0xQt08@z> Add 'RTE_' prefix to defines: - rename IP_ICMP_ECHO_REPLY as RTE_IP_ICMP_ECHO_REPLY. - rename IP_ICMP_ECHO_REQUEST as RTE_IP_ICMP_ECHO_REQUEST. Signed-off-by: Olivier Matz --- app/test-pmd/icmpecho.c | 10 +++++----- lib/librte_net/rte_icmp.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c index 33b9e2ffd..4bf3fed64 100644 --- a/app/test-pmd/icmpecho.c +++ b/app/test-pmd/icmpecho.c @@ -428,7 +428,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) icmp_h = (struct rte_icmp_hdr *) ((char *)ip_h + sizeof(struct ipv4_hdr)); if (! ((ip_h->next_proto_id == IPPROTO_ICMP) && - (icmp_h->icmp_type == IP_ICMP_ECHO_REQUEST) && + (icmp_h->icmp_type == RTE_IP_ICMP_ECHO_REQUEST) && (icmp_h->icmp_code == 0))) { rte_pktmbuf_free(pkt); continue; @@ -452,7 +452,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) * - switch the request IP source and destination * addresses in the reply IP header, * - keep the IP header checksum unchanged. - * - set IP_ICMP_ECHO_REPLY in ICMP header. + * - set RTE_IP_ICMP_ECHO_REPLY in ICMP header. * ICMP checksum is computed by assuming it is valid in the * echo request and not verified. */ @@ -475,10 +475,10 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) ip_h->src_addr = ip_h->dst_addr; ip_h->dst_addr = ip_addr; } - icmp_h->icmp_type = IP_ICMP_ECHO_REPLY; + icmp_h->icmp_type = RTE_IP_ICMP_ECHO_REPLY; cksum = ~icmp_h->icmp_cksum & 0xffff; - cksum += ~htons(IP_ICMP_ECHO_REQUEST << 8) & 0xffff; - cksum += htons(IP_ICMP_ECHO_REPLY << 8); + cksum += ~htons(RTE_IP_ICMP_ECHO_REQUEST << 8) & 0xffff; + cksum += htons(RTE_IP_ICMP_ECHO_REPLY << 8); cksum = (cksum & 0xffff) + (cksum >> 16); cksum = (cksum & 0xffff) + (cksum >> 16); icmp_h->icmp_cksum = ~cksum; diff --git a/lib/librte_net/rte_icmp.h b/lib/librte_net/rte_icmp.h index d0309537e..3f8100a5f 100644 --- a/lib/librte_net/rte_icmp.h +++ b/lib/librte_net/rte_icmp.h @@ -32,8 +32,8 @@ struct rte_icmp_hdr { } __attribute__((__packed__)); /* ICMP packet types */ -#define IP_ICMP_ECHO_REPLY 0 -#define IP_ICMP_ECHO_REQUEST 8 +#define RTE_IP_ICMP_ECHO_REPLY 0 +#define RTE_IP_ICMP_ECHO_REQUEST 8 #ifdef __cplusplus } -- 2.11.0