#
4b81c145 |
| 08-Aug-2022 |
Tyler Retzlaff <roretzla@linux.microsoft.com> |
eal: change return type of bsf/fls functions
The function return type is changed to fixed width uint32_t to be consistent with what appears to be the original authors intent. It doesn't make much se
eal: change return type of bsf/fls functions
The function return type is changed to fixed width uint32_t to be consistent with what appears to be the original authors intent. It doesn't make much sense to return signed integers for these functions.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Brørup <mb@smartsharesystems.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
show more ...
|
#
f398ebd7 |
| 22-Sep-2022 |
Morten Brørup <mb@smartsharesystems.com> |
eal: support const pointer in alignment check
Checking a const pointer for alignment would emit a warning about the const qualifier being discarded.
No need to calculate the aligned pointer; just c
eal: support const pointer in alignment check
Checking a const pointer for alignment would emit a warning about the const qualifier being discarded.
No need to calculate the aligned pointer; just check the last bits of the pointer.
Signed-off-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
#
72b452c5 |
| 27-Aug-2022 |
Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> |
eal: remove unneeded includes from a public header
Do not include <ctype.h>, <errno.h>, and <stdlib.h> from <rte_common.h>, because they are not used by this file. Include the needed headers directl
eal: remove unneeded includes from a public header
Do not include <ctype.h>, <errno.h>, and <stdlib.h> from <rte_common.h>, because they are not used by this file. Include the needed headers directly from the files that need them.
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
#
347623c9 |
| 27-Aug-2022 |
Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> |
eal: uninline some string formatting helper
There is no reason for rte_str_to_size() to be inline. Move the implementation out of <rte_common.h>. Export it as a stable ABI because it always has been
eal: uninline some string formatting helper
There is no reason for rte_str_to_size() to be inline. Move the implementation out of <rte_common.h>. Export it as a stable ABI because it always has been public.
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
show more ...
|
#
107dc066 |
| 27-Aug-2022 |
Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> |
eal: deduplicate roundup code
RTE_CACHE_LINE_ROUNDUP() implementation repeated RTE_ALIGN_MUL_CEIL(). In other places RTE_CACHE_LINE_SIZE is assumed to be a power-of-2, so define RTE_CACHE_LINE_ROUND
eal: deduplicate roundup code
RTE_CACHE_LINE_ROUNDUP() implementation repeated RTE_ALIGN_MUL_CEIL(). In other places RTE_CACHE_LINE_SIZE is assumed to be a power-of-2, so define RTE_CACHE_LINE_ROUNDUP() using RTE_ALIGN_CEIL().
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Reviewed-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
show more ...
|
#
1a7374c9 |
| 27-Aug-2022 |
Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> |
eal: fix side effect in some pointer arithmetic macros
RTE_PTR_SUB(ptr, x) and RTE_PTR_ALIGN_FLOOR() worked incorrectly if "ptr" was an expression:
uint32_t arr[3];
RTE_PTR_SUB(arr + 1, si
eal: fix side effect in some pointer arithmetic macros
RTE_PTR_SUB(ptr, x) and RTE_PTR_ALIGN_FLOOR() worked incorrectly if "ptr" was an expression:
uint32_t arr[3];
RTE_PTR_SUB(arr + 1, sizeof(arr[0])); // expected: (uint32_t *)((uintptr_t)(arr + 1) - 4) == arr // actual: (uint32_t *)((uintptr_t) arr + 1 - 4) != arr
RTE_PTR_ALIGN_FLOOR(arr + 2, sizeof(arr[0])); // expected: RTE_ALIGN_FLOOR((uintptr_t)(arr + 2), 4) == &arr[2] // actual: RTE_ALIGN_FLOOR((uintptr_t) arr + 2, 4) == &arr[0]
Fix the macros and extend the relevant unit test. Convert uses of a custom test failure macro to RTE_TEST_ASSERT*().
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> Reviewed-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
show more ...
|
#
00901e4d |
| 25-Feb-2022 |
Luc Pelletier <lucp.at.work@gmail.com> |
eal/x86: fix unaligned access for small memcpy
Calls to rte_memcpy for 1 < n < 16 could result in unaligned loads/stores, which is undefined behaviour according to the C standard, and strict aliasin
eal/x86: fix unaligned access for small memcpy
Calls to rte_memcpy for 1 < n < 16 could result in unaligned loads/stores, which is undefined behaviour according to the C standard, and strict aliasing violations.
The code was changed to use a packed structure that allows aliasing (using the __may_alias__ attribute) to perform the load/store operations. This results in code that has the same performance as the original code and that is also C standards-compliant.
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org
Signed-off-by: Luc Pelletier <lucp.at.work@gmail.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
show more ...
|
#
48ff13ef |
| 05-May-2022 |
David Marchand <david.marchand@redhat.com> |
test/mem: disable ASan when accessing unallocated memory
As described in bugzilla, ASan reports accesses to all memory segment as invalid, since those parts have not been allocated with rte_malloc.
test/mem: disable ASan when accessing unallocated memory
As described in bugzilla, ASan reports accesses to all memory segment as invalid, since those parts have not been allocated with rte_malloc. Move __rte_no_asan to rte_common.h and disable ASan on a part of the test.
Bugzilla ID: 880 Fixes: 6cc51b1293ce ("mem: instrument allocator for ASan") Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
show more ...
|
#
eb13e558 |
| 11-Apr-2022 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
eal: add macro to warn for unused function return values
This patch adds a wrapper macro __rte_warn_unused_result for the warn_unused_result function attribute.
Marking a function __rte_warn_unused
eal: add macro to warn for unused function return values
This patch adds a wrapper macro __rte_warn_unused_result for the warn_unused_result function attribute.
Marking a function __rte_warn_unused_result will make the compiler emit a warning in case the caller does not use the function's return value.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
show more ...
|
#
a0a388a8 |
| 28-Jul-2021 |
Shijith Thotton <sthotton@marvell.com> |
eal: add macro to swap two variables
Add a macro to swap two variables and updat common autotest for the same.
Signed-off-by: Shijith Thotton <sthotton@marvell.com> Acked-by: Jerin Jacob <jerinj@ma
eal: add macro to swap two variables
Add a macro to swap two variables and updat common autotest for the same.
Signed-off-by: Shijith Thotton <sthotton@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
show more ...
|
#
128c22b9 |
| 23-Jul-2021 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: fix argument in 32-bit safe BSF function
The first argument to rte_bsf32_safe was incorrectly declared as a 64 bit value. The code only works on 32 bit values and the underlying function rte_bs
eal: fix argument in 32-bit safe BSF function
The first argument to rte_bsf32_safe was incorrectly declared as a 64 bit value. The code only works on 32 bit values and the underlying function rte_bsf32 only accepts 32 bit values. This was a mistake introduced when the safe version was added and probably cause by copy/paste from the 64 bit version.
The bug passed silently under the radar until some other code was built with -Wall and -Wextra in C++ and C++ complains about the missing cast.
Yes, this is a API signature change, but the original code was wrong. It is an inline so not an ABI change.
Fixes: 4e261f551986 ("eal: add 64-bit bsf and 32-bit safe bsf functions") Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.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 ...
|