]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ib/sa: Export function to pack a path record into wire format
authorSean Hefty <sean.hefty@intel.com>
Tue, 22 Jan 2013 00:10:48 +0000 (16:10 -0800)
committerSean Hefty <sean.hefty@intel.com>
Tue, 28 May 2013 21:38:41 +0000 (14:38 -0700)
Allow converting from struct ib_sa_path_rec to the IB defined
SA path record wire format.  This will be used to report path
data from the rdma cm into user space.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
drivers/infiniband/core/sa_query.c
include/rdma/ib_sa.h

index 934f45e79e5e3f05b47e5327aeac1c0f26e6648f..9838ca484389c654f915d4ba79acf1fb37e9bafc 100644 (file)
@@ -652,6 +652,12 @@ void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec)
 }
 EXPORT_SYMBOL(ib_sa_unpack_path);
 
+void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute)
+{
+       ib_pack(path_rec_table, ARRAY_SIZE(path_rec_table), rec, attribute);
+}
+EXPORT_SYMBOL(ib_sa_pack_path);
+
 static void ib_sa_path_rec_callback(struct ib_sa_query *sa_query,
                                    int status,
                                    struct ib_sa_mad *mad)
index 8275e539bace51eabe8a952bb9a680dfb9de893a..125f8714301daea0ef4108683c9c6814e65a5018 100644 (file)
@@ -401,6 +401,12 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
                         struct ib_sa_path_rec *rec,
                         struct ib_ah_attr *ah_attr);
 
+/**
+ * ib_sa_pack_path - Conert a path record from struct ib_sa_path_rec
+ * to IB MAD wire format.
+ */
+void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute);
+
 /**
  * ib_sa_unpack_path - Convert a path record from MAD format to struct
  * ib_sa_path_rec.
@@ -418,4 +424,5 @@ int ib_sa_guid_info_rec_query(struct ib_sa_client *client,
                                               void *context),
                              void *context,
                              struct ib_sa_query **sa_query);
+
 #endif /* IB_SA_H */