diff mbox series

[ovs-dev] sparse: Fix build with DPDK and GCC 12.

Message ID 20230201165346.2307641-1-david.marchand@redhat.com
State Changes Requested
Headers show
Series [ovs-dev] sparse: Fix build with DPDK and GCC 12. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

David Marchand Feb. 1, 2023, 4:53 p.m. UTC
rte_vect.h pulls some AVX512 instrinsics headers added in GCC 12 [1]
trigger a lot of warnings:

libtool: compile:  env "REAL_CC=ccache gcc" "CHECK=sparse -Wsparse-error
	-I ../include/sparse -I ../include -m64 -I /usr/local/include
	" cgcc -target=x86_64 -target=host_os_specs -D__MMX__=1
	-D__MMX_WITH_SSE__=1 -D__SSE2_MATH__=1 -D__SSE_MATH__=1
	-D__SSE__=1 -D__SSE2__=1 -DHAVE_CONFIG_H -I. -I.. -I ../include
	-I ./include -I ../lib -I ./lib -Wstrict-prototypes -Wall
	-Wextra -Wno-sign-compare -Wpointer-arith -Wformat
	-Wformat-security -Wswitch-enum -Wunused-parameter
	-Wbad-function-cast -Wcast-align -Wstrict-prototypes
	-Wold-style-definition -Wmissing-prototypes
	-Wmissing-field-initializers -fno-strict-aliasing
	-Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument
	-Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow
	-Wmultistatement-macros -Wcast-align=strict -mssse3
	-I/home/dmarchan/git/pub/dpdk.org/22.11/install/include
	-include rte_config.h -I/usr/local/include -Werror
	-D_FILE_OFFSET_BITS=64 -g -O2 -MT lib/bfd.lo -MD -MP
	-MF lib/.deps/bfd.Tpo -c ../lib/bfd.c -o lib/bfd.o
../lib/bfd.c: note: in included file (through
	/usr/lib/gcc/x86_64-redhat-linux/12//include/immintrin.h,
	/usr/lib/gcc/x86_64-redhat-linux/12//include/x86intrin.h, ...):
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:9:
	error: '_Float16' has implicit type
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
	error: Expected ; at end of declaration
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
	error: got __v8hf
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
	error: Expected ; at end of statement
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
	error: got {
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
	error: Expected ) in expression
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
	error: got __A
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
	error: Expected ) in function call
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
	error: got __A
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
	error: Expected ) in function call
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
	error: got __A
/usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2328:50:
	error: Expected ) in function call
[...]

Besides, the list of headers by rte_memcpy.h is now out of sync with DPDK.
OVS should not have to care about this in any case: OVS takes care to
include the right headers in its sources, and DPDK now checks that its
exported headers are self-sufficient.

There should be no side effect in removing those headers inclusions from
the rte_memcpy.h fake header.

1: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a68412117fa4

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 include/sparse/rte_memcpy.h | 6 ------
 1 file changed, 6 deletions(-)

Comments

David Marchand Feb. 2, 2023, 9:21 a.m. UTC | #1
On Wed, Feb 1, 2023 at 5:54 PM David Marchand <david.marchand@redhat.com> wrote:
>
> rte_vect.h pulls some AVX512 instrinsics headers added in GCC 12 [1]
> trigger a lot of warnings:
>
> libtool: compile:  env "REAL_CC=ccache gcc" "CHECK=sparse -Wsparse-error
>         -I ../include/sparse -I ../include -m64 -I /usr/local/include
>         " cgcc -target=x86_64 -target=host_os_specs -D__MMX__=1
>         -D__MMX_WITH_SSE__=1 -D__SSE2_MATH__=1 -D__SSE_MATH__=1
>         -D__SSE__=1 -D__SSE2__=1 -DHAVE_CONFIG_H -I. -I.. -I ../include
>         -I ./include -I ../lib -I ./lib -Wstrict-prototypes -Wall
>         -Wextra -Wno-sign-compare -Wpointer-arith -Wformat
>         -Wformat-security -Wswitch-enum -Wunused-parameter
>         -Wbad-function-cast -Wcast-align -Wstrict-prototypes
>         -Wold-style-definition -Wmissing-prototypes
>         -Wmissing-field-initializers -fno-strict-aliasing
>         -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument
>         -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow
>         -Wmultistatement-macros -Wcast-align=strict -mssse3
>         -I/home/dmarchan/git/pub/dpdk.org/22.11/install/include
>         -include rte_config.h -I/usr/local/include -Werror
>         -D_FILE_OFFSET_BITS=64 -g -O2 -MT lib/bfd.lo -MD -MP
>         -MF lib/.deps/bfd.Tpo -c ../lib/bfd.c -o lib/bfd.o
> ../lib/bfd.c: note: in included file (through
>         /usr/lib/gcc/x86_64-redhat-linux/12//include/immintrin.h,
>         /usr/lib/gcc/x86_64-redhat-linux/12//include/x86intrin.h, ...):
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:9:
>         error: '_Float16' has implicit type
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
>         error: Expected ; at end of declaration
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
>         error: got __v8hf
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
>         error: Expected ; at end of statement
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
>         error: got {
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
>         error: Expected ) in expression
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
>         error: got __A
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
>         error: Expected ) in function call
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
>         error: got __A
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
>         error: Expected ) in function call
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
>         error: got __A
> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2328:50:
>         error: Expected ) in function call
> [...]
>
> Besides, the list of headers by rte_memcpy.h is now out of sync with DPDK.
> OVS should not have to care about this in any case: OVS takes care to
> include the right headers in its sources, and DPDK now checks that its
> exported headers are self-sufficient.
>

"La nuit porte conseil", and this argument of mine is probably wrong:
some DPDK headers may rely on rte_memcpy.h includes.
I still think it is worth removing those includes.


> There should be no side effect in removing those headers inclusions from
> the rte_memcpy.h fake header.
>
> 1: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a68412117fa4

I looked a bit more, and it seems that sparse is, at least partially,
at fault here.
The _Float16 type support is missing in sparse.
Ilya Maximets Feb. 3, 2023, 3:13 p.m. UTC | #2
On 2/2/23 10:21, David Marchand wrote:
> On Wed, Feb 1, 2023 at 5:54 PM David Marchand <david.marchand@redhat.com> wrote:
>>
>> rte_vect.h pulls some AVX512 instrinsics headers added in GCC 12 [1]
>> trigger a lot of warnings:
>>
>> libtool: compile:  env "REAL_CC=ccache gcc" "CHECK=sparse -Wsparse-error
>>         -I ../include/sparse -I ../include -m64 -I /usr/local/include
>>         " cgcc -target=x86_64 -target=host_os_specs -D__MMX__=1
>>         -D__MMX_WITH_SSE__=1 -D__SSE2_MATH__=1 -D__SSE_MATH__=1
>>         -D__SSE__=1 -D__SSE2__=1 -DHAVE_CONFIG_H -I. -I.. -I ../include
>>         -I ./include -I ../lib -I ./lib -Wstrict-prototypes -Wall
>>         -Wextra -Wno-sign-compare -Wpointer-arith -Wformat
>>         -Wformat-security -Wswitch-enum -Wunused-parameter
>>         -Wbad-function-cast -Wcast-align -Wstrict-prototypes
>>         -Wold-style-definition -Wmissing-prototypes
>>         -Wmissing-field-initializers -fno-strict-aliasing
>>         -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument
>>         -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow
>>         -Wmultistatement-macros -Wcast-align=strict -mssse3
>>         -I/home/dmarchan/git/pub/dpdk.org/22.11/install/include
>>         -include rte_config.h -I/usr/local/include -Werror
>>         -D_FILE_OFFSET_BITS=64 -g -O2 -MT lib/bfd.lo -MD -MP
>>         -MF lib/.deps/bfd.Tpo -c ../lib/bfd.c -o lib/bfd.o
>> ../lib/bfd.c: note: in included file (through
>>         /usr/lib/gcc/x86_64-redhat-linux/12//include/immintrin.h,
>>         /usr/lib/gcc/x86_64-redhat-linux/12//include/x86intrin.h, ...):
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:9:
>>         error: '_Float16' has implicit type
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
>>         error: Expected ; at end of declaration
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
>>         error: got __v8hf
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
>>         error: Expected ; at end of statement
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
>>         error: got {
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
>>         error: Expected ) in expression
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
>>         error: got __A
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
>>         error: Expected ) in function call
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
>>         error: got __A
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
>>         error: Expected ) in function call
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
>>         error: got __A
>> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2328:50:
>>         error: Expected ) in function call
>> [...]
>>
>> Besides, the list of headers by rte_memcpy.h is now out of sync with DPDK.
>> OVS should not have to care about this in any case: OVS takes care to
>> include the right headers in its sources, and DPDK now checks that its
>> exported headers are self-sufficient.
>>
> 
> "La nuit porte conseil", and this argument of mine is probably wrong:
> some DPDK headers may rely on rte_memcpy.h includes.
> I still think it is worth removing those includes.

Should we keep the stdint and add stddef, so this header is self-sufficient?
It is using uint8_t and size_t.

> 
> 
>> There should be no side effect in removing those headers inclusions from
>> the rte_memcpy.h fake header.
>>
>> 1: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=a68412117fa4
> 
> I looked a bit more, and it seems that sparse is, at least partially,
> at fault here.
> The _Float16 type support is missing in sparse.
> 
>
David Marchand Feb. 6, 2023, 9:29 a.m. UTC | #3
On Fri, Feb 3, 2023 at 4:13 PM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> On 2/2/23 10:21, David Marchand wrote:
> > On Wed, Feb 1, 2023 at 5:54 PM David Marchand <david.marchand@redhat.com> wrote:
> >>
> >> rte_vect.h pulls some AVX512 instrinsics headers added in GCC 12 [1]
> >> trigger a lot of warnings:
> >>
> >> libtool: compile:  env "REAL_CC=ccache gcc" "CHECK=sparse -Wsparse-error
> >>         -I ../include/sparse -I ../include -m64 -I /usr/local/include
> >>         " cgcc -target=x86_64 -target=host_os_specs -D__MMX__=1
> >>         -D__MMX_WITH_SSE__=1 -D__SSE2_MATH__=1 -D__SSE_MATH__=1
> >>         -D__SSE__=1 -D__SSE2__=1 -DHAVE_CONFIG_H -I. -I.. -I ../include
> >>         -I ./include -I ../lib -I ./lib -Wstrict-prototypes -Wall
> >>         -Wextra -Wno-sign-compare -Wpointer-arith -Wformat
> >>         -Wformat-security -Wswitch-enum -Wunused-parameter
> >>         -Wbad-function-cast -Wcast-align -Wstrict-prototypes
> >>         -Wold-style-definition -Wmissing-prototypes
> >>         -Wmissing-field-initializers -fno-strict-aliasing
> >>         -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-argument
> >>         -Wbool-compare -Wshift-negative-value -Wduplicated-cond -Wshadow
> >>         -Wmultistatement-macros -Wcast-align=strict -mssse3
> >>         -I/home/dmarchan/git/pub/dpdk.org/22.11/install/include
> >>         -include rte_config.h -I/usr/local/include -Werror
> >>         -D_FILE_OFFSET_BITS=64 -g -O2 -MT lib/bfd.lo -MD -MP
> >>         -MF lib/.deps/bfd.Tpo -c ../lib/bfd.c -o lib/bfd.o
> >> ../lib/bfd.c: note: in included file (through
> >>         /usr/lib/gcc/x86_64-redhat-linux/12//include/immintrin.h,
> >>         /usr/lib/gcc/x86_64-redhat-linux/12//include/x86intrin.h, ...):
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:9:
> >>         error: '_Float16' has implicit type
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
> >>         error: Expected ; at end of declaration
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:38:18:
> >>         error: got __v8hf
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
> >>         error: Expected ; at end of statement
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:62:41:
> >>         error: got {
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
> >>         error: Expected ) in expression
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:420:32:
> >>         error: got __A
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
> >>         error: Expected ) in function call
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2271:61:
> >>         error: got __A
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
> >>         error: Expected ) in function call
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2279:61:
> >>         error: got __A
> >> /usr/lib/gcc/x86_64-redhat-linux/12//include/avx512fp16intrin.h:2328:50:
> >>         error: Expected ) in function call
> >> [...]
> >>
> >> Besides, the list of headers by rte_memcpy.h is now out of sync with DPDK.
> >> OVS should not have to care about this in any case: OVS takes care to
> >> include the right headers in its sources, and DPDK now checks that its
> >> exported headers are self-sufficient.
> >>
> >
> > "La nuit porte conseil", and this argument of mine is probably wrong:
> > some DPDK headers may rely on rte_memcpy.h includes.
> > I still think it is worth removing those includes.
>
> Should we keep the stdint and add stddef, so this header is self-sufficient?
> It is using uint8_t and size_t.

Ack.
diff mbox series

Patch

diff --git a/include/sparse/rte_memcpy.h b/include/sparse/rte_memcpy.h
index 5cd3f013ea..6ecc28ae19 100644
--- a/include/sparse/rte_memcpy.h
+++ b/include/sparse/rte_memcpy.h
@@ -20,12 +20,6 @@ 
 #error "Use this header only with sparse.  It is not a correct implementation."
 #endif
 
-/* Include the same headers as the real rte_memcpy(). */
-#include <stdio.h>
-#include <stdint.h>
-#include <string.h>
-#include <rte_vect.h>
-
 /* Declare the same functions as the real rte_memcpy.h, without defining them.
  * This gives sparse the information it needs without provoking sparse's
  * complaints about the implementations. */