summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2016-03-22 14:50:13 +0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-03-25 19:52:59 +0100
commitedc845bd53ecd1eea30bb8dd878493f7496f7671 (patch)
treee4d9ab839ac036984059d5c4d6a462fed856fcb5
parent34c41ec8033e6b0805b475b3a657ad199da9054d (diff)
downloaddpdk-edc845bd53ecd1eea30bb8dd878493f7496f7671.zip
dpdk-edc845bd53ecd1eea30bb8dd878493f7496f7671.tar.gz
dpdk-edc845bd53ecd1eea30bb8dd878493f7496f7671.tar.xz
app/testpmd: fix build on FreeBSD
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> Acked-by: Jingjing Wu <jingjing.wu@intel.com> Tested-by: Bruce Richardson <bruce.richardson@intel.com>
-rw-r--r--app/test-pmd/cmdline.c10
-rw-r--r--drivers/net/i40e/i40e_ethdev.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 25b87ca..93203f4 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6683,14 +6683,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 dbb909c..05126e8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -6032,6 +6032,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];
@@ -6057,14 +6058,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));