History log of /dpdk/lib/eal/include/rte_malloc.h (Results 1 – 8 of 8)
Revision Date Author Comments
# 80da7efb 08-Oct-2024 Stephen Hemminger <stephen@networkplumber.org>

eal: annotate allocation functions

The allocation functions take a alignment argument that
can be useful to hint the compiler optimizer.
This is supported by GCC and Clang but only useful with GCC
b

eal: annotate allocation functions

The allocation functions take a alignment argument that
can be useful to hint the compiler optimizer.
This is supported by GCC and Clang but only useful with GCC
because Clang gives warning if alignment is 0.

Newer versions of GCC have a malloc attribute that can be used to find
mismatches between allocation and free; the typical problem caught is a
pointer allocated with rte_malloc() that is then incorrectly freed using
free().
The name of the DPDK wrapper macros for these attributes are chosen to
be similar to what GLIBC is using in cdefs.h.

Note: The rte_free function prototype was moved ahead of the allocation
functions since the dealloc attribute now refers to it.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>

show more ...


# ae539d90 18-Jun-2024 Stephen Hemminger <stephen@networkplumber.org>

malloc: document that type is for tracing

The string type is only used for tracing and not used as
documented by dump_stats.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>


# 1094dd94 28-Oct-2022 David Marchand <david.marchand@redhat.com>

cleanup compat header inclusions

With symbols going though experimental/stable stages, we accumulated
a lot of discrepancies about inclusion of the rte_compat.h header.

Some headers are including i

cleanup compat header inclusions

With symbols going though experimental/stable stages, we accumulated
a lot of discrepancies about inclusion of the rte_compat.h header.

Some headers are including it where unneeded, while others rely on
implicit inclusion.

Fix unneeded inclusions:
$ git grep -l include..rte_compat.h |
xargs grep -LE '__rte_(internal|experimental)' |
xargs sed -i -e '/#include..rte_compat.h/d'

Fix missing inclusion, by inserting rte_compat.h before the first
inclusion of a DPDK header:
$ git grep -lE '__rte_(internal|experimental)' |
xargs grep -L include..rte_compat.h |
xargs sed -i -e \
'0,/#include..\(rte_\|.*pmd.h.$\)/{
s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
}'

Fix missing inclusion, by inserting rte_compat.h after the last
inclusion of a non DPDK header:
$ for file in $(git grep -lE '__rte_(internal|experimental)' |
xargs grep -L include..rte_compat.h); do
tac $file > $file.$$
sed -i -e \
'0,/#include../{
s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
}' $file.$$
tac $file.$$ > $file
rm $file.$$
done

Fix missing inclusion, by inserting rte_compat.h after the header guard:
$ git grep -lE '__rte_(internal|experimental)' |
xargs grep -L include..rte_compat.h |
xargs sed -i -e \
'0,/#define/{
s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
}'

And finally, exclude rte_compat.h itself.
$ git checkout lib/eal/include/rte_compat.h

At the end of all this, we have a clean tree:
$ git grep -lE '__rte_(internal|experimental)' |
xargs grep -L include..rte_compat.h
buildtools/check-symbols.sh
devtools/checkpatches.sh
doc/guides/contributing/abi_policy.rst
doc/guides/rel_notes/release_20_11.rst
lib/eal/include/rte_compat.h

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

show more ...


# 6277523c 27-Sep-2022 David Marchand <david.marchand@redhat.com>

malloc: remove unused function to set limit

This function was never implemented and has been deprecated for a long
time. We can remove it.

Signed-off-by: David Marchand <david.marchand@redhat.com>


# 7be78d02 29-Nov-2021 Josh Soref <jsoref@gmail.com>

fix spelling in comments and strings

The tool comes from https://github.com/jsoref

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>


# 437cb6e8 10-Sep-2021 Anatoly Burakov <anatoly.burakov@intel.com>

malloc: promote some experimental API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: R

malloc: promote some experimental API to stable

As per ABI policy, move the formerly experimental API's to the stable
section.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>

show more ...


# 2ca92f54 10-Jun-2021 David Marchand <david.marchand@redhat.com>

malloc: fix size annotation for NUMA-aware realloc

__rte_alloc_size is mapped to compiler alloc_size attribute.

Quoting gcc documentation:
"""
alloc_size
The alloc_size attribute is used to tel

malloc: fix size annotation for NUMA-aware realloc

__rte_alloc_size is mapped to compiler alloc_size attribute.

Quoting gcc documentation:
"""
alloc_size
The alloc_size attribute is used to tell the compiler that the
function return value points to memory, where the size is given by
one or two of the functions parameters. GCC uses this information
to improve the correctness of __builtin_object_size.

The function parameter(s) denoting the allocated size are specified
by one or two integer arguments supplied to the attribute.
The allocated size is either the value of the single function
argument specified or the product of the two function arguments
specified. Argument numbering starts at one.
"""

In rte_realloc_socket case, only 'size' matters.

Note: this has been spotted by Maxime trying to use rte_realloc_socket
and compiling with gcc 11.

Fixes: 17b347dab769 ("malloc: add alloc_size attribute to functions")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>

show more ...


# 99a2dd95 20-Apr-2021 Bruce Richardson <bruce.richardson@intel.com>

lib: remove librte_ prefix from directory names

There is no reason for the DPDK libraries to all have 'librte_' prefix on
the directory names. This prefix makes the directory names longer and also
m

lib: remove librte_ prefix from directory names

There is no reason for the DPDK libraries to all have 'librte_' prefix on
the directory names. This prefix makes the directory names longer and also
makes it awkward to add features referring to individual libraries in the
build - should the lib names be specified with or without the prefix.
Therefore, we can just remove the library prefix and use the library's
unique name as the directory name, i.e. 'eal' rather than 'librte_eal'

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

show more ...