> Recent versions of GCC have some additional function attributes that can > help with DPDK performance and stability. > > The alloc_align attribute tells the compiler what the alignment > of the allocation will be, and the optimizer can use this to produce > better code (especially memcpy and structure copies). > > The malloc attribute tells compiler that object is not overlapping > and potentially aliasing. It also as an additional variant in GCC 11 > or later that allows for detecting all sorts of common errors like > calling free() on memory allocated with rte_malloc(). > > In order to use the malloc attribute the free function prototype > needs to be moved before the allocator/create function prototype > so that the malloc attribute can refer to it. > > This uncovered at least 16 pre-existing bugs in DPDK, these > should go to stable. This patch set is structured with: > - fix any new warnings that were discovered > - add macros for enable the macros > - enable the attributes > > The same attributes could be added to lots more functions in DPDK, > but this patch set focuses on the key ones, and where problems > exist in current code base. > > v9 - correct the event/cnxk patch > > Stephen Hemminger (17): > memzone: fix use after free in tracing > cryptodev/bcmfs: fix mis-matched free > dma/ixd: fix incorrect free function in cleanup > event/cnxk: fix free of non-heap in cleanup code > examples/vhost: fix free function mismatch > net/cnxk: fix use-after-free > bpf: fix free mismatch if convert fails > net/e1000: fix use-after-free > net/sfc: fix use-after-free warning messages > net/cpfl: fix free of nonheap object > net/nfp: fix duplicate call to rte_free > raw/ifpga/base: fix use after free > common/qat: fix use after free > drivers/ifpga: fix free function mismatch > baseband/la12xx: prevent use after free > common/idpf: fix use after free due > eal: add function attributes for allocation functions > > doc/guides/rel_notes/release_24_11.rst | 8 +++ > drivers/baseband/la12xx/bbdev_la12xx.c | 1 + > drivers/common/idpf/base/idpf_osdep.h | 10 +++- > drivers/common/idpf/idpf_common_device.c | 3 +- > drivers/common/qat/qat_device.c | 6 +-- > drivers/crypto/bcmfs/bcmfs_device.c | 4 +- > drivers/dma/idxd/idxd_pci.c | 2 +- > drivers/event/cnxk/cnxk_eventdev.c | 2 +- > drivers/net/cnxk/cnxk_ethdev_sec.c | 2 +- > drivers/net/cpfl/cpfl_flow_parser.c | 1 - > drivers/net/e1000/igb_ethdev.c | 4 +- > drivers/net/nfp/flower/nfp_flower_flow.c | 1 - > drivers/net/sfc/sfc_flow_rss.c | 4 +- > drivers/net/sfc/sfc_mae.c | 23 ++++----- > drivers/raw/ifpga/base/opae_intel_max10.c | 11 ++++- > drivers/raw/ifpga/ifpga_rawdev.c | 8 +-- > examples/vhost_blk/vhost_blk.c | 2 +- > lib/bpf/bpf_convert.c | 2 +- > lib/eal/common/eal_common_memzone.c | 3 +- > lib/eal/include/rte_common.h | 34 +++++++++++++ > lib/eal/include/rte_malloc.h | 59 ++++++++++++++--------- > 21 files changed, 124 insertions(+), 66 deletions(-) >
Series-Acked-by: Konstantin Ananyev <konstantin.anan...@huawei.com> > -- > 2.45.2