diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2022-12-22 01:06:19 +0100 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2023-01-03 12:39:32 +0100 |
commit | 0d8318db633fb24936a0f55e869331f0c27f243f (patch) | |
tree | 64e4f02a4b3b372201e7df888754ae790bf80a20 /NEWS | |
parent | d83d7c4915f1fc538f52fd05076532b744e389dd (diff) | |
download | openvswitch-0d8318db633fb24936a0f55e869331f0c27f243f.tar.gz |
netdev-afxdp: Disable -Wfree-nonheap-object on receive.
GCC 11+ generates a warning:
In file included from lib/netdev-linux-private.h:30,
from lib/netdev-afxdp.c:19:
In function 'dp_packet_delete',
inlined from 'dp_packet_delete' at lib/dp-packet.h:246:1,
inlined from 'dp_packet_batch_add__' at lib/dp-packet.h:775:9,
inlined from 'dp_packet_batch_add' at lib/dp-packet.h:783:5,
inlined from 'netdev_afxdp_rxq_recv' at lib/netdev-afxdp.c:898:9:
lib/dp-packet.h:260:9: warning: 'free' called on pointer
'*umem.xpool.array' with nonzero offset [8, 2558044588346441168]
[-Wfree-nonheap-object]
260 | free(b);
| ^~~~~~~
But it is a false positive since the code path is not possible.
In this call chain the packet will always have source DPBUF_AFXDP
and the free() will never be called. GCC doesn't see that, because
initialization function dp_packet_use_afxdp() is part of a different
translation unit.
Disabling a warning in this particular place to avoid build failures.
Older versions of clang do not have the -Wfree-nonheap-object, so we
need to additionally guard the pragmas. Clang is using GCC pragmas
and complains about unknown ones.
Reported-at: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108187
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'NEWS')
0 files changed, 0 insertions, 0 deletions