summaryrefslogtreecommitdiff
path: root/lib/table/rte_table_array.c
AgeCommit message (Collapse)Author
2024-06-11table: replace zero length array with flex arrayTyler Retzlaff
Zero length arrays are GNU extension. Replace with standard flex array. Signed-off-by: Tyler Retzlaff <[email protected]> Reviewed-by: Morten Brørup <[email protected]>
2024-03-06lib: move alignment attribute on types for MSVCTyler Retzlaff
The current location used for __rte_aligned(a) for alignment of types is not compatible with MSVC. There is only a single location accepted by both toolchains. The standard offers no alignment facility that compatibly interoperates with C and C++ but it may be achieved by relocating the placement of __rte_aligned(a) to the aforementioned location accepted by all currently supported toolchains. To allow alignment for both compilers, do the following: * Expand __rte_aligned(a) to __declspec(align(a)) when building with MSVC. * Move __rte_aligned from the end of {struct,union} definitions to be between {struct,union} and tag. The placement between {struct,union} and the tag allows the desired alignment to be imparted on the type regardless of the toolchain being used for all of GCC, LLVM, MSVC compilers building both C and C++. Note: this move has an additional benefit as Doxygen is not confused anymore like for the rte_event_vector struct definition. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Acked-by: Chengwen Feng <[email protected]> Reviewed-by: Maxime Coquelin <[email protected]> Signed-off-by: David Marchand <[email protected]>
2024-03-06lib: use C11 alignment attribute on variablesTyler Retzlaff
The current location used for __rte_aligned(a) for alignment of variables is not compatible with MSVC. For variables, standard C11 offers alignas(a) supported by conformant compilers i.e. both MSVC and GCC. Replace use of __rte_aligned(a) on variables/fields with alignas(a). Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Signed-off-by: David Marchand <[email protected]>
2023-12-21lib: add more logging helpersDavid Marchand
Add helpers for logging messages in libraries instead of calling RTE_LOG() directly. Those helpers take care of adding a \n: this will make the transition to RTE_LOG_LINE trivial. Note: - for acl and sched libraries that still has some debug multilines messages, a direct call to RTE_LOG is used: this will make it easier to notice such special cases, Signed-off-by: David Marchand <[email protected]>
2023-09-05use abstracted bit count functionsDavid Marchand
Now that DPDK provides such bit count functions, make use of them. This patch was prepared with a "brutal" commandline: $ old=__builtin_clzll; new=rte_clz64; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_clz; new=rte_clz32; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_ctzll; new=rte_ctz64; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_ctz; new=rte_ctz32; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_popcountll; new=rte_popcount64; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" $ old=__builtin_popcount; new=rte_popcount32; git grep -lw $old :^lib/eal/include/rte_bitops.h | xargs sed -i -e "s#\<$old\>#$new#g" Then inclusion of rte_bitops.h was added were necessary. Signed-off-by: David Marchand <[email protected]> Acked-by: Tyler Retzlaff <[email protected]> Reviewed-by: Long Li <[email protected]>
2022-02-22lib: remove unneeded header includesSean Morrissey
These header includes have been flagged by the iwyu_tool and removed. Signed-off-by: Sean Morrissey <[email protected]>
2021-04-21lib: remove librte_ prefix from directory namesBruce Richardson
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 <[email protected]>