| 21cab84f | 24-Jan-2025 |
Tyler Retzlaff <roretzla@linux.microsoft.com> |
bitops: find first set bit
Provide toolchain abstraction for __builtin_ffs{,l,ll} gcc built-in intrinsics. Add associated unit tests.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Si
bitops: find first set bit
Provide toolchain abstraction for __builtin_ffs{,l,ll} gcc built-in intrinsics. Add associated unit tests.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
show more ...
|
| a1b873f1 | 21-Jan-2025 |
Andre Muezerie <andremue@linux.microsoft.com> |
eal: add casting and GCC diagnostics macros
"GCC diagnostic ignored" pragmas have been commonly sprinkled over the code. Clang supports GCC's pragma for compatibility with existing source code, so #
eal: add casting and GCC diagnostics macros
"GCC diagnostic ignored" pragmas have been commonly sprinkled over the code. Clang supports GCC's pragma for compatibility with existing source code, so #pragma GCC diagnostic and #pragma clang diagnostic are synonyms for Clang (https://clang.llvm.org/docs/UsersManual.html).
Now that effort is being made to make the code compatible with MSVC these expressions would become more complex. It makes sense to hide this complexity behind macros. This makes maintenance easier as these macros are defined in a single place. As a plus the code becomes more readable as well.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
show more ...
|
| 4b4ed9cc | 22-Jan-2025 |
Andre Muezerie <andremue@linux.microsoft.com> |
eal: add inlining hints for MSVC
MSVC supports forcing code to be inlined or forcing code to not be inlined, like other compilers. It does not support the "hot" hint though.
This patch fixes existi
eal: add inlining hints for MSVC
MSVC supports forcing code to be inlined or forcing code to not be inlined, like other compilers. It does not support the "hot" hint though.
This patch fixes existing macros __rte_noinline and __rte_always_inline so that they also do what is expected from them when used with MSVC.
__rte_hot is updated to become a noop when MSVC is used.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com> Acked-by: Morten Brørup <mb@smartsharesystems.com>
show more ...
|
| 154303b0 | 10-Jan-2025 |
Andre Muezerie <andremue@linux.microsoft.com> |
eal: deprecate legacy packed attribute
Macro __rte_packed was marked as deprecated and replaced with __rte_packed_begin/__rte_packed_end.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com> |
| fba98755 | 10-Jan-2025 |
Andre Muezerie <andremue@linux.microsoft.com> |
lib: replace packed attributes
MSVC struct packing is not compatible with GCC. Replace macro __rte_packed with __rte_packed_begin to push existing pack value and set packing to 1-byte and macro __rt
lib: replace packed attributes
MSVC struct packing is not compatible with GCC. Replace macro __rte_packed with __rte_packed_begin to push existing pack value and set packing to 1-byte and macro __rte_packed_end to restore the pack value prior to the push.
Macro __rte_packed_end is deliberately utilized to trigger a MSVC compiler warning if no existing packing has been pushed allowing easy identification of locations where the __rte_packed_begin is missing.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
show more ...
|
| 5dc68f2b | 10-Jan-2025 |
Andre Muezerie <andremue@linux.microsoft.com> |
eal: remove some packed attributes
Removed the packed attributes from some structures that don't need them.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com> |
| fac4bc0d | 10-Jan-2025 |
Andre Muezerie <andremue@linux.microsoft.com> |
eal: add packing macros for MSVC
MSVC struct packing is not compatible with GCC. Add macro __rte_packed_begin which can be used to push existing pack value and set packing to 1-byte. Add macro __rte
eal: add packing macros for MSVC
MSVC struct packing is not compatible with GCC. Add macro __rte_packed_begin which can be used to push existing pack value and set packing to 1-byte. Add macro __rte_packed_end to restore the pack value prior to the push.
Macro __rte_packed_end is deliberately utilized to trigger a MSVC compiler warning if no existing packing has been pushed allowing easy identification of locations where the __rte_packed_begin is missing.
Ensure __rte_packed_begin and __rte_packed_end show up in pairs when checking patches.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
show more ...
|
| 37dda90e | 14-Nov-2024 |
Thomas Monjalon <thomas@monjalon.net> |
eal: fix lcore variables documentation
The lcore variables API is new in DPDK 24.11, that's why the function rte_lcore_var_alloc() was marked experimental. To be clearer, the whole header file (incl
eal: fix lcore variables documentation
The lcore variables API is new in DPDK 24.11, that's why the function rte_lcore_var_alloc() was marked experimental. To be clearer, the whole header file (including all macros) is marked experimental.
A change decreased the default buffer size from 1 MB to 128 kB, missing to update the documentation, which is fixed here.
Fixes: 5bce9bed67ad ("eal: add static per-lcore memory allocation facility") Fixes: f2fd6c2e080c ("config: limit lcore variable maximum size to 128k")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
show more ...
|
| bf7ded9a | 25-Oct-2024 |
Morten Brørup <mb@smartsharesystems.com> |
eal: add unreachable and precondition hints
Added two new compiler/optimizer hints: * The __rte_unreachable hint for use in points in code known never to be reached. * The __rte_assume hint for prov
eal: add unreachable and precondition hints
Added two new compiler/optimizer hints: * The __rte_unreachable hint for use in points in code known never to be reached. * The __rte_assume hint for providing information about preconditions the compiler/optimizer might be unable to figure out by itself.
Signed-off-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
| 776d4753 | 25-Oct-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
doc: add lcore variables guide
Add lcore variables programmer's guide. This guide gives both an overview of the API, its implementation, and alternatives to the use of lcore variables for maintainin
doc: add lcore variables guide
Add lcore variables programmer's guide. This guide gives both an overview of the API, its implementation, and alternatives to the use of lcore variables for maintaining per-lcore id data.
It has pictures, too.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Reviewed-by: Luka Jankovic <luka.jankovic@ericsson.com>
show more ...
|
| 5bce9bed | 25-Oct-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
eal: add static per-lcore memory allocation facility
Introduce DPDK per-lcore id variables, or lcore variables for short.
An lcore variable has one value for every current and future lcore id-equip
eal: add static per-lcore memory allocation facility
Introduce DPDK per-lcore id variables, or lcore variables for short.
An lcore variable has one value for every current and future lcore id-equipped thread.
The primary <rte_lcore_var.h> use case is for statically allocating small, frequently-accessed data structures, for which one instance should exist for each lcore.
Lcore variables are similar to thread-local storage (TLS, e.g., C11 _Thread_local), but decoupling the values' life time with that of the threads.
Lcore variables are also similar in terms of functionality provided by FreeBSD kernel's DPCPU_*() family of macros and the associated build-time machinery. DPCPU uses linker scripts, which effectively prevents the reuse of its, otherwise seemingly viable, approach.
The currently-prevailing way to solve the same problem as lcore variables is to keep a module's per-lcore data as RTE_MAX_LCORE-sized array of cache-aligned, RTE_CACHE_GUARDed structs. The benefit of lcore variables over this approach is that data related to the same lcore now is close (spatially, in memory), rather than data used by the same module, which in turn avoid excessive use of padding, polluting caches with unused data.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
show more ...
|
| 40e6cf97 | 04-Sep-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: promote memzone segments configuration API as stable
These were added in 23.03.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Brørup <mb@smartsharesystems.com>
eal: promote memzone segments configuration API as stable
These were added in 23.03.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: David Marchand <david.marchand@redhat.com>
show more ...
|
| 9625d8db | 04-Sep-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: promote applications lcore usage API as stable
This API was added back in 23.03, can be marked stable now.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Brørup
eal: promote applications lcore usage API as stable
This API was added back in 23.03, can be marked stable now.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Robin Jarry <rjarry@redhat.com> Acked-by: David Marchand <david.marchand@redhat.com>
show more ...
|
| 86a308ff | 04-Sep-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: promote more power intrinsics API as stable
This API was added in 20.11, after four years it should be stable.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Br
eal: promote more power intrinsics API as stable
This API was added in 20.11, after four years it should be stable.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: David Marchand <david.marchand@redhat.com>
show more ...
|
| a3e126fd | 15-Oct-2024 |
David Marchand <david.marchand@redhat.com> |
bitset: fix build for GCC without experimental API
For a reason similar to the change on bitops header, hide bitset implementation relying on experimental API.
Fixes: 99a1197647d8 ("eal: add bitset
bitset: fix build for GCC without experimental API
For a reason similar to the change on bitops header, hide bitset implementation relying on experimental API.
Fixes: 99a1197647d8 ("eal: add bitset type")
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
show more ...
|
| 5f3cd043 | 16-Oct-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
bitset: fix build with MSVC
Replace the use of __builtin_ffsll() with rte_bsf64() to be MSVC compatible.
Fixes: 99a1197647d8 ("eal: add bitset type")
Suggested-by: David Marchand <david.marchand@r
bitset: fix build with MSVC
Replace the use of __builtin_ffsll() with rte_bsf64() to be MSVC compatible.
Fixes: 99a1197647d8 ("eal: add bitset type")
Suggested-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
show more ...
|
| 8b65ddc0 | 15-Oct-2024 |
David Marchand <david.marchand@redhat.com> |
bitops: fix build for GCC without experimental API
Building OVS against current DPDK fails with following warnings:
In file included from .../ovs/dpdk-dir/include/rte_memory.h:18,
bitops: fix build for GCC without experimental API
Building OVS against current DPDK fails with following warnings:
In file included from .../ovs/dpdk-dir/include/rte_memory.h:18, from .../ovs/dpdk-dir/include/rte_ring_core.h:29, from .../ovs/dpdk-dir/include/rte_ring.h:37, from .../ovs/dpdk-dir/include/rte_mempool.h:49, from .../ovs/dpdk-dir/include/rte_mbuf.h:38, from lib/dp-packet.h:25, from lib/ofp-packet.c:20: .../ovs/dpdk-dir/include/rte_bitops.h: In function ‘__rte_bit_assign32’: .../ovs/dpdk-dir/include/rte_bitops.h:528:1: error: ‘__rte_bit_set32’ is deprecated: Symbol is not yet part of stable ABI [-Werror=deprecated-declarations] ...
This comes from the fact that some (experimental) inline helpers are calling other experimental API. Hide those calls.
Fixes: 471de107ae23 ("bitops: add new bit manipulation API")
Reported-by: Kevin Traynor <ktraynor@redhat.com> Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Morten Brørup <mb@smartsharesystems.com>
show more ...
|
| c889c037 | 09-Aug-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
bitset: add atomic functions
Extend the bitset API with atomic versions of the most basic bitset operations.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Tyler Retzlaff
bitset: add atomic functions
Extend the bitset API with atomic versions of the most basic bitset operations.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
show more ...
|
| 99a11976 | 09-Aug-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
eal: add bitset type
Introduce a set of functions and macros that operate on sets of bits, kept in arrays of 64-bit words.
RTE bitset is designed for bitsets which are larger than what fits in a si
eal: add bitset type
Introduce a set of functions and macros that operate on sets of bits, kept in arrays of 64-bit words.
RTE bitset is designed for bitsets which are larger than what fits in a single machine word (i.e., 64 bits). For very large bitsets, the <rte_bitmap.h> API may be a more appropriate choice.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
show more ...
|
| 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 ...
|
| 5ff00bbc | 05-Sep-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
ipc: increase file descriptor maximum number
The TAP and XDP driver both are limited to only 8 queues because of the small limit imposed by EAL. Increase the limit now, since this release allows cha
ipc: increase file descriptor maximum number
The TAP and XDP driver both are limited to only 8 queues because of the small limit imposed by EAL. Increase the limit now, since this release allows changing ABI.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
show more ...
|
| 0883d736 | 20-Sep-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
bitops: support volatile pointers in new API
Have rte_bit_[test|set|clear|assign|flip]() and rte_bit_atomic_*() handle volatile-marked pointers.
Bugzilla ID: 1385
Signed-off-by: Mattias Rönnblom <
bitops: support volatile pointers in new API
Have rte_bit_[test|set|clear|assign|flip]() and rte_bit_atomic_*() handle volatile-marked pointers.
Bugzilla ID: 1385
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
show more ...
|
| 35326b61 | 20-Sep-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
bitops: add atomic bit operations in new API
Add atomic bit test/set/clear/assign/flip and test-and-set/clear/assign/flip functions.
All atomic bit functions allow (and indeed, require) the caller
bitops: add atomic bit operations in new API
Add atomic bit test/set/clear/assign/flip and test-and-set/clear/assign/flip functions.
All atomic bit functions allow (and indeed, require) the caller to specify a memory order.
Bugzilla ID: 1385
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
show more ...
|
| 471de107 | 20-Sep-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
bitops: add new bit manipulation API
Add functionality to test and modify the value of individual bits in 32-bit or 64-bit words.
These functions have no implications on memory ordering, atomicity
bitops: add new bit manipulation API
Add functionality to test and modify the value of individual bits in 32-bit or 64-bit words.
These functions have no implications on memory ordering, atomicity and does not use volatile and thus does not prevent any compiler optimizations.
Bugzilla ID: 1385
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Jack Bond-Preston <jack.bond-preston@foss.arm.com>
show more ...
|
| 719834a6 | 20-Sep-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
use C linkage where appropriate in headers
Assure that 'extern "C" { /../ }' do not cover files included from a particular header file, and address minor issues resulting from this change of order.
use C linkage where appropriate in headers
Assure that 'extern "C" { /../ }' do not cover files included from a particular header file, and address minor issues resulting from this change of order.
Dealing with C++ should delegate to the individual include file level, rather than being imposed by the user of that file. For example, forcing C linkage prevents __Generic macros being replaced with overloaded static inline functions in C++ translation units.
Eliminate 'extern "C"' from files which do not declare any symbols (e.g., only macros or struct types).
On the other hand, the headers check is too naive in assuming that all headers must contain a 'extern "C"'. Such a check was added in commit 1ee492bdc4ff ("buildtools/chkincs: check missing C++ guards"). Since this current change results in many headers not containing such a token, remove the check for 'extern "C"' until we have a better implementation.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Signed-off-by: David Marchand <david.marchand@redhat.com>
show more ...
|