libibumad: clean up htonll/ntohnll handling
PATCH 1/1 libibumad: clean up htonll/ntohnll handling
Only ntohll was being checked to see if it wasn't defined, and was then redefining htonll as well as ntohll. This was causing some problems for the compile of the opa-ff package. Simple enough to rearrange this code a bit such that htonll and ntohll are handled entirely independent of one another.
--- libibumad/umad.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
libibumad/umad.h +6 -4
@@ -247,15 +247,17 @@ static inline void umad_free(void *umad) free(umad); } +/* Users should use the glibc functions directly, not these wrappers */ #ifndef ntohll -#undef htonll#undef ntohll -/* Users should use the glibc functions directly, not these wrappers */ -static inline __attribute__((deprecated))uint64_t htonll (uint64_t x) {return htobe64 (x); }static inline __attribute__((deprecated))uint64_t ntohll (uint64_t x) {return be64toh (x); } -#define htonll htonll#define ntohll ntohll#endif +#ifndef htonll +#undef htonll +static inline __attribute__((deprecated))uint64_t htonll (uint64_t x) {return htobe64 (x); } +#define htonll htonll +#endif END_C_DECLS #endif /* _UMAD_H */
Signature · 6 lines
2.12.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hal Rosenstock
Reviewed-byQuoted 5 lines · Jarod Wilson
Only ntohll was being checked to see if it wasn't defined, and was then redefining htonll as well as ntohll. This was causing some problems for the compile of the opa-ff package. Simple enough to rearrange this code a bit such that htonll and ntohll are handled entirely independent of one another.
It used to be the case that they were treated independently.
Quoted 2 lines
Reported-by Honggang Li <[email protected]>Signed-off-by Jarod Wilson <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Jarod Wilson
Only ntohll was being checked to see if it wasn't defined, and was then redefining htonll as well as ntohll. This was causing some problems for the compile of the opa-ff package. Simple enough to rearrange this code a bit such that htonll and ntohll are handled entirely independent of one another.
What problem did this cause?
libibumad/umad.h static inline void umad_free(void *umad) · line 257
Quoted 12 lines
libibumad/umad.h +3
-4+/* Users should use the glibc functions directly, not these wrappers */ #ifndef ntohll -#undef htonll#undef ntohll -/* Users should use the glibc functions directly, not these wrappers */ -static inline __attribute__((deprecated))uint64_t htonll (uint64_t x) {return htobe64 (x); }static inline __attribute__((deprecated))uint64_t ntohll (uint64_t x) {return be64toh (x); } -#define htonll htonll#define ntohll ntohll#endif +#ifndef htonll +#undef htonll
Both these undefs are not needed anymore.
Seems fine to me, if not weird that something would have a problem here.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 24 lines · Jason Gunthorpe
Quoted 5 lines · Jarod Wilson
Only ntohll was being checked to see if it wasn't defined, and was then redefining htonll as well as ntohll. This was causing some problems for the compile of the opa-ff package. Simple enough to rearrange this code a bit such that htonll and ntohll are handled entirely independent of one another.
What problem did this cause?
libibumad/umad.h static inline void umad_free(void *umad) · line 257
Quoted 12 lines
libibumad/umad.h +3
-4+/* Users should use the glibc functions directly, not these wrappers */ #ifndef ntohll -#undef htonll#undef ntohll -/* Users should use the glibc functions directly, not these wrappers */ -static inline __attribute__((deprecated))uint64_t htonll (uint64_t x) {return htobe64 (x); }static inline __attribute__((deprecated))uint64_t ntohll (uint64_t x) {return be64toh (x); } -#define htonll htonll#define ntohll ntohll#endif +#ifndef htonll +#undef htonllBoth these undefs are not needed anymore.
Quoted 2 lines
Seems fine to me, if not weird that something would have a problem here.
My understanding from Honggang is that this was necessary for him to get opa-ff and infiniband-diags to compile (along with an update to our libibmad package). He should be able to fill in the blanks with further details.
Signature · 6 lines
Jarod Wilson [email protected] -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Leon Romanovsky
AppliedQuoted 6 lines · Jarod Wilson
Only ntohll was being checked to see if it wasn't defined, and was then redefining htonll as well as ntohll. This was causing some problems for the compile of the opa-ff package. Simple enough to rearrange this code a bit such that htonll and ntohll are handled entirely independent of one another.
Quoted 6 lines
Reported-by Honggang Li <[email protected]>Signed-off-by Jarod Wilson <[email protected]>--- libibumad/umad.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
Thanks, applied.