| 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 ...
|
| feb9fd6a | 24-Jan-2025 |
Tyler Retzlaff <roretzla@linux.microsoft.com> |
eal/x86: add write combining store for MSVC
MSVC does not support inline assembly. Instead it provides compiler intrinsics. Provide conditional compile for MSVC for movdiri using the _directstoreu_u
eal/x86: add write combining store for MSVC
MSVC does not support inline assembly. Instead it provides compiler intrinsics. Provide conditional compile for MSVC for movdiri using the _directstoreu_u32 intrinsic.
Signed-off-by: Tyler Retzlaff <roretzla@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 ...
|
| 5b856206 | 14-Jan-2025 |
Andre Muezerie <andremue@linux.microsoft.com> |
eal/x86: fix some intrinsics header include for Windows
Error reported: ../lib/net/net_crc_sse.c:49:17: error: call to undeclared function '_mm_clmulepi64_si128'; ISO C99 and later do not support im
eal/x86: fix some intrinsics header include for Windows
Error reported: ../lib/net/net_crc_sse.c:49:17: error: call to undeclared function '_mm_clmulepi64_si128'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
The fix is to remove the unnecessary ifdef around the inclusion of header file immintrin.h. This header also contains functions that do not require AVX instructions, so should not be included only when AVX is available.
Bugzilla ID: 1595 Fixes: da826b7135a4 ("eal: introduce ymm type for AVX 256-bit") Cc: stable@dpdk.org
Reported-by: Pier Damouny <pdamouny@nvidia.com> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com> Acked-by: Bruce Richardson <bruce.richardson@intel.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 ...
|
| 259f6f78 | 27-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
log: colorize log output
Like dmesg, colorize the log output (unless redirected to file). Timestamp is green, the subsystem is in yellow and the message is red if urgent, boldface if an error, and n
log: colorize log output
Like dmesg, colorize the log output (unless redirected to file). Timestamp is green, the subsystem is in yellow and the message is red if urgent, boldface if an error, and normal for info and debug messages.
The default is to not use color since it may disturb automatic tests and other embedded usage.
Note: add fileno() and isatty() to the Windows wrapper.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> 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 ...
|
| 62ae1149 | 27-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
log: add timestamp option
When debugging driver or startup issues, it is useful to have a timestamp on each message printed. The messages in syslog already have a timestamp, but often syslog is not
log: add timestamp option
When debugging driver or startup issues, it is useful to have a timestamp on each message printed. The messages in syslog already have a timestamp, but often syslog is not available during testing.
There are multiple timestamp formats similar to Linux dmesg. The default is time relative since startup (when first step of logging initialization is done by constructor). Other alternative formats are delta, ctime, reltime and iso formats.
Example: $ dpdk-testpmd --log-timestamp -- -i [ 0.008610] EAL: Detected CPU lcores: 8 [ 0.008634] EAL: Detected NUMA nodes: 1 [ 0.008792] EAL: Detected static linkage of DPDK [ 0.010620] EAL: Multi-process socket /var/run/dpdk/rte/mp_socket [ 0.012618] EAL: Selected IOVA mode 'VA' [ 0.016675] testpmd: No probed ethernet devices Interactive-mode selected
Note: Windows does not have localtime_r but it does have a similar function that can be used instead. Add it to rte_os_shim.h.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
| 2773d39f | 27-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: initialize log before everything else
In order for all log messages (including CPU mismatch) to come out through the logging library, it must be initialized as early in rte_eal_init() as possib
eal: initialize log before everything else
In order for all log messages (including CPU mismatch) to come out through the logging library, it must be initialized as early in rte_eal_init() as possible on all platforms.
Where it was done before was likely historical, based on the support of non-OS isolated CPU's which required a shared memory buffer. That support was dropped before DPDK was publicly released.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.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 ...
|
| 98513036 | 27-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
log: rework syslog handling
Refactor how syslog is handled, make it common to Linux and FreeBSD The syslog facility property is better handled in lib/log rather than in eal. This also adds syslog su
log: rework syslog handling
Refactor how syslog is handled, make it common to Linux and FreeBSD The syslog facility property is better handled in lib/log rather than in eal. This also adds syslog support to FreeBSD.
Log to syslog only if option is specified. If no --syslog is given then use only standard error.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> 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 ...
|
| c4e03aca | 27-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: improve exit output log
The rte_exit() output format confuses the timestamp and coloring options. Change it to use be a single line with proper prefix.
Before: [ 0.006481] EAL: Error - exi
eal: improve exit output log
The rte_exit() output format confuses the timestamp and coloring options. Change it to use be a single line with proper prefix.
Before: [ 0.006481] EAL: Error - exiting with code: 1 Cause: [ 0.006489] Cannot init EAL: Permission denied
After: [ 0.006238] EAL: Error - exiting with code: 1 [ 0.006250] EAL: Cannot init EAL: Permission denied
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.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 ...
|
| 72bf6da8 | 27-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: do not log init failure twice
The message already goes through logging, and does not need to be printed on stderr. Message level should be ALERT to match function name.
Signed-off-by: Stephen
eal: do not log init failure twice
The message already goes through logging, and does not need to be printed on stderr. Message level should be ALERT to match function name.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.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 ...
|
| 9a4276f9 | 07-Nov-2024 |
David Marchand <david.marchand@redhat.com> |
eal: introduce log options parser
Rename existing log level option parser and add a little helper tracking all options related to logs. This will make it easier to add more log options in the next c
eal: introduce log options parser
Rename existing log level option parser and add a little helper tracking all options related to logs. This will make it easier to add more log options in the next commits.
Signed-off-by: David Marchand <david.marchand@redhat.com>
show more ...
|
| 9eeefca0 | 27-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: factorize parser for log level
The code to parse for log-level option should be same on all OS variants.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Tyler Retzlaff
eal: factorize parser for log level
The code to parse for log-level option should be same on all OS variants.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
| a06fb0fa | 27-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
eal/windows: align getopt to FreeBSD
Having different prototypes on different platforms can lead to lots of unnecessary workarounds. It looks like the version of getopt used from windows was based o
eal/windows: align getopt to FreeBSD
Having different prototypes on different platforms can lead to lots of unnecessary workarounds. It looks like the version of getopt used from windows was based on an older out of date version from FreeBSD.
This patch changes getopt, getopt_long, etc to have the same const attributes as Linux and FreeBSD. The changes are derived from the current FreeBSD version of getopt_long.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-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 ...
|
| 9ebdbe62 | 08-Nov-2024 |
Thomas Monjalon <thomas@monjalon.net> |
eal: fix lcore variables cleanup on Windows
The memory allocated with _aligned_malloc() must be released with _aligned_free() on Windows.
The POSIX free() was called in eal_lcore_var_cleanup(), cal
eal: fix lcore variables cleanup on Windows
The memory allocated with _aligned_malloc() must be released with _aligned_free() on Windows.
The POSIX free() was called in eal_lcore_var_cleanup(), called in rte_eal_cleanup(), and triggered a heap corruption: exit status 3221226356 or signal 3221226228 SIGinvalid with MALLOC_PERTURB_=86
Fixes: 5bce9bed67ad ("eal: add static per-lcore memory allocation facility")
Reported-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Morten Brørup <mb@smartsharesystems.com> Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
show more ...
|
| 18b5049a | 25-Oct-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
eal/x86: keep power intrinsics state in lcore variable
Keep per-lcore power intrinsics state in a lcore variable to reduce cache working set size and avoid any CPU next-line-prefetching causing fals
eal/x86: keep power intrinsics state in lcore variable
Keep per-lcore power intrinsics state in a lcore variable to reduce cache working set size and avoid any CPU next-line-prefetching causing false sharing.
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 ...
|
| b24bbaed | 25-Oct-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
service: keep per-lcore state in lcore variable
Replace static array of cache-aligned structs with an lcore variable, to slightly benefit code simplicity and performance.
Signed-off-by: Mattias Rön
service: keep per-lcore state in lcore variable
Replace static array of cache-aligned structs with an lcore variable, to slightly benefit code simplicity and performance.
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 ...
|
| 29c39cd3 | 25-Oct-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
random: keep PRNG state in lcore variable
Replace keeping PRNG state in a RTE_MAX_LCORE-sized static array of cache-aligned and RTE_CACHE_GUARDed struct instances with keeping the same state in a mo
random: keep PRNG state in lcore variable
Replace keeping PRNG state in a RTE_MAX_LCORE-sized static array of cache-aligned and RTE_CACHE_GUARDed struct instances with keeping the same state in a more cache-friendly lcore variable.
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 ...
|
| 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 ...
|