From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4A8D52BA0 for ; Tue, 22 Mar 2016 10:05:29 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 22 Mar 2016 02:05:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,376,1455004800"; d="scan'208";a="942459447" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 22 Mar 2016 02:05:27 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 02:05:27 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Mar 2016 02:05:27 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.24]) with mapi id 14.03.0248.002; Tue, 22 Mar 2016 17:05:25 +0800 From: "Qiu, Michael" To: "Liu, Yong" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD Thread-Index: AQHRhAc7P8oByNEiH0ukckeY7zzQOg== Date: Tue, 22 Mar 2016 09:05:24 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622F712A7@SHSMSX101.ccr.corp.intel.com> References: <1458524684-13539-1-git-send-email-yong.liu@intel.com> <1458629413-24771-1-git-send-email-yong.liu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 09:05:29 -0000 On 3/22/2016 2:51 PM, Marvin Liu wrote:=0A= > Build log:=0A= > /root/dpdk/app/test-pmd/cmdline.c:6687:45: error: no member named=0A= > 's6_addr32' in 'struct in6_addr'=0A= > rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);=0A= >=0A= > This is caused by macro "s6_addr32" not defined on FreeBSD and testpmd=0A= > swap big endian parameter to host endian. Move the swap action to i40e=0A= > ethdev will fix this issue.=0A= >=0A= > Fixes: 7b1312891b69 ("ethdev: add IP in GRE tunnel")=0A= >=0A= > Signed-off-by: Marvin Liu =0A= >=0A= > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c=0A= > index 9d52b8c..4f3d1e4 100644=0A= > --- a/app/test-pmd/cmdline.c=0A= > +++ b/app/test-pmd/cmdline.c=0A= > @@ -6678,14 +6678,12 @@ cmd_tunnel_filter_parsed(void *parsed_result,=0A= > =0A= > if (res->ip_value.family =3D=3D AF_INET) {=0A= > tunnel_filter_conf.ip_addr.ipv4_addr =3D=0A= > - rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr);=0A= > + res->ip_value.addr.ipv4.s_addr;=0A= > tunnel_filter_conf.ip_type =3D RTE_TUNNEL_IPTYPE_IPV4;=0A= > } else {=0A= > - int i;=0A= > - for (i =3D 0; i < 4; i++) {=0A= > - tunnel_filter_conf.ip_addr.ipv6_addr[i] =3D=0A= > - rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);=0A= > - }=0A= > + memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr),=0A= > + &(res->ip_value.addr.ipv6),=0A= > + sizeof(struct in6_addr));=0A= > tunnel_filter_conf.ip_type =3D RTE_TUNNEL_IPTYPE_IPV6;=0A= > }=0A= > =0A= > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c=0A= > index 10e0d38..43c2d5c 100644=0A= > --- a/drivers/net/i40e/i40e_ethdev.c=0A= > +++ b/drivers/net/i40e/i40e_ethdev.c=0A= > @@ -6015,6 +6015,7 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf,=0A= > uint8_t add)=0A= > {=0A= > uint16_t ip_type;=0A= > + uint32_t ipv4_addr;=0A= > uint8_t i, tun_type =3D 0;=0A= > /* internal varialbe to convert ipv6 byte order */=0A= > uint32_t convert_ipv6[4];=0A= > @@ -6040,14 +6041,15 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf,=0A= > pfilter->inner_vlan =3D rte_cpu_to_le_16(tunnel_filter->inner_vlan);=0A= > if (tunnel_filter->ip_type =3D=3D RTE_TUNNEL_IPTYPE_IPV4) {=0A= > ip_type =3D I40E_AQC_ADD_CLOUD_FLAGS_IPV4;=0A= > + ipv4_addr =3D rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr);=0A= =0A= As I checked "ipv4_addr" is the host Endian, so does it need to covert=0A= again? Maybe I'm wrong.=0A= =0A= Thanks,=0A= Michael=0A= > rte_memcpy(&pfilter->ipaddr.v4.data,=0A= > - &rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv4_addr),=0A= > + &rte_cpu_to_le_32(ipv4_addr),=0A= > sizeof(pfilter->ipaddr.v4.data));=0A= > } else {=0A= > ip_type =3D I40E_AQC_ADD_CLOUD_FLAGS_IPV6;=0A= > for (i =3D 0; i < 4; i++) {=0A= > convert_ipv6[i] =3D=0A= > - rte_cpu_to_le_32(tunnel_filter->ip_addr.ipv6_addr[i]);=0A= > + rte_cpu_to_le_32(rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv6_addr[i]= ));=0A= > }=0A= > rte_memcpy(&pfilter->ipaddr.v6.data, &convert_ipv6,=0A= > sizeof(pfilter->ipaddr.v6.data));=0A= =0A=