On Tue, Jul 25, 2017 at 05:14:43AM +0100, Bhanuprakash Bodireddy wrote:
> PADDED_MEMBERS_CACHELINE_MARKER macro introduces a way to mark
> cachelines.
>
> This macro expands to an anonymous union containing cacheline marker,
> members in nested anonymous structure, followed by array of bytes that
> is multiple of UNIT bytes.
>
> Signed-off-by: Bhanuprakash Bodireddy <[email protected]>
Applied, thanks! I had to add a C++ acceptable alternative but it was
not difficult:
#ifndef __cplusplus
#define PADDED_MEMBERS_CACHELINE_MARKER(UNIT, CACHELINE, MEMBERS) \
union { \
OVS_CACHE_LINE_MARKER CACHELINE; \
struct { MEMBERS }; \
uint8_t PAD_ID[ROUND_UP(sizeof(struct { MEMBERS }), UNIT)]; \
}
#else
#define PADDED_MEMBERS_CACHELINE_MARKER(UNIT, CACHELINE, MEMBERS) \
union { \
OVS_CACHE_LINE_MARKER CACHELINE; \
struct { MEMBERS }; \
struct { MEMBERS } named_member__; \
uint8_t PAD_ID[ROUND_UP(sizeof named_member__, UNIT)]; \
}
#endif
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev