Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1451607

Summary: [RHEL-7.4/rdma-core/libibumad] redefined htonll and ntohll
Product: Red Hat Enterprise Linux 7 Reporter: Honggang LI <honli>
Component: rdma-coreAssignee: Jarod Wilson <jarod>
Status: CLOSED ERRATA QA Contact: Mike Stowell <mstowell>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: bhu, ddutile, infiniband-qe, jshortt, lmiksik, mstowell, rdma-dev-team, zguo
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rdma-core-13-6.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1454376 (view as bug list) Environment:
Last Closed: 2017-08-01 17:00:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1353018, 1450776, 1454376    

Description Honggang LI 2017-05-17 07:04:16 UTC
Description of problem:

Upstream commit 29bb8f07da9110fa167b55e5013de80adfd1e99b redefined those two functions. It break OPA-FF compiling. One of those duplicated functions should be removed.

------------------------------------------------------------
gcc -pipe -DTARGET_CPU_FAMILY_X86 -Wall -D__X86_64__ -DCPU_LE -m64 -fno-strict-aliasing -fstack-protector -DLINUX -Dlinux -D__LINUX__   -DPRODUCT=OPENIB_FF -DPRODUCT_OPENIB_FF -DMODULEVERSION=10.3.1.0.7 -DIB_STACK_OPENIB   -fpic  -g -I. -I/home/test/rpmbuild/BUILD/opa-ff-10.3.1.0-8/builtinclude.OPENIB_FF.release -I/home/test/rpmbuild/BUILD/opa-ff-10.3.1.0-8/builtinclude.OPENIB_FF.release/iba -I/home/test/rpmbuild/BUILD/opa-ff-10.3.1.0-8/builtinclude.OPENIB_FF.release/iba/public -I/usr/include/infiniband -I/usr/include -c src/dsap_scan_fabric.c -o build.OPENIB_FF.release/src/dsap_scan_fabric.o
In file included from src/dsap_scan_fabric.c:34:0:
/usr/include/infiniband/umad.h:237:52: error: redefinition of 'htonll'
 static inline __attribute__((deprecated)) uint64_t htonll(uint64_t x) { return htobe64(x); }
                                                    ^
In file included from src/dsap_scan_fabric.c:33:0:
/usr/include/infiniband/mad.h:1671:24: note: previous definition of 'htonll' was here
 static inline uint64_t htonll(uint64_t x)
                        ^
In file included from src/dsap_scan_fabric.c:34:0:
/usr/include/infiniband/umad.h:238:52: error: redefinition of 'ntohll'
 static inline __attribute__((deprecated)) uint64_t ntohll(uint64_t x) { return be64toh(x); }
                                                    ^
In file included from src/dsap_scan_fabric.c:33:0:
/usr/include/infiniband/mad.h:1665:24: note: previous definition of 'ntohll' was here
 static inline uint64_t ntohll(uint64_t x)
                        ^
src/dsap_scan_fabric.c: In function 'dsap_publish_paths':
src/dsap_scan_fabric.c:315:5: warning: 'ntohll' is deprecated (declared at /usr/include/infiniband/umad.h:238) [-Wdeprecated-declarations]
------------------------------------------------------------

Version-Release number of selected component (if applicable):
libibmad-devel-1.3.12-1.el7.x86_64
rdma-core-devel-13-5.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
rdma-core (master)]$ git remote -v
origin	https://github.com/linux-rdma/rdma-core.git (fetch)
origin	https://github.com/linux-rdma/rdma-core.git (push)

 
rdma-core (master)]$ git show 29bb8f07da911
commit 29bb8f07da9110fa167b55e5013de80adfd1e99b
Author: Jason Gunthorpe <jgunthorpe>
Date:   Thu Feb 9 13:14:36 2017 -0700

    umad: Replace htonll macros with proper inlines and mark deprecated
    
    This allowed code using these public definitions to continue to compile
    but will get warnings from gcc. Users should move to glibc's endian.h
    
    We want to avoid new users of these macros in our tree.
    
    Signed-off-by: Jason Gunthorpe <jgunthorpe>

diff --git a/libibumad/umad.h b/libibumad/umad.h
index d574d5d..ee8605d 100644
--- a/libibumad/umad.h
+++ b/libibumad/umad.h
@@ -229,14 +229,13 @@ static inline void umad_free(void *umad)
 }
 
 #ifndef ntohll
-  #if __BYTE_ORDER == __LITTLE_ENDIAN
-    #define ntohll(x) bswap_64(x)
-  #elif __BYTE_ORDER == __BIG_ENDIAN
-    #define ntohll(x) x
-  #endif
-#endif
-#ifndef htonll
-  #define htonll 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
 
 END_C_DECLS

Comment 2 Honggang LI 2017-05-17 07:06:56 UTC
After revert 29bb8f07da911, opa-ff compiling works again.

Comment 4 Honggang LI 2017-05-17 12:11:25 UTC
Compiling infiniband-diags also failed because of this issue.


libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I./include -I/usr/include -I/usr/include/infiniband -Wall -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c src/query_smp.c  -fPIC -DPIC -o .libs/libibnetdisc_la-query_smp.o
In file included from src/query_smp.c:41:0:
/usr/include/infiniband/umad.h:237:52: error: redefinition of 'htonll'
 static inline __attribute__((deprecated)) uint64_t htonll(uint64_t x) { return htobe64(x); }
                                                    ^
In file included from ./include/infiniband/ibnetdisc.h:40:0,
                 from src/query_smp.c:40:
/usr/include/infiniband/mad.h:1671:24: note: previous definition of 'htonll' was here
 static inline uint64_t htonll(uint64_t x)
                        ^
In file included from src/query_smp.c:41:0:
/usr/include/infiniband/umad.h:238:52: error: redefinition of 'ntohll'
 static inline __attribute__((deprecated)) uint64_t ntohll(uint64_t x) { return be64toh(x); }
                                                    ^
In file included from ./include/infiniband/ibnetdisc.h:40:0,
                 from src/query_smp.c:40:
/usr/include/infiniband/mad.h:1665:24: note: previous definition of 'ntohll' was here
 static inline uint64_t ntohll(uint64_t x)
                        ^
make[2]: *** [libibnetdisc_la-query_smp.lo] Error 1
make[2]: Leaving directory `/home/test/rpmbuild/BUILD/infiniband-diags-1.6.7/libibnetdisc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/test/rpmbuild/BUILD/infiniband-diags-1.6.7'
make: *** [all] Error 2

Comment 5 Jarod Wilson 2017-05-17 21:40:08 UTC
I'm not so sure this is rdma-core's bug. What is providing /usr/include/infiniband/mad.h that has the other definition? Looks like it's coming from libibmad-devel, and that's probably where it needs to be removed. Would have to ask upstream to be sure, but it looks like the intention of the rdma-core change was to force people to use glibc's definitions instead of these extra ones.

Comment 6 Honggang LI 2017-05-22 13:42:56 UTC
Setup the 'blocker+' flag as it blocks opa-ff compiling.

Comment 11 errata-xmlrpc 2017-08-01 17:00:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:2011