forked from ofiwg/libfabric
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prov/efa: Improve efa_rdm_pke definition
This removes the hardcoded padding bytes from the struct definition, which were ostensibly used as a mechanism to enforce alignment of wiredata to the 128 byte boundary. While the static_asserts somewhat protect against changes made to the members which the struct is composed of, the manual calculation is a maintenance headache which is prone to developer error, as well as implementation-defined quirks. More importantly, this change more accurately indicates the intent to align to the 128-byte boundary. This commit also makes the struct size uniform when debug mode is enabled. This wasn't (currently) necessary, as the 32 bytes of padding were already sufficient for the 16-byte dlist_entry struct. This is the C99-compliant version, unionizing the struct members preceding wiredata with a 128-byte array. This is still prone to changes which cause the struct to exceed 128 bytes. In that scenario, the array would be increased to EFA_RDM_PKE_ALIGNMENT * 2. Naturally, this method is slightly less maintainable than the C11-compliant _Alignas solution. Signed-off-by: Darryl Abbate <drl@amazon.com>
- Loading branch information
1 parent
9f604d6
commit b479b5c
Showing
1 changed file
with
111 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters