[PATCH ibsim] umad2sim/umad2sim.c: Fix ibsim for latest libibumad in rdma-core

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With the latest rdma-core libibumad with following patch:

commit abf72057c27750275d0668375d30c4971911d041
Author: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
Date:   Thu Apr 5 11:04:14 2018 -0600

    umad: Do not check for umad sysfs files in umad_init

    Now that we don't load the umad module if the HW doesn't use it (eg
    for roce only hardware) umad_init is failing to read the ABI version
    from the kernel.

    Applications still want to use some libibumad services that are not
    related to the char device, so move the version check to umad_open_port
    instead.

    Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

ibstat and OpenSM no longer work with ibsim as no local IB
devices are found.

Fix this by having scandir initialize umad2sim if not already
initialized. This creates the needed client specific sysfs files.

Signed-off-by: Hal Rosenstock <hal@xxxxxxxxxxxx>
---
 umad2sim/umad2sim.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/umad2sim/umad2sim.c b/umad2sim/umad2sim.c
index 90b1c73..84ab84f 100644
--- a/umad2sim/umad2sim.c
+++ b/umad2sim/umad2sim.c
@@ -737,6 +737,12 @@ int scandir(const char *path, struct dirent ***namelist,
 	char new_path[4096];
 
 	CHECK_INIT();
+
+	if (!umad2sim_initialized && (is_sysfs_file(path) ||
+				      !strncmp(path, umad_dev_dir,
+					       strlen(umad_dev_dir))))
+		umad2sim_init();
+
 	DEBUG("libs_wrap: scandir: %s...\n", path);
 
 	if (is_sysfs_file(path)) {
-- 
2.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux