Message ID | 1458629413-24771-1-git-send-email-yong.liu@intel.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4FC3B2C1A; Tue, 22 Mar 2016 07:50:33 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0C2E32BF3 for <dev@dpdk.org>; Tue, 22 Mar 2016 07:50:31 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 21 Mar 2016 23:50:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,375,1455004800"; d="scan'208";a="916173326" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 21 Mar 2016 23:50:28 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id u2M6oRq2005703; Tue, 22 Mar 2016 14:50:27 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u2M6oOo1024813; Tue, 22 Mar 2016 14:50:26 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id u2M6oOn1024809; Tue, 22 Mar 2016 14:50:24 +0800 From: Marvin Liu <yong.liu@intel.com> To: dev@dpdk.org Cc: Marvin Liu <yong.liu@intel.com> Date: Tue, 22 Mar 2016 14:50:13 +0800 Message-Id: <1458629413-24771-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1458524684-13539-1-git-send-email-yong.liu@intel.com> References: <1458524684-13539-1-git-send-email-yong.liu@intel.com> Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Marvin Liu
March 22, 2016, 6:50 a.m. UTC
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>
Comments
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 <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); As I checked "ipv4_addr" is the host Endian, so does it need to covert again? Maybe I'm wrong. 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 = 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));
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marvin Liu > Sent: Tuesday, March 22, 2016 2:50 PM > To: dev@dpdk.org > Cc: Liu, Yong > Subject: [dpdk-dev] [PATCH v2] 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>
> -----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 > > 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 <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); > > As I checked "ipv4_addr" is the host Endian, so does it need to covert > again? Maybe I'm wrong. > Michael, This logic is for i40e API required little endian. Variable "ipv4_addr" parsed by cmdline library has been in big endian. To fulfill the special requirement of admin queue, i40e drive will do the swap. > 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 = 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));
2016-03-23 02:17, Wu, Jingjing: > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marvin Liu > > 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> It looks good but something is missing to decide that it is the right fix: the API do not state wether these fields (and others) are big endian or something else. Please Jingjing, fix the ethdev comments for these fields and others rte_eth_ipv*_flow in a separate patch.
On Wed, Mar 23, 2016 at 04:17:12PM +0100, Thomas Monjalon wrote: > 2016-03-23 02:17, Wu, Jingjing: > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marvin Liu > > > 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> > > It looks good but something is missing to decide that it is the right fix: > the API do not state wether these fields (and others) are big endian or > something else. > > Please Jingjing, fix the ethdev comments for these fields and others > rte_eth_ipv*_flow in a separate patch. +1 to the more info because the endianness is confusing here. However, this look a better fix than the previous one (v1 patch). Thomas, can this be merged for RC2 to fix the BSD build, which should be a priority? Even if it's not the full solution, I think we need to at least get the code building on BSD. Thanks, /Bruce
On Fri, Mar 25, 2016 at 12:10:40PM +0000, Bruce Richardson wrote: > On Wed, Mar 23, 2016 at 04:17:12PM +0100, Thomas Monjalon wrote: > > 2016-03-23 02:17, Wu, Jingjing: > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marvin Liu > > > > 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> > > > > It looks good but something is missing to decide that it is the right fix: > > the API do not state wether these fields (and others) are big endian or > > something else. > > > > Please Jingjing, fix the ethdev comments for these fields and others > > rte_eth_ipv*_flow in a separate patch. > > +1 to the more info because the endianness is confusing here. However, this look > a better fix than the previous one (v1 patch). > > Thomas, can this be merged for RC2 to fix the BSD build, which should be a > priority? Even if it's not the full solution, I think we need to at least get > the code building on BSD. > > Thanks, > /Bruce And I confirm this patch fixes the FreeBSD compile for both gcc and clang. Tested-by: Bruce Richardson <bruce.richardson@intel.com>
2016-03-25 12:15, Bruce Richardson: > On Fri, Mar 25, 2016 at 12:10:40PM +0000, Bruce Richardson wrote: > > On Wed, Mar 23, 2016 at 04:17:12PM +0100, Thomas Monjalon wrote: > > > 2016-03-23 02:17, Wu, Jingjing: > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marvin Liu > > > > > 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> > > > > > > It looks good but something is missing to decide that it is the right fix: > > > the API do not state wether these fields (and others) are big endian or > > > something else. > > > > > > Please Jingjing, fix the ethdev comments for these fields and others > > > rte_eth_ipv*_flow in a separate patch. > > > > +1 to the more info because the endianness is confusing here. However, this look > > a better fix than the previous one (v1 patch). > > > > Thomas, can this be merged for RC2 to fix the BSD build, which should be a > > priority? Even if it's not the full solution, I think we need to at least get > > the code building on BSD. > > > > Thanks, > > /Bruce > > And I confirm this patch fixes the FreeBSD compile for both gcc and clang. > > Tested-by: Bruce Richardson <bruce.richardson@intel.com> Applied, thanks
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));