diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5c1dc7f1e2421..7b048a0fa164c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -618,8 +618,8 @@ add_subdirectory(providers/rxe)
 add_subdirectory(providers/rxe/man)
 
 add_subdirectory(libibmad)
-add_subdirectory(ibdiags/libibnetdisc/src)
-add_subdirectory(ibdiags/libibnetdisc/man)
+add_subdirectory(libibnetdisc)
+add_subdirectory(libibnetdisc/man)
 add_subdirectory(ibdiags/src)
 add_subdirectory(ibdiags/scripts)
 add_subdirectory(ibdiags/man)
diff --git a/ibdiags/libibnetdisc/src/CMakeLists.txt b/libibnetdisc/CMakeLists.txt
similarity index 75%
rename from ibdiags/libibnetdisc/src/CMakeLists.txt
rename to libibnetdisc/CMakeLists.txt
index ad8c09dc9722f6..e908bc2d6a29f9 100644
--- a/ibdiags/libibnetdisc/src/CMakeLists.txt
+++ b/libibnetdisc/CMakeLists.txt
@@ -1,6 +1,6 @@
 publish_headers(infiniband
-  ../include/infiniband/ibnetdisc.h
-  ../include/infiniband/ibnetdisc_osd.h
+  ibnetdisc.h
+  ibnetdisc_osd.h
   )
 
 rdma_library(ibnetdisc libibnetdisc.map
@@ -17,7 +17,7 @@ target_link_libraries(ibnetdisc LINK_PRIVATE
   )
 rdma_pkg_config("ibnetdisc" "libibumad libibmad" "")
 
-rdma_test_executable(testleaks ../test/testleaks.c)
+rdma_test_executable(testleaks tests/testleaks.c)
 target_link_libraries(testleaks LINK_PRIVATE
   ibmad
   ibnetdisc
diff --git a/ibdiags/libibnetdisc/src/chassis.c b/libibnetdisc/chassis.c
similarity index 100%
rename from ibdiags/libibnetdisc/src/chassis.c
rename to libibnetdisc/chassis.c
diff --git a/ibdiags/libibnetdisc/src/chassis.h b/libibnetdisc/chassis.h
similarity index 100%
rename from ibdiags/libibnetdisc/src/chassis.h
rename to libibnetdisc/chassis.h
diff --git a/ibdiags/libibnetdisc/src/ibnetdisc.c b/libibnetdisc/ibnetdisc.c
similarity index 100%
rename from ibdiags/libibnetdisc/src/ibnetdisc.c
rename to libibnetdisc/ibnetdisc.c
diff --git a/ibdiags/libibnetdisc/include/infiniband/ibnetdisc.h b/libibnetdisc/ibnetdisc.h
similarity index 100%
rename from ibdiags/libibnetdisc/include/infiniband/ibnetdisc.h
rename to libibnetdisc/ibnetdisc.h
diff --git a/ibdiags/libibnetdisc/src/ibnetdisc_cache.c b/libibnetdisc/ibnetdisc_cache.c
similarity index 100%
rename from ibdiags/libibnetdisc/src/ibnetdisc_cache.c
rename to libibnetdisc/ibnetdisc_cache.c
diff --git a/ibdiags/libibnetdisc/include/infiniband/ibnetdisc_osd.h b/libibnetdisc/ibnetdisc_osd.h
similarity index 100%
rename from ibdiags/libibnetdisc/include/infiniband/ibnetdisc_osd.h
rename to libibnetdisc/ibnetdisc_osd.h
diff --git a/ibdiags/libibnetdisc/src/internal.h b/libibnetdisc/internal.h
similarity index 100%
rename from ibdiags/libibnetdisc/src/internal.h
rename to libibnetdisc/internal.h
diff --git a/ibdiags/libibnetdisc/src/libibnetdisc.map b/libibnetdisc/libibnetdisc.map
similarity index 100%
rename from ibdiags/libibnetdisc/src/libibnetdisc.map
rename to libibnetdisc/libibnetdisc.map
diff --git a/ibdiags/libibnetdisc/man/CMakeLists.txt b/libibnetdisc/man/CMakeLists.txt
similarity index 100%
rename from ibdiags/libibnetdisc/man/CMakeLists.txt
rename to libibnetdisc/man/CMakeLists.txt
diff --git a/ibdiags/libibnetdisc/man/ibnd_discover_fabric.3 b/libibnetdisc/man/ibnd_discover_fabric.3
similarity index 100%
rename from ibdiags/libibnetdisc/man/ibnd_discover_fabric.3
rename to libibnetdisc/man/ibnd_discover_fabric.3
diff --git a/ibdiags/libibnetdisc/man/ibnd_find_node_guid.3 b/libibnetdisc/man/ibnd_find_node_guid.3
similarity index 100%
rename from ibdiags/libibnetdisc/man/ibnd_find_node_guid.3
rename to libibnetdisc/man/ibnd_find_node_guid.3
diff --git a/ibdiags/libibnetdisc/man/ibnd_iter_nodes.3 b/libibnetdisc/man/ibnd_iter_nodes.3
similarity index 100%
rename from ibdiags/libibnetdisc/man/ibnd_iter_nodes.3
rename to libibnetdisc/man/ibnd_iter_nodes.3
diff --git a/ibdiags/libibnetdisc/src/query_smp.c b/libibnetdisc/query_smp.c
similarity index 100%
rename from ibdiags/libibnetdisc/src/query_smp.c
rename to libibnetdisc/query_smp.c
diff --git a/ibdiags/libibnetdisc/test/testleaks.c b/libibnetdisc/tests/testleaks.c
similarity index 100%
rename from ibdiags/libibnetdisc/test/testleaks.c
rename to libibnetdisc/tests/testleaks.c
