|
@@ -882,3 +882,19 @@ void unregister_ibdev ( struct ib_device *ibdev ) {
|
882
|
882
|
ibdev_put ( ibdev );
|
883
|
883
|
DBGC ( ibdev, "IBDEV %p unregistered\n", ibdev );
|
884
|
884
|
}
|
|
885
|
+
|
|
886
|
+/**
|
|
887
|
+ * Find Infiniband device by GID
|
|
888
|
+ *
|
|
889
|
+ * @v gid GID
|
|
890
|
+ * @ret ibdev Infiniband device, or NULL
|
|
891
|
+ */
|
|
892
|
+struct ib_device * find_ibdev ( struct ib_gid *gid ) {
|
|
893
|
+ struct ib_device *ibdev;
|
|
894
|
+
|
|
895
|
+ for_each_ibdev ( ibdev ) {
|
|
896
|
+ if ( memcmp ( gid, &ibdev->gid, sizeof ( *gid ) ) == 0 )
|
|
897
|
+ return ibdev;
|
|
898
|
+ }
|
|
899
|
+ return NULL;
|
|
900
|
+}
|