mbox series

[0/3] aarch32 compilation

Message ID 20200424065053.119885-1-ruifeng.wang@arm.com (mailing list archive)
Headers
Series aarch32 compilation |

Message

Ruifeng Wang April 24, 2020, 6:50 a.m. UTC
  Build aarch32 binary on aarch64 platform hit issues with l3fwd [1]
and ixgbe PMD [2]. This patch set is to fix these.

When building with make, please refer to guide:
http://patches.dpdk.org/patch/62820/

When building with meson, requires series:
http://patches.dpdk.org/cover/68534/

[1] https://mails.dpdk.org/archives/dev/2020-April/162673.html
[2] https://mails.dpdk.org/archives/dev/2020-April/163846.html


Ruifeng Wang (3):
  arch/arm: add vcopyq intrinsic for aarch32
  net/ixgbe: add support for aarch32
  net/ixgbe: fix include of vector header file

 drivers/net/ixgbe/ixgbe_rxtx.h          | 4 ++--
 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 3 +--
 lib/librte_eal/arm/include/rte_vect.h   | 6 +++++-
 3 files changed, 8 insertions(+), 5 deletions(-)
  

Comments

Ferruh Yigit May 1, 2020, 3:06 p.m. UTC | #1
On 4/24/2020 7:50 AM, Ruifeng Wang wrote:
> Build aarch32 binary on aarch64 platform hit issues with l3fwd [1]
> and ixgbe PMD [2]. This patch set is to fix these.
> 
> When building with make, please refer to guide:
> http://patches.dpdk.org/patch/62820/
> 
> When building with meson, requires series:
> http://patches.dpdk.org/cover/68534/
> 
> [1] https://mails.dpdk.org/archives/dev/2020-April/162673.html
> [2] https://mails.dpdk.org/archives/dev/2020-April/163846.html
> 
> 
> Ruifeng Wang (3):
>   arch/arm: add vcopyq intrinsic for aarch32
>   net/ixgbe: add support for aarch32
>   net/ixgbe: fix include of vector header file
> 

Not directly related to this patch but since you are fixing aarch32 compilation,
I am getting following -Wcast-align warnings [1] while cross building with:
arm-linux-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 9.3.0


[1]
.../lib/librte_eal/linux/eal_vfio_mp_sync.c: In function ‘vfio_mp_primary’:
.../lib/librte_eal/linux/eal_vfio_mp_sync.c:31:28: warning: cast increases
required alignment of target type [-Wcast-align]
   31 |  struct vfio_mp_param *r = (struct vfio_mp_param *)reply.param;
      |                            ^
.../lib/librte_eal/linux/eal_vfio_mp_sync.c:33:3: warning: cast increases
required alignment of target type [-Wcast-align]
   33 |   (const struct vfio_mp_param *)msg->param;
      |   ^
.../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_open_group_fd’:
.../lib/librte_eal/linux/eal_vfio.c:269:28: warning: cast increases required
alignment of target type [-Wcast-align]
  269 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
      |                            ^
.../lib/librte_eal/linux/eal_vfio.c:316:7: warning: cast increases required
alignment of target type [-Wcast-align]
  316 |   p = (struct vfio_mp_param *)mp_rep->param;
      |       ^
  CC eal_common_class.o
.../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_sync_default_container’:
.../lib/librte_eal/linux/eal_vfio.c:627:28: warning: cast increases required
alignment of target type [-Wcast-align]
  627 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
      |                            ^
.../lib/librte_eal/linux/eal_vfio.c:652:7: warning: cast increases required
alignment of target type [-Wcast-align]
  652 |   p = (struct vfio_mp_param *)mp_rep->param;
      |       ^
.../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_get_default_container_fd’:
.../lib/librte_eal/linux/eal_vfio.c:1094:28: warning: cast increases required
alignment of target type [-Wcast-align]
 1094 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
      |                            ^
.../lib/librte_eal/linux/eal_vfio.c:1116:7: warning: cast increases required
alignment of target type [-Wcast-align]
 1116 |   p = (struct vfio_mp_param *)mp_rep->param;
      |       ^
  CC eal_common_bus.o
.../lib/librte_eal/linux/eal_vfio.c: In function ‘rte_vfio_get_container_fd’:
.../lib/librte_eal/linux/eal_vfio.c:1202:28: warning: cast increases required
alignment of target type [-Wcast-align]
 1202 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
      |                            ^
.../lib/librte_eal/linux/eal_vfio.c:1248:7: warning: cast increases required
alignment of target type [-Wcast-align]
 1248 |   p = (struct vfio_mp_param *)mp_rep->param;
      |       ^
  
Ruifeng Wang May 6, 2020, 8:09 a.m. UTC | #2
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Friday, May 1, 2020 11:07 PM
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
> konstantin.ananyev@intel.com; jerinj@marvell.com;
> viktorin@rehivetech.com
> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
> <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
> 
> On 4/24/2020 7:50 AM, Ruifeng Wang wrote:
> > Build aarch32 binary on aarch64 platform hit issues with l3fwd [1] and
> > ixgbe PMD [2]. This patch set is to fix these.
> >
> > When building with make, please refer to guide:
> > http://patches.dpdk.org/patch/62820/
> >
> > When building with meson, requires series:
> > http://patches.dpdk.org/cover/68534/
> >
> > [1] https://mails.dpdk.org/archives/dev/2020-April/162673.html
> > [2] https://mails.dpdk.org/archives/dev/2020-April/163846.html
> >
> >
> > Ruifeng Wang (3):
> >   arch/arm: add vcopyq intrinsic for aarch32
> >   net/ixgbe: add support for aarch32
> >   net/ixgbe: fix include of vector header file
> >
> 
> Not directly related to this patch but since you are fixing aarch32 compilation,
> I am getting following -Wcast-align warnings [1] while cross building with:
> arm-linux-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 9.3.0
> 
I got the same warnings with arm-linux-gnueabihf-gcc. The warnings spread in many different files.
It is because armv7a/aarch32 puts strict align requirement. 
We can first make it compile. And clean up such warnings in next step?

> 
> [1]
> .../lib/librte_eal/linux/eal_vfio_mp_sync.c: In function ‘vfio_mp_primary’:
> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:31:28: warning: cast increases
> required alignment of target type [-Wcast-align]
>    31 |  struct vfio_mp_param *r = (struct vfio_mp_param *)reply.param;
>       |                            ^
> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:33:3: warning: cast increases
> required alignment of target type [-Wcast-align]
>    33 |   (const struct vfio_mp_param *)msg->param;
>       |   ^
> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_open_group_fd’:
> .../lib/librte_eal/linux/eal_vfio.c:269:28: warning: cast increases required
> alignment of target type [-Wcast-align]
>   269 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
>       |                            ^
> .../lib/librte_eal/linux/eal_vfio.c:316:7: warning: cast increases required
> alignment of target type [-Wcast-align]
>   316 |   p = (struct vfio_mp_param *)mp_rep->param;
>       |       ^
>   CC eal_common_class.o
> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_sync_default_container’:
> .../lib/librte_eal/linux/eal_vfio.c:627:28: warning: cast increases required
> alignment of target type [-Wcast-align]
>   627 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
>       |                            ^
> .../lib/librte_eal/linux/eal_vfio.c:652:7: warning: cast increases required
> alignment of target type [-Wcast-align]
>   652 |   p = (struct vfio_mp_param *)mp_rep->param;
>       |       ^
> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_get_default_container_fd’:
> .../lib/librte_eal/linux/eal_vfio.c:1094:28: warning: cast increases required
> alignment of target type [-Wcast-align]
>  1094 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
>       |                            ^
> .../lib/librte_eal/linux/eal_vfio.c:1116:7: warning: cast increases required
> alignment of target type [-Wcast-align]
>  1116 |   p = (struct vfio_mp_param *)mp_rep->param;
>       |       ^
>   CC eal_common_bus.o
> .../lib/librte_eal/linux/eal_vfio.c: In function ‘rte_vfio_get_container_fd’:
> .../lib/librte_eal/linux/eal_vfio.c:1202:28: warning: cast increases required
> alignment of target type [-Wcast-align]
>  1202 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
>       |                            ^
> .../lib/librte_eal/linux/eal_vfio.c:1248:7: warning: cast increases required
> alignment of target type [-Wcast-align]
>  1248 |   p = (struct vfio_mp_param *)mp_rep->param;
>       |       ^
  
Ferruh Yigit May 6, 2020, 10:14 a.m. UTC | #3
On 5/6/2020 9:09 AM, Ruifeng Wang wrote:
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> Sent: Friday, May 1, 2020 11:07 PM
>> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
>> konstantin.ananyev@intel.com; jerinj@marvell.com;
>> viktorin@rehivetech.com
>> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa Nagarahalli
>> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
>> <nd@arm.com>
>> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
>>
>> On 4/24/2020 7:50 AM, Ruifeng Wang wrote:
>>> Build aarch32 binary on aarch64 platform hit issues with l3fwd [1] and
>>> ixgbe PMD [2]. This patch set is to fix these.
>>>
>>> When building with make, please refer to guide:
>>> http://patches.dpdk.org/patch/62820/
>>>
>>> When building with meson, requires series:
>>> http://patches.dpdk.org/cover/68534/
>>>
>>> [1] https://mails.dpdk.org/archives/dev/2020-April/162673.html
>>> [2] https://mails.dpdk.org/archives/dev/2020-April/163846.html
>>>
>>>
>>> Ruifeng Wang (3):
>>>   arch/arm: add vcopyq intrinsic for aarch32
>>>   net/ixgbe: add support for aarch32
>>>   net/ixgbe: fix include of vector header file
>>>
>>
>> Not directly related to this patch but since you are fixing aarch32 compilation,
>> I am getting following -Wcast-align warnings [1] while cross building with:
>> arm-linux-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 9.3.0
>>
> I got the same warnings with arm-linux-gnueabihf-gcc. The warnings spread in many different files.
> It is because armv7a/aarch32 puts strict align requirement. 
> We can first make it compile. And clean up such warnings in next step?

Sure.

I thought it would break the build, aren't we using -Werror for the target?

> 
>>
>> [1]
>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c: In function ‘vfio_mp_primary’:
>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:31:28: warning: cast increases
>> required alignment of target type [-Wcast-align]
>>    31 |  struct vfio_mp_param *r = (struct vfio_mp_param *)reply.param;
>>       |                            ^
>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:33:3: warning: cast increases
>> required alignment of target type [-Wcast-align]
>>    33 |   (const struct vfio_mp_param *)msg->param;
>>       |   ^
>> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_open_group_fd’:
>> .../lib/librte_eal/linux/eal_vfio.c:269:28: warning: cast increases required
>> alignment of target type [-Wcast-align]
>>   269 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
>>       |                            ^
>> .../lib/librte_eal/linux/eal_vfio.c:316:7: warning: cast increases required
>> alignment of target type [-Wcast-align]
>>   316 |   p = (struct vfio_mp_param *)mp_rep->param;
>>       |       ^
>>   CC eal_common_class.o
>> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_sync_default_container’:
>> .../lib/librte_eal/linux/eal_vfio.c:627:28: warning: cast increases required
>> alignment of target type [-Wcast-align]
>>   627 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
>>       |                            ^
>> .../lib/librte_eal/linux/eal_vfio.c:652:7: warning: cast increases required
>> alignment of target type [-Wcast-align]
>>   652 |   p = (struct vfio_mp_param *)mp_rep->param;
>>       |       ^
>> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_get_default_container_fd’:
>> .../lib/librte_eal/linux/eal_vfio.c:1094:28: warning: cast increases required
>> alignment of target type [-Wcast-align]
>>  1094 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
>>       |                            ^
>> .../lib/librte_eal/linux/eal_vfio.c:1116:7: warning: cast increases required
>> alignment of target type [-Wcast-align]
>>  1116 |   p = (struct vfio_mp_param *)mp_rep->param;
>>       |       ^
>>   CC eal_common_bus.o
>> .../lib/librte_eal/linux/eal_vfio.c: In function ‘rte_vfio_get_container_fd’:
>> .../lib/librte_eal/linux/eal_vfio.c:1202:28: warning: cast increases required
>> alignment of target type [-Wcast-align]
>>  1202 |  struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param;
>>       |                            ^
>> .../lib/librte_eal/linux/eal_vfio.c:1248:7: warning: cast increases required
>> alignment of target type [-Wcast-align]
>>  1248 |   p = (struct vfio_mp_param *)mp_rep->param;
>>       |       ^
  
Ruifeng Wang May 6, 2020, 1:54 p.m. UTC | #4
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Wednesday, May 6, 2020 6:14 PM
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
> konstantin.ananyev@intel.com; jerinj@marvell.com;
> viktorin@rehivetech.com
> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
> <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
> 
> On 5/6/2020 9:09 AM, Ruifeng Wang wrote:
> >
> >> -----Original Message-----
> >> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >> Sent: Friday, May 1, 2020 11:07 PM
> >> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
> >> konstantin.ananyev@intel.com; jerinj@marvell.com;
> >> viktorin@rehivetech.com
> >> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa
> Nagarahalli
> >> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
> >> <nd@arm.com>
> >> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
> >>
> >> On 4/24/2020 7:50 AM, Ruifeng Wang wrote:
> >>> Build aarch32 binary on aarch64 platform hit issues with l3fwd [1]
> >>> and ixgbe PMD [2]. This patch set is to fix these.
> >>>
> >>> When building with make, please refer to guide:
> >>> http://patches.dpdk.org/patch/62820/
> >>>
> >>> When building with meson, requires series:
> >>> http://patches.dpdk.org/cover/68534/
> >>>
> >>> [1] https://mails.dpdk.org/archives/dev/2020-April/162673.html
> >>> [2] https://mails.dpdk.org/archives/dev/2020-April/163846.html
> >>>
> >>>
> >>> Ruifeng Wang (3):
> >>>   arch/arm: add vcopyq intrinsic for aarch32
> >>>   net/ixgbe: add support for aarch32
> >>>   net/ixgbe: fix include of vector header file
> >>>
> >>
> >> Not directly related to this patch but since you are fixing aarch32
> >> compilation, I am getting following -Wcast-align warnings [1] while cross
> building with:
> >> arm-linux-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 9.3.0
> >>
> > I got the same warnings with arm-linux-gnueabihf-gcc. The warnings
> spread in many different files.
> > It is because armv7a/aarch32 puts strict align requirement.
> > We can first make it compile. And clean up such warnings in next step?
> 
> Sure.
> 
> I thought it would break the build, aren't we using -Werror for the target?
Currently, "RTE_DEVEL_BUILD=n" is needed for armv7 build.
http://patches.dpdk.org/patch/62820/

> 
> >
> >>
> >> [1]
> >> .../lib/librte_eal/linux/eal_vfio_mp_sync.c: In function ‘vfio_mp_primary’:
> >> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:31:28: warning: cast
> >> increases required alignment of target type [-Wcast-align]
> >>    31 |  struct vfio_mp_param *r = (struct vfio_mp_param *)reply.param;
> >>       |                            ^
> >> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:33:3: warning: cast
> >> increases required alignment of target type [-Wcast-align]
> >>    33 |   (const struct vfio_mp_param *)msg->param;
> >>       |   ^
> >> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_open_group_fd’:
> >> .../lib/librte_eal/linux/eal_vfio.c:269:28: warning: cast increases
> >> required alignment of target type [-Wcast-align]
> >>   269 |  struct vfio_mp_param *p = (struct vfio_mp_param
> *)mp_req.param;
> >>       |                            ^
> >> .../lib/librte_eal/linux/eal_vfio.c:316:7: warning: cast increases
> >> required alignment of target type [-Wcast-align]
> >>   316 |   p = (struct vfio_mp_param *)mp_rep->param;
> >>       |       ^
> >>   CC eal_common_class.o
> >> .../lib/librte_eal/linux/eal_vfio.c: In function
> ‘vfio_sync_default_container’:
> >> .../lib/librte_eal/linux/eal_vfio.c:627:28: warning: cast increases
> >> required alignment of target type [-Wcast-align]
> >>   627 |  struct vfio_mp_param *p = (struct vfio_mp_param
> *)mp_req.param;
> >>       |                            ^
> >> .../lib/librte_eal/linux/eal_vfio.c:652:7: warning: cast increases
> >> required alignment of target type [-Wcast-align]
> >>   652 |   p = (struct vfio_mp_param *)mp_rep->param;
> >>       |       ^
> >> .../lib/librte_eal/linux/eal_vfio.c: In function
> ‘vfio_get_default_container_fd’:
> >> .../lib/librte_eal/linux/eal_vfio.c:1094:28: warning: cast increases
> >> required alignment of target type [-Wcast-align]
> >>  1094 |  struct vfio_mp_param *p = (struct vfio_mp_param
> *)mp_req.param;
> >>       |                            ^
> >> .../lib/librte_eal/linux/eal_vfio.c:1116:7: warning: cast increases
> >> required alignment of target type [-Wcast-align]
> >>  1116 |   p = (struct vfio_mp_param *)mp_rep->param;
> >>       |       ^
> >>   CC eal_common_bus.o
> >> .../lib/librte_eal/linux/eal_vfio.c: In function ‘rte_vfio_get_container_fd’:
> >> .../lib/librte_eal/linux/eal_vfio.c:1202:28: warning: cast increases
> >> required alignment of target type [-Wcast-align]
> >>  1202 |  struct vfio_mp_param *p = (struct vfio_mp_param
> *)mp_req.param;
> >>       |                            ^
> >> .../lib/librte_eal/linux/eal_vfio.c:1248:7: warning: cast increases
> >> required alignment of target type [-Wcast-align]
> >>  1248 |   p = (struct vfio_mp_param *)mp_rep->param;
> >>       |       ^
  
Ferruh Yigit May 6, 2020, 2:14 p.m. UTC | #5
On 5/6/2020 2:54 PM, Ruifeng Wang wrote:
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> Sent: Wednesday, May 6, 2020 6:14 PM
>> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
>> konstantin.ananyev@intel.com; jerinj@marvell.com;
>> viktorin@rehivetech.com
>> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa Nagarahalli
>> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
>> <nd@arm.com>
>> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
>>
>> On 5/6/2020 9:09 AM, Ruifeng Wang wrote:
>>>
>>>> -----Original Message-----
>>>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>>>> Sent: Friday, May 1, 2020 11:07 PM
>>>> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
>>>> konstantin.ananyev@intel.com; jerinj@marvell.com;
>>>> viktorin@rehivetech.com
>>>> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa
>> Nagarahalli
>>>> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
>>>> <nd@arm.com>
>>>> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
>>>>
>>>> On 4/24/2020 7:50 AM, Ruifeng Wang wrote:
>>>>> Build aarch32 binary on aarch64 platform hit issues with l3fwd [1]
>>>>> and ixgbe PMD [2]. This patch set is to fix these.
>>>>>
>>>>> When building with make, please refer to guide:
>>>>> http://patches.dpdk.org/patch/62820/
>>>>>
>>>>> When building with meson, requires series:
>>>>> http://patches.dpdk.org/cover/68534/
>>>>>
>>>>> [1] https://mails.dpdk.org/archives/dev/2020-April/162673.html
>>>>> [2] https://mails.dpdk.org/archives/dev/2020-April/163846.html
>>>>>
>>>>>
>>>>> Ruifeng Wang (3):
>>>>>   arch/arm: add vcopyq intrinsic for aarch32
>>>>>   net/ixgbe: add support for aarch32
>>>>>   net/ixgbe: fix include of vector header file
>>>>>
>>>>
>>>> Not directly related to this patch but since you are fixing aarch32
>>>> compilation, I am getting following -Wcast-align warnings [1] while cross
>> building with:
>>>> arm-linux-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 9.3.0
>>>>
>>> I got the same warnings with arm-linux-gnueabihf-gcc. The warnings
>> spread in many different files.
>>> It is because armv7a/aarch32 puts strict align requirement.
>>> We can first make it compile. And clean up such warnings in next step?
>>
>> Sure.
>>
>> I thought it would break the build, aren't we using -Werror for the target?
> Currently, "RTE_DEVEL_BUILD=n" is needed for armv7 build.
> http://patches.dpdk.org/patch/62820/

May be not.

I did able to build without "RTE_DEVEL_BUILD=n", while checking how :), found
that "CONFIG_RTE_ARCH_STRICT_ALIGN=y" set in the armv7a config
(defconfig_arm-armv7a-linux-gcc), seems explicitly added for these
'-Wcast-align' warnings.

Overall to the point of the discussion, since this way or that, build is not
broken with cast-align warnings, I am OK to fix them later gradually.

A side note is, I wonder if these 'RTE_DEVEL_BUILD' or
'CONFIG_RTE_ARCH_STRICT_ALIGN' reflected to the meson build, taking into account
that make build is going away on 20.11, will we able to keep these
functionalities in meson.

> 
>>
>>>
>>>>
>>>> [1]
>>>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c: In function ‘vfio_mp_primary’:
>>>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:31:28: warning: cast
>>>> increases required alignment of target type [-Wcast-align]
>>>>    31 |  struct vfio_mp_param *r = (struct vfio_mp_param *)reply.param;
>>>>       |                            ^
>>>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:33:3: warning: cast
>>>> increases required alignment of target type [-Wcast-align]
>>>>    33 |   (const struct vfio_mp_param *)msg->param;
>>>>       |   ^
>>>> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_open_group_fd’:
>>>> .../lib/librte_eal/linux/eal_vfio.c:269:28: warning: cast increases
>>>> required alignment of target type [-Wcast-align]
>>>>   269 |  struct vfio_mp_param *p = (struct vfio_mp_param
>> *)mp_req.param;
>>>>       |                            ^
>>>> .../lib/librte_eal/linux/eal_vfio.c:316:7: warning: cast increases
>>>> required alignment of target type [-Wcast-align]
>>>>   316 |   p = (struct vfio_mp_param *)mp_rep->param;
>>>>       |       ^
>>>>   CC eal_common_class.o
>>>> .../lib/librte_eal/linux/eal_vfio.c: In function
>> ‘vfio_sync_default_container’:
>>>> .../lib/librte_eal/linux/eal_vfio.c:627:28: warning: cast increases
>>>> required alignment of target type [-Wcast-align]
>>>>   627 |  struct vfio_mp_param *p = (struct vfio_mp_param
>> *)mp_req.param;
>>>>       |                            ^
>>>> .../lib/librte_eal/linux/eal_vfio.c:652:7: warning: cast increases
>>>> required alignment of target type [-Wcast-align]
>>>>   652 |   p = (struct vfio_mp_param *)mp_rep->param;
>>>>       |       ^
>>>> .../lib/librte_eal/linux/eal_vfio.c: In function
>> ‘vfio_get_default_container_fd’:
>>>> .../lib/librte_eal/linux/eal_vfio.c:1094:28: warning: cast increases
>>>> required alignment of target type [-Wcast-align]
>>>>  1094 |  struct vfio_mp_param *p = (struct vfio_mp_param
>> *)mp_req.param;
>>>>       |                            ^
>>>> .../lib/librte_eal/linux/eal_vfio.c:1116:7: warning: cast increases
>>>> required alignment of target type [-Wcast-align]
>>>>  1116 |   p = (struct vfio_mp_param *)mp_rep->param;
>>>>       |       ^
>>>>   CC eal_common_bus.o
>>>> .../lib/librte_eal/linux/eal_vfio.c: In function ‘rte_vfio_get_container_fd’:
>>>> .../lib/librte_eal/linux/eal_vfio.c:1202:28: warning: cast increases
>>>> required alignment of target type [-Wcast-align]
>>>>  1202 |  struct vfio_mp_param *p = (struct vfio_mp_param
>> *)mp_req.param;
>>>>       |                            ^
>>>> .../lib/librte_eal/linux/eal_vfio.c:1248:7: warning: cast increases
>>>> required alignment of target type [-Wcast-align]
>>>>  1248 |   p = (struct vfio_mp_param *)mp_rep->param;
>>>>       |       ^
>
  
Ruifeng Wang May 6, 2020, 2:36 p.m. UTC | #6
> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Wednesday, May 6, 2020 10:15 PM
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
> konstantin.ananyev@intel.com; jerinj@marvell.com;
> viktorin@rehivetech.com
> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
> <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
> 
> On 5/6/2020 2:54 PM, Ruifeng Wang wrote:
> >
> >> -----Original Message-----
> >> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >> Sent: Wednesday, May 6, 2020 6:14 PM
> >> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
> >> konstantin.ananyev@intel.com; jerinj@marvell.com;
> >> viktorin@rehivetech.com
> >> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa
> Nagarahalli
> >> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
> >> <nd@arm.com>
> >> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
> >>
> >> On 5/6/2020 9:09 AM, Ruifeng Wang wrote:
> >>>
> >>>> -----Original Message-----
> >>>> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >>>> Sent: Friday, May 1, 2020 11:07 PM
> >>>> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; wenzhuo.lu@intel.com;
> >>>> konstantin.ananyev@intel.com; jerinj@marvell.com;
> >>>> viktorin@rehivetech.com
> >>>> Cc: dev@dpdk.org; Gavin Hu <Gavin.Hu@arm.com>; Honnappa
> >> Nagarahalli
> >>>> <Honnappa.Nagarahalli@arm.com>; juraj.linkes@pantheon.tech; nd
> >>>> <nd@arm.com>
> >>>> Subject: Re: [dpdk-dev] [PATCH 0/3] aarch32 compilation
> >>>>
> >>>> On 4/24/2020 7:50 AM, Ruifeng Wang wrote:
> >>>>> Build aarch32 binary on aarch64 platform hit issues with l3fwd [1]
> >>>>> and ixgbe PMD [2]. This patch set is to fix these.
> >>>>>
> >>>>> When building with make, please refer to guide:
> >>>>> http://patches.dpdk.org/patch/62820/
> >>>>>
> >>>>> When building with meson, requires series:
> >>>>> http://patches.dpdk.org/cover/68534/
> >>>>>
> >>>>> [1] https://mails.dpdk.org/archives/dev/2020-April/162673.html
> >>>>> [2] https://mails.dpdk.org/archives/dev/2020-April/163846.html
> >>>>>
> >>>>>
> >>>>> Ruifeng Wang (3):
> >>>>>   arch/arm: add vcopyq intrinsic for aarch32
> >>>>>   net/ixgbe: add support for aarch32
> >>>>>   net/ixgbe: fix include of vector header file
> >>>>>
> >>>>
> >>>> Not directly related to this patch but since you are fixing aarch32
> >>>> compilation, I am getting following -Wcast-align warnings [1] while
> >>>> cross
> >> building with:
> >>>> arm-linux-gcc.br_real (Buildroot 2020.02-00011-g7ea8a52) 9.3.0
> >>>>
> >>> I got the same warnings with arm-linux-gnueabihf-gcc. The warnings
> >> spread in many different files.
> >>> It is because armv7a/aarch32 puts strict align requirement.
> >>> We can first make it compile. And clean up such warnings in next step?
> >>
> >> Sure.
> >>
> >> I thought it would break the build, aren't we using -Werror for the target?
> > Currently, "RTE_DEVEL_BUILD=n" is needed for armv7 build.
> > http://patches.dpdk.org/patch/62820/
> 
> May be not.
> 
> I did able to build without "RTE_DEVEL_BUILD=n", while checking how :),
> found that "CONFIG_RTE_ARCH_STRICT_ALIGN=y" set in the armv7a config
> (defconfig_arm-armv7a-linux-gcc), seems explicitly added for these '-Wcast-
> align' warnings.
> 
> Overall to the point of the discussion, since this way or that, build is not
> broken with cast-align warnings, I am OK to fix them later gradually.
> 
> A side note is, I wonder if these 'RTE_DEVEL_BUILD' or
> 'CONFIG_RTE_ARCH_STRICT_ALIGN' reflected to the meson build, taking
> into account that make build is going away on 20.11, will we able to keep
> these functionalities in meson.
> 
Yes. There is a patch to enable meson build for armv7, and 'CONFIG_RTE_ARCH_STRICT_ALIGN' is added.
http://patches.dpdk.org/patch/69539/
Meson also provides option to set "werror".
The functionalities can be kept.
> >
> >>
> >>>
> >>>>
> >>>> [1]
> >>>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c: In function
> ‘vfio_mp_primary’:
> >>>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:31:28: warning: cast
> >>>> increases required alignment of target type [-Wcast-align]
> >>>>    31 |  struct vfio_mp_param *r = (struct vfio_mp_param
> *)reply.param;
> >>>>       |                            ^
> >>>> .../lib/librte_eal/linux/eal_vfio_mp_sync.c:33:3: warning: cast
> >>>> increases required alignment of target type [-Wcast-align]
> >>>>    33 |   (const struct vfio_mp_param *)msg->param;
> >>>>       |   ^
> >>>> .../lib/librte_eal/linux/eal_vfio.c: In function ‘vfio_open_group_fd’:
> >>>> .../lib/librte_eal/linux/eal_vfio.c:269:28: warning: cast increases
> >>>> required alignment of target type [-Wcast-align]
> >>>>   269 |  struct vfio_mp_param *p = (struct vfio_mp_param
> >> *)mp_req.param;
> >>>>       |                            ^
> >>>> .../lib/librte_eal/linux/eal_vfio.c:316:7: warning: cast increases
> >>>> required alignment of target type [-Wcast-align]
> >>>>   316 |   p = (struct vfio_mp_param *)mp_rep->param;
> >>>>       |       ^
> >>>>   CC eal_common_class.o
> >>>> .../lib/librte_eal/linux/eal_vfio.c: In function
> >> ‘vfio_sync_default_container’:
> >>>> .../lib/librte_eal/linux/eal_vfio.c:627:28: warning: cast increases
> >>>> required alignment of target type [-Wcast-align]
> >>>>   627 |  struct vfio_mp_param *p = (struct vfio_mp_param
> >> *)mp_req.param;
> >>>>       |                            ^
> >>>> .../lib/librte_eal/linux/eal_vfio.c:652:7: warning: cast increases
> >>>> required alignment of target type [-Wcast-align]
> >>>>   652 |   p = (struct vfio_mp_param *)mp_rep->param;
> >>>>       |       ^
> >>>> .../lib/librte_eal/linux/eal_vfio.c: In function
> >> ‘vfio_get_default_container_fd’:
> >>>> .../lib/librte_eal/linux/eal_vfio.c:1094:28: warning: cast
> >>>> increases required alignment of target type [-Wcast-align]
> >>>>  1094 |  struct vfio_mp_param *p = (struct vfio_mp_param
> >> *)mp_req.param;
> >>>>       |                            ^
> >>>> .../lib/librte_eal/linux/eal_vfio.c:1116:7: warning: cast increases
> >>>> required alignment of target type [-Wcast-align]
> >>>>  1116 |   p = (struct vfio_mp_param *)mp_rep->param;
> >>>>       |       ^
> >>>>   CC eal_common_bus.o
> >>>> .../lib/librte_eal/linux/eal_vfio.c: In function
> ‘rte_vfio_get_container_fd’:
> >>>> .../lib/librte_eal/linux/eal_vfio.c:1202:28: warning: cast
> >>>> increases required alignment of target type [-Wcast-align]
> >>>>  1202 |  struct vfio_mp_param *p = (struct vfio_mp_param
> >> *)mp_req.param;
> >>>>       |                            ^
> >>>> .../lib/librte_eal/linux/eal_vfio.c:1248:7: warning: cast increases
> >>>> required alignment of target type [-Wcast-align]
> >>>>  1248 |   p = (struct vfio_mp_param *)mp_rep->param;
> >>>>       |       ^
> >