From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B4C602B9D for ; Wed, 23 Mar 2016 10:20:30 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 23 Mar 2016 02:20:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,381,1455004800"; d="scan'208";a="930040155" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 23 Mar 2016 02:20:29 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 23 Mar 2016 02:20:29 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 23 Mar 2016 02:20:28 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.24]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.136]) with mapi id 14.03.0248.002; Wed, 23 Mar 2016 17:20:26 +0800 From: "Liu, Yong" To: "Qiu, Michael" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD Thread-Index: AQHRhAc0lpbnuSJTzU+nsEUApF2XmJ9mwJsw Date: Wed, 23 Mar 2016 09:20:26 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E14ECD563@SHSMSX103.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> <533710CFB86FA344BFBF2D6802E6028622F712A7@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E6028622F712A7@SHSMSX101.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmNhMDkzOGYtNWE0Yi00OTExLWExODMtMjQ0YjQ1YzU1N2ZiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlFXcWdzRHZmMTRMcUpXQkljNThUKzNhcTVBRGk2bUJmb2wzSDZnTVFNVjg9In0= x-ctpclassification: CTP_IC 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: Wed, 23 Mar 2016 09:20:31 -0000 > -----Original Message----- > From: Qiu, Michael > Sent: Tuesday, March 22, 2016 5:05 PM > To: Liu, Yong; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD >=20 > On 3/22/2016 2:51 PM, Marvin Liu wrote: > > 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 > > > > 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 =3D=3D AF_INET) { > > tunnel_filter_conf.ip_addr.ipv4_addr =3D > > - rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr); > > + res->ip_value.addr.ipv4.s_addr; > > tunnel_filter_conf.ip_type =3D RTE_TUNNEL_IPTYPE_IPV4; > > } else { > > - int i; > > - for (i =3D 0; i < 4; i++) { > > - tunnel_filter_conf.ip_addr.ipv6_addr[i] =3D > > - 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 =3D 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 =3D 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 =3D rte_cpu_to_le_16(tunnel_filter->inner_vlan); > > if (tunnel_filter->ip_type =3D=3D RTE_TUNNEL_IPTYPE_IPV4) { > > ip_type =3D I40E_AQC_ADD_CLOUD_FLAGS_IPV4; > > + ipv4_addr =3D rte_be_to_cpu_32(tunnel_filter- > >ip_addr.ipv4_addr); >=20 > As I checked "ipv4_addr" is the host Endian, so does it need to covert > again? Maybe I'm wrong. >=20 Michael, This logic is for i40e API required little endian. Variable "ipv4_addr" par= sed by cmdline library has been in big endian. To fulfill the special requirement of admin queue, i40e drive will do the s= wap. > Thanks, > Michael > > 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 =3D I40E_AQC_ADD_CLOUD_FLAGS_IPV6; > > for (i =3D 0; i < 4; i++) { > > convert_ipv6[i] =3D > > - 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));