[PATCH v2] RFC: replace GCC marker extension with C11 anonymous unions
Tyler Retzlaff
roretzla at linux.microsoft.com
Tue Feb 13 07:45:40 CET 2024
The zero sized RTE_MARKER<n> typedefs are a GCC extension unsupported by
MSVC. Replace the use of the RTE_MARKER typedefs with anonymous unions.
Note:
v1 of the series tried to maintain the API after some study it has been
discovered that some existing uses of the markers do not produce compilation
failure but evaluate to unintended values in the absence of adaptation.
For this reason the existing markers cannot be removed because it is too hard
to identify what needs to be changed by consumers. While the ABI has been
maintained the subtle API change is just too risky.
The question I'm asking now is how to gracefully deprecate the markers
while allowing consumption of the struct on Windows.
I propose the following:
* Introduce the unions as per-this series except instead of adding members
that match the original RTE_MARKER field names provide *new* names.
* Retain (conditionally compiled away on Windows) the existing RTE_MARKER
fields with their original names.
* Convert in-tree code to use the new names in the unions.
The old names & markers would be announced for deprecation and eventually
removed and when they are the conditional compilation would also go away.
Thoughts?
v2:
* Introduce additional union/struct to agnostically pad cachline0 to
RTE_CACHE_LINE_MIN_SIZE without conditional compilation.
* Adapt ixgbe access of rearm_data field.
* Move ol_flags field out of rearm_data union where it didn't belong.
* Added a couple of static_asserts for offset of cacheline1 and
sizeof struct rte_mbuf.
Tyler Retzlaff (1):
mbuf: replace GCC marker extension with C11 anonymous unions
drivers/net/ionic/ionic_lif.c | 8 +-
drivers/net/ionic/ionic_rxtx_sg.c | 4 +-
drivers/net/ionic/ionic_rxtx_simple.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 8 +-
drivers/net/sfc/sfc_ef100_rx.c | 8 +-
drivers/net/sfc/sfc_ef10_rx.c | 12 +-
drivers/net/virtio/virtio_rxtx_packed_avx.h | 8 +-
lib/mbuf/rte_mbuf_core.h | 276 ++++++++++++++++------------
8 files changed, 179 insertions(+), 147 deletions(-)
--
1.8.3.1
More information about the dev
mailing list