* [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling
@ 2017-05-22 14:17 Jarod Wilson
[not found] ` <20170522141722.50502-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Jarod Wilson @ 2017-05-22 14:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: 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.
Reported-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
libibumad/umad.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/libibumad/umad.h b/libibumad/umad.h
index 81811380..479165a8 100644
--- a/libibumad/umad.h
+++ b/libibumad/umad.h
@@ -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 */
--
2.12.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling
[not found] ` <20170522141722.50502-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2017-05-22 15:31 ` Hal Rosenstock
2017-05-24 16:33 ` Jason Gunthorpe
2017-05-30 3:52 ` Leon Romanovsky
2 siblings, 0 replies; 5+ messages in thread
From: Hal Rosenstock @ 2017-05-22 15:31 UTC (permalink / raw)
To: Jarod Wilson, linux-rdma-u79uwXL29TY76Z2rM5mHXA
On 5/22/2017 10:17 AM, Jarod Wilson wrote:
> 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.
> Reported-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Reviewed-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling
[not found] ` <20170522141722.50502-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-05-22 15:31 ` Hal Rosenstock
@ 2017-05-24 16:33 ` Jason Gunthorpe
[not found] ` <20170524163301.GA7054-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-05-30 3:52 ` Leon Romanovsky
2 siblings, 1 reply; 5+ messages in thread
From: Jason Gunthorpe @ 2017-05-24 16:33 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Mon, May 22, 2017 at 10:17:22AM -0400, Jarod Wilson wrote:
> 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?
> +/* 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling
[not found] ` <20170524163301.GA7054-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2017-05-27 22:01 ` Jarod Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Jarod Wilson @ 2017-05-27 22:01 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Honggang LI
On 2017-05-24 12:33 PM, Jason Gunthorpe wrote:
> On Mon, May 22, 2017 at 10:17:22AM -0400, Jarod Wilson wrote:
>> 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?
>
>> +/* 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.
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.
--
Jarod Wilson
jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling
[not found] ` <20170522141722.50502-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-05-22 15:31 ` Hal Rosenstock
2017-05-24 16:33 ` Jason Gunthorpe
@ 2017-05-30 3:52 ` Leon Romanovsky
2 siblings, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2017-05-30 3:52 UTC (permalink / raw)
To: Jarod Wilson; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
On Mon, May 22, 2017 at 10:17:22AM -0400, Jarod Wilson wrote:
> 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.
>
> Reported-by: Honggang Li <honli-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> libibumad/umad.h | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
Thanks, applied.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-30 3:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 14:17 [PATCH rdma-core] libibumad: clean up htonll/ntohnll handling Jarod Wilson
[not found] ` <20170522141722.50502-1-jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-05-22 15:31 ` Hal Rosenstock
2017-05-24 16:33 ` Jason Gunthorpe
[not found] ` <20170524163301.GA7054-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-05-27 22:01 ` Jarod Wilson
2017-05-30 3:52 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).