On 5/11/22 11:18, Eelco Chaudron wrote:
> Hi William,
> 
> I was conducting some datapath tests and thought I could quickly include some 
> af_xdp, but I ran into a build error.
> As I’m not using AF_XDP normally, I did not further investigate, but it might 
> be something for you to look at:
> 
>               /bin/sh ./libtool  --tag=CC   --mode=compile gcc 
> -DHAVE_CONFIG_H -I. -I/vagrant/ovs    -I /vagrant/ovs/include -I ./include -I 
> /vagrant/ovs/lib -I ./lib    -mavx512f -mavx512bw -mavx512dq -mbmi -mbmi2 
> -fPIC -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/root/dpdk_build/install/include -include rte_config.h   -Werror -Werror 
> -D_FILE_OFFSET_BITS=64  -g -O2 -msse4.2 -mpopcnt -MT 
> lib/libopenvswitchavx512_la-dpif-netdev-extract-avx512.lo -MD -MP -MF 
> lib/.deps/libopenvswitchavx512_la-dpif-netdev-extract-avx512.Tpo -c -o 
> lib/libopenvswitchavx512_la-dpif-netdev-extract-avx512.lo `test -f 
> 'lib/dpif-netdev-extract-avx512.c' || echo 
> '/vagrant/ovs/'`lib/dpif-netdev-extract-avx512.c
>               libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/vagrant/ovs -I 
> /vagrant/ovs/include -I ./include -I /vagrant/ovs/lib -I ./lib -mavx512f 
> -mavx512bw -mavx512dq -mbmi -mbmi2 -fPIC -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/root/dpdk_build/install/include -include rte_config.h -Werror 
> -Werror -D_FILE_OFFSET_BITS=64 -g -O2 -msse4.2 -mpopcnt -MT 
> lib/libopenvswitchavx512_la-dpif-netdev-extract-avx512.lo -MD -MP -MF 
> lib/.deps/libopenvswitchavx512_la-dpif-netdev-extract-avx512.Tpo -c 
> /vagrant/ovs/lib/dpif-netdev-extract-avx512.c -o 
> lib/libopenvswitchavx512_la-dpif-netdev-extract-avx512.o
>               In file included from 
> /vagrant/ovs/lib/netdev-linux-private.h:30,
>                                from /vagrant/ovs/lib/netdev-afxdp.c:19:
>               In function ‘dp_packet_delete’,
>                   inlined from ‘dp_packet_delete’ at 
> /vagrant/ovs/lib/dp-packet.h:242:1,
>                   inlined from ‘dp_packet_batch_add__’ at 
> /vagrant/ovs/lib/dp-packet.h:773:9,
>                   inlined from ‘dp_packet_batch_add’ at 
> /vagrant/ovs/lib/dp-packet.h:781:5,
>                   inlined from ‘netdev_afxdp_rxq_recv’ at 
> /vagrant/ovs/lib/netdev-afxdp.c:872:9:
>               /vagrant/ovs/lib/dp-packet.h:258:9: error: ‘free’ called on 
> pointer ‘*umem.xpool.array’ with nonzero offset [64, 3458764513820540224] 
> [-Werror=free-nonheap-object]
>                 258 |         free(b);


Hmm.  This free() is from a branch that handles overflow of the batch,
and that is not possible, because netdev_afxdp_rxq_recv() can not
receive more than NETDEV_MAX_BURST packets.  So, it's a false-positive.
What is your compiler version?  Did you add free-nonheap-object
warning or is it enabled by default?

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to