[ofa-general] Bugs in opensm/libvendor

Mike Heinz michael.heinz at qlogic.com
Wed Dec 10 10:31:33 PST 2008


While experimenting with the APIs in opensm/libvendor, I was unable to
get the path record queries to work. Reviewing the error logs from the
SM, I discovered that the APIs were not setting the required num_path
field. Here's the fix:
 
--- osm_vendor_ibumad_sa.bak    2008-12-10 13:21:22.000000000 -0500
+++ osm_vendor_ibumad_sa.c      2008-12-10 13:24:42.000000000 -0500
@@ -615,7 +615,7 @@
                sa_mad_data.attr_offset =
                    ib_get_attr_offset(sizeof(ib_path_rec_t));
                sa_mad_data.comp_mask =
-                   (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID);
+                   (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID |
IB_PR_COMPMASK_NUMBPATH);
                sa_mad_data.p_attr = &path_rec;
                ib_gid_set_default(&path_rec.dgid,
                                   ((osmv_guid_pair_t *) (p_query_req->
@@ -625,6 +625,7 @@
                                   ((osmv_guid_pair_t *) (p_query_req->
 
p_query_input))->
                                   src_guid);
+               path_rec.num_path = 1;
                break;
 
        case OSMV_QUERY_PATH_REC_BY_GIDS:
@@ -634,7 +635,7 @@
                sa_mad_data.attr_offset =
                    ib_get_attr_offset(sizeof(ib_path_rec_t));
                sa_mad_data.comp_mask =
-                   (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID);
+                   (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID |
IB_PR_COMPMASK_NUMBPATH);
                sa_mad_data.p_attr = &path_rec;
                memcpy(&path_rec.dgid,
                       &((osmv_gid_pair_t *)
(p_query_req->p_query_input))->
@@ -642,6 +643,7 @@
                memcpy(&path_rec.sgid,
                       &((osmv_gid_pair_t *)
(p_query_req->p_query_input))->
                       src_gid, sizeof(ib_gid_t));
+               path_rec.num_path = 1;
                break;
 
        case OSMV_QUERY_PATH_REC_BY_LIDS:
@@ -652,13 +654,14 @@
                sa_mad_data.attr_offset =
                    ib_get_attr_offset(sizeof(ib_path_rec_t));
                sa_mad_data.comp_mask =
-                   (IB_PR_COMPMASK_DLID | IB_PR_COMPMASK_SLID);
+                   (IB_PR_COMPMASK_DLID | IB_PR_COMPMASK_SLID |
IB_PR_COMPMASK_NUMBPATH);
                sa_mad_data.p_attr = &path_rec;
                path_rec.dlid =
                    ((osmv_lid_pair_t *) (p_query_req->p_query_input))->
                    dest_lid;
                path_rec.slid =
                    ((osmv_lid_pair_t *)
(p_query_req->p_query_input))->src_lid;
+               path_rec.num_path = 1;
                break;
 
        case OSMV_QUERY_UD_MULTICAST_SET:
--- osm_vendor_mlx_sa.bak       2008-12-10 13:21:10.000000000 -0500
+++ osm_vendor_mlx_sa.c 2008-12-10 13:24:07.000000000 -0500
@@ -743,7 +743,7 @@
                sa_mad_data.attr_offset =
                    ib_get_attr_offset(sizeof(ib_path_rec_t));
                sa_mad_data.comp_mask =
-                   (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID);
+                   (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID |
IB_PR_COMPMASK_NUMBPATH);
                sa_mad_data.p_attr = &path_rec;
                ib_gid_set_default(&path_rec.dgid,
                                   ((osmv_guid_pair_t *) (p_query_req->
@@ -753,6 +753,7 @@
                                   ((osmv_guid_pair_t *) (p_query_req->
 
p_query_input))->
                                   src_guid);
+               path_rec.num_path = 1;
                break;
 
        case OSMV_QUERY_PATH_REC_BY_GIDS:
@@ -763,7 +764,7 @@
                sa_mad_data.attr_offset =
                    ib_get_attr_offset(sizeof(ib_path_rec_t));
                sa_mad_data.comp_mask =
-                   (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID);
+                   (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID |
IB_PR_COMPMASK_NUMBPATH);
                sa_mad_data.p_attr = &path_rec;
                memcpy(&path_rec.dgid,
                       &((osmv_gid_pair_t *)
(p_query_req->p_query_input))->
@@ -771,6 +772,7 @@
                memcpy(&path_rec.sgid,
                       &((osmv_gid_pair_t *)
(p_query_req->p_query_input))->
                       src_gid, sizeof(ib_gid_t));
+               path_rec.num_path = 1;
                break;
 
        case OSMV_QUERY_PATH_REC_BY_LIDS:
@@ -789,6 +791,7 @@
                    dest_lid;
                path_rec.slid =
                    ((osmv_lid_pair_t *)
(p_query_req->p_query_input))->src_lid;
+               path_rec.num_path = 1;
                break;
 
        case OSMV_QUERY_UD_MULTICAST_SET:

 
--
Michael Heinz
Principal Engineer, Qlogic Corporation
King of Prussia, Pennsylvania
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20081210/a3367f85/attachment.html>


More information about the general mailing list