[ofa-general] help on /sys/class structure and rdma

Roland Dreier rdreier at cisco.com
Fri Jan 25 20:47:26 PST 2008


>         /*
>          * Verify that the firmware major number matches.  Major number
>          * mismatches are fatal.  Minor number mismatches are tolerated.
>          */
>         if (ibv_read_sysfs_file(uverbs_sys_path, "ibdev",
>                                 ibdev, sizeof ibdev) < 0)
>                 return NULL;
>         memset(devstr, 0, sizeof devstr);
>         snprintf(devstr, sizeof devstr, "%s/class/infiniband/%s",
> ibv_get_sysfs_path(), ibdev);
>         if (ibv_read_sysfs_file(devstr, "fw_ver", value, sizeof value) < 0)
>                 return NULL;

looks fine assuming it works, although I'm a fan of asprintf() ;)

 - R.



More information about the general mailing list