* [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD @ 2016-03-21 1:44 Marvin Liu 2016-03-21 8:59 ` Mrzyglod, DanielX T ` (2 more replies) 0 siblings, 3 replies; 15+ messages in thread From: Marvin Liu @ 2016-03-21 1:44 UTC (permalink / raw) To: dev; +Cc: 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. 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..51ad23b 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6684,7 +6684,11 @@ cmd_tunnel_filter_parsed(void *parsed_result, int i; for (i = 0; i < 4; i++) { tunnel_filter_conf.ip_addr.ipv6_addr[i] = +#ifdef RTE_EXEC_ENV_BSDAPP + rte_be_to_cpu_32(res->ip_value.addr.ipv6.__u6_addr.__u6_addr32[i]); +#else rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); +#endif } tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; } -- 1.9.3 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD 2016-03-21 1:44 [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD Marvin Liu @ 2016-03-21 8:59 ` Mrzyglod, DanielX T 2016-03-21 9:13 ` Sergio Gonzalez Monroy 2016-03-22 6:50 ` [dpdk-dev] [PATCH v2] " Marvin Liu 2 siblings, 0 replies; 15+ messages in thread From: Mrzyglod, DanielX T @ 2016-03-21 8:59 UTC (permalink / raw) To: Liu, Yong, dev; +Cc: Liu, Yong >From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marvin Liu >Sent: Monday, March 21, 2016 2:45 AM >To: dev@dpdk.org >Cc: Liu, Yong <yong.liu@intel.com> >Subject: [dpdk-dev] [PATCH] 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. > >Signed-off-by: Marvin Liu <yong.liu@intel.com> Acked-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD 2016-03-21 1:44 [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD 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-22 6:50 ` [dpdk-dev] [PATCH v2] " Marvin Liu 2 siblings, 1 reply; 15+ messages in thread From: Sergio Gonzalez Monroy @ 2016-03-21 9:13 UTC (permalink / raw) To: Marvin Liu, dev On 21/03/2016 01:44, 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. > > 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..51ad23b 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -6684,7 +6684,11 @@ cmd_tunnel_filter_parsed(void *parsed_result, > int i; > for (i = 0; i < 4; i++) { > tunnel_filter_conf.ip_addr.ipv6_addr[i] = > +#ifdef RTE_EXEC_ENV_BSDAPP > + rte_be_to_cpu_32(res->ip_value.addr.ipv6.__u6_addr.__u6_addr32[i]); > +#else > rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]); > +#endif Why not always use .__u6_addr.__u6_addr32[i] and avoid ifdef? Sergio > } > tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; > } ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD 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 0 siblings, 2 replies; 15+ messages in thread From: De Lara Guarch, Pablo @ 2016-03-21 9:40 UTC (permalink / raw) To: Gonzalez Monroy, Sergio, Liu, Yong, dev > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez > Monroy > Sent: Monday, March 21, 2016 9:13 AM > To: Liu, Yong; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD > > On 21/03/2016 01:44, 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. > > > > 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..51ad23b 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -6684,7 +6684,11 @@ cmd_tunnel_filter_parsed(void *parsed_result, > > int i; > > for (i = 0; i < 4; i++) { > > tunnel_filter_conf.ip_addr.ipv6_addr[i] = > > +#ifdef RTE_EXEC_ENV_BSDAPP > > + rte_be_to_cpu_32(res- > >ip_value.addr.ipv6.__u6_addr.__u6_addr32[i]); > > +#else > > rte_be_to_cpu_32(res- > >ip_value.addr.ipv6.s6_addr32[i]); > > +#endif > > Why not always use .__u6_addr.__u6_addr32[i] and avoid ifdef? > > Sergio > > > } > > tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; > > } Also, can you include the missing "Fixes" line? Thanks, Pablo ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD 2016-03-21 9:40 ` De Lara Guarch, Pablo @ 2016-03-21 14:57 ` Bruce Richardson 2016-03-22 3:30 ` Liu, Yong 1 sibling, 0 replies; 15+ messages in thread From: Bruce Richardson @ 2016-03-21 14:57 UTC (permalink / raw) To: De Lara Guarch, Pablo; +Cc: Gonzalez Monroy, Sergio, Liu, Yong, dev On Mon, Mar 21, 2016 at 09:40:07AM +0000, De Lara Guarch, Pablo wrote: > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez > > Monroy > > Sent: Monday, March 21, 2016 9:13 AM > > To: Liu, Yong; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD > > > > On 21/03/2016 01:44, 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. > > > > > > 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..51ad23b 100644 > > > --- a/app/test-pmd/cmdline.c > > > +++ b/app/test-pmd/cmdline.c > > > @@ -6684,7 +6684,11 @@ cmd_tunnel_filter_parsed(void *parsed_result, > > > int i; > > > for (i = 0; i < 4; i++) { > > > tunnel_filter_conf.ip_addr.ipv6_addr[i] = > > > +#ifdef RTE_EXEC_ENV_BSDAPP > > > + rte_be_to_cpu_32(res- > > >ip_value.addr.ipv6.__u6_addr.__u6_addr32[i]); > > > +#else > > > rte_be_to_cpu_32(res- > > >ip_value.addr.ipv6.s6_addr32[i]); > > > +#endif > > > > Why not always use .__u6_addr.__u6_addr32[i] and avoid ifdef? > > > > Sergio > > > > > } > > > tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; > > > } > > Also, can you include the missing "Fixes" line? > A slightly higher level question: Why are we doing 32-bit endian conversions, when IPv6 addresses are normally specified in 16-bit (4-hex digit) blocks? /Bruce ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD 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 1 sibling, 1 reply; 15+ messages in thread From: Liu, Yong @ 2016-03-22 3:30 UTC (permalink / raw) To: De Lara Guarch, Pablo, Gonzalez Monroy, Sergio, dev Hi Pablo & Sergio, > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Monday, March 21, 2016 5:40 PM > To: Gonzalez Monroy, Sergio; Liu, Yong; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD > > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez > > Monroy > > Sent: Monday, March 21, 2016 9:13 AM > > To: Liu, Yong; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD > > > > On 21/03/2016 01:44, 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. > > > > > > 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..51ad23b 100644 > > > --- a/app/test-pmd/cmdline.c > > > +++ b/app/test-pmd/cmdline.c > > > @@ -6684,7 +6684,11 @@ cmd_tunnel_filter_parsed(void *parsed_result, > > > int i; > > > for (i = 0; i < 4; i++) { > > > tunnel_filter_conf.ip_addr.ipv6_addr[i] = > > > +#ifdef RTE_EXEC_ENV_BSDAPP > > > + rte_be_to_cpu_32(res- > > >ip_value.addr.ipv6.__u6_addr.__u6_addr32[i]); > > > +#else > > > rte_be_to_cpu_32(res- > > >ip_value.addr.ipv6.s6_addr32[i]); > > > +#endif > > > > Why not always use .__u6_addr.__u6_addr32[i] and avoid ifdef? > > Because of structures between BSD an Linux have different names. On linux, it will be "__in6_u. __u6_addr32". > > Sergio > > > > > } > > > tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; > > > } > > Also, can you include the missing "Fixes" line? > Sure, I will add it and send out v2. > Thanks, > Pablo Best regards, Marvin ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD 2016-03-22 3:30 ` Liu, Yong @ 2016-03-22 9:44 ` Sergio Gonzalez Monroy 0 siblings, 0 replies; 15+ messages in thread From: Sergio Gonzalez Monroy @ 2016-03-22 9:44 UTC (permalink / raw) To: Liu, Yong, De Lara Guarch, Pablo, dev On 22/03/2016 03:30, Liu, Yong wrote: > Hi Pablo & Sergio, > >> -----Original Message----- >> From: De Lara Guarch, Pablo >> Sent: Monday, March 21, 2016 5:40 PM >> To: Gonzalez Monroy, Sergio; Liu, Yong; dev@dpdk.org >> Subject: RE: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD >> >> >> >>> -----Original Message----- >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sergio Gonzalez >>> Monroy >>> Sent: Monday, March 21, 2016 9:13 AM >>> To: Liu, Yong; dev@dpdk.org >>> Subject: Re: [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD >>> >>> On 21/03/2016 01:44, 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. >>>> >>>> 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..51ad23b 100644 >>>> --- a/app/test-pmd/cmdline.c >>>> +++ b/app/test-pmd/cmdline.c >>>> @@ -6684,7 +6684,11 @@ cmd_tunnel_filter_parsed(void *parsed_result, >>>> int i; >>>> for (i = 0; i < 4; i++) { >>>> tunnel_filter_conf.ip_addr.ipv6_addr[i] = >>>> +#ifdef RTE_EXEC_ENV_BSDAPP >>>> + rte_be_to_cpu_32(res- >>>> ip_value.addr.ipv6.__u6_addr.__u6_addr32[i]); >>>> +#else >>>> rte_be_to_cpu_32(res- >>>> ip_value.addr.ipv6.s6_addr32[i]); >>>> +#endif >>> Why not always use .__u6_addr.__u6_addr32[i] and avoid ifdef? >>> > Because of structures between BSD an Linux have different names. > On linux, it will be "__in6_u. __u6_addr32". Duh! Sorry about that. I should drink coffee before replying emails. Sergio >>> Sergio >>> >>>> } >>>> tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6; >>>> } >> Also, can you include the missing "Fixes" line? >> > Sure, I will add it and send out v2. > >> Thanks, >> Pablo > Best regards, > Marvin > ^ permalink raw reply [flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD 2016-03-21 1:44 [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD Marvin Liu 2016-03-21 8:59 ` Mrzyglod, DanielX T 2016-03-21 9:13 ` Sergio Gonzalez Monroy @ 2016-03-22 6:50 ` Marvin Liu 2016-03-22 9:05 ` Qiu, Michael 2016-03-23 2:17 ` Wu, Jingjing 2 siblings, 2 replies; 15+ messages in thread From: Marvin Liu @ 2016-03-22 6:50 UTC (permalink / raw) To: dev; +Cc: 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> 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD 2016-03-22 6:50 ` [dpdk-dev] [PATCH v2] " Marvin Liu @ 2016-03-22 9:05 ` Qiu, Michael 2016-03-23 9:20 ` Liu, Yong 2016-03-23 2:17 ` Wu, Jingjing 1 sibling, 1 reply; 15+ messages in thread From: Qiu, Michael @ 2016-03-22 9:05 UTC (permalink / raw) To: Liu, Yong, dev 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)); ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD 2016-03-22 9:05 ` Qiu, Michael @ 2016-03-23 9:20 ` Liu, Yong 0 siblings, 0 replies; 15+ messages in thread From: Liu, Yong @ 2016-03-23 9:20 UTC (permalink / raw) To: Qiu, Michael, dev > -----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)); ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD 2016-03-22 6:50 ` [dpdk-dev] [PATCH v2] " Marvin Liu 2016-03-22 9:05 ` Qiu, Michael @ 2016-03-23 2:17 ` Wu, Jingjing 2016-03-23 15:17 ` Thomas Monjalon 1 sibling, 1 reply; 15+ messages in thread From: Wu, Jingjing @ 2016-03-23 2:17 UTC (permalink / raw) To: Liu, Yong, dev; +Cc: Liu, Yong > -----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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD 2016-03-23 2:17 ` Wu, Jingjing @ 2016-03-23 15:17 ` Thomas Monjalon 2016-03-25 12:10 ` Bruce Richardson 0 siblings, 1 reply; 15+ messages in thread From: Thomas Monjalon @ 2016-03-23 15:17 UTC (permalink / raw) To: Wu, Jingjing, Liu, Yong; +Cc: dev 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. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD 2016-03-23 15:17 ` Thomas Monjalon @ 2016-03-25 12:10 ` Bruce Richardson 2016-03-25 12:15 ` Bruce Richardson 0 siblings, 1 reply; 15+ messages in thread From: Bruce Richardson @ 2016-03-25 12:10 UTC (permalink / raw) To: Thomas Monjalon; +Cc: Wu, Jingjing, Liu, Yong, dev 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD 2016-03-25 12:10 ` Bruce Richardson @ 2016-03-25 12:15 ` Bruce Richardson 2016-03-25 18:19 ` Thomas Monjalon 0 siblings, 1 reply; 15+ messages in thread From: Bruce Richardson @ 2016-03-25 12:15 UTC (permalink / raw) To: Thomas Monjalon; +Cc: Wu, Jingjing, Liu, Yong, dev 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [dpdk-dev] [PATCH v2] testpmd: fix build on FreeBSD 2016-03-25 12:15 ` Bruce Richardson @ 2016-03-25 18:19 ` Thomas Monjalon 0 siblings, 0 replies; 15+ messages in thread From: Thomas Monjalon @ 2016-03-25 18:19 UTC (permalink / raw) To: Bruce Richardson, Liu, Yong; +Cc: Wu, Jingjing, dev 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2016-03-25 18:21 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-03-21 1:44 [dpdk-dev] [PATCH] testpmd: fix build on FreeBSD 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 ` [dpdk-dev] [PATCH v2] " Marvin Liu 2016-03-22 9:05 ` 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
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).