DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marvin Liu <yong.liu@intel.com>
To: dev@dpdk.org
Cc: Marvin Liu <yong.liu@intel.com>
Subject: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD
Date: Tue, 22 Mar 2016 14:50:13 +0800	[thread overview]
Message-ID: <1458629413-24771-1-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1458524684-13539-1-git-send-email-yong.liu@intel.com>

Build log:
/root/dpdk/app/test-pmd/cmdline.c:6687:45: error: no member named
's6_addr32' in 'struct in6_addr'
    rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);

This is caused by macro "s6_addr32" not defined on FreeBSD and testpmd
swap big endian parameter to host endian. Move the swap action to i40e
ethdev will fix this issue.

Fixes: 7b1312891b69 ("ethdev: add IP in GRE tunnel")

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9d52b8c..4f3d1e4 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6678,14 +6678,12 @@ cmd_tunnel_filter_parsed(void *parsed_result,
 
 	if (res->ip_value.family == AF_INET) {
 		tunnel_filter_conf.ip_addr.ipv4_addr =
-			rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr);
+			res->ip_value.addr.ipv4.s_addr;
 		tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4;
 	} else {
-		int i;
-		for (i = 0; i < 4; i++) {
-			tunnel_filter_conf.ip_addr.ipv6_addr[i] =
-			rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);
-		}
+		memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr),
+			&(res->ip_value.addr.ipv6),
+			sizeof(struct in6_addr));
 		tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6;
 	}
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 10e0d38..43c2d5c 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -6015,6 +6015,7 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf,
 			uint8_t add)
 {
 	uint16_t ip_type;
+	uint32_t ipv4_addr;
 	uint8_t i, tun_type = 0;
 	/* internal varialbe to convert ipv6 byte order */
 	uint32_t convert_ipv6[4];
@@ -6040,14 +6041,15 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf,
 	pfilter->inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan);
 	if (tunnel_filter->ip_type == RTE_TUNNEL_IPTYPE_IPV4) {
 		ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4;
+		ipv4_addr = rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr);
 		rte_memcpy(&pfilter->ipaddr.v4.data,
-				&rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr),
+				&rte_cpu_to_le_32(ipv4_addr),
 				sizeof(pfilter->ipaddr.v4.data));
 	} else {
 		ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6;
 		for (i = 0; i < 4; i++) {
 			convert_ipv6[i] =
-			rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]);
+			rte_cpu_to_le_32(rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv6_addr[i]));
 		}
 		rte_memcpy(&pfilter->ipaddr.v6.data, &convert_ipv6,
 				sizeof(pfilter->ipaddr.v6.data));
-- 
1.9.3

  parent reply	other threads:[~2016-03-22  6:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21  1:44 [dpdk-dev] [PATCH] " Marvin Liu
2016-03-21  8:59 ` Mrzyglod, DanielX T
2016-03-21  9:13 ` Sergio Gonzalez Monroy
2016-03-21  9:40   ` De Lara Guarch, Pablo
2016-03-21 14:57     ` Bruce Richardson
2016-03-22  3:30     ` Liu, Yong
2016-03-22  9:44       ` Sergio Gonzalez Monroy
2016-03-22  6:50 ` Marvin Liu [this message]
2016-03-22  9:05   ` [dpdk-dev] [PATCH v2] " Qiu, Michael
2016-03-23  9:20     ` Liu, Yong
2016-03-23  2:17   ` Wu, Jingjing
2016-03-23 15:17     ` Thomas Monjalon
2016-03-25 12:10       ` Bruce Richardson
2016-03-25 12:15         ` Bruce Richardson
2016-03-25 18:19           ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458629413-24771-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).