Преглед на файлове

[infiniband] Open device prior to creating SMI and GSI queue pairs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown преди 13 години
родител
ревизия
1e7fbc5bf3
променени са 1 файла, в които са добавени 9 реда и са изтрити 9 реда
  1. 9
    9
      src/net/infiniband.c

+ 9
- 9
src/net/infiniband.c Целия файл

@@ -610,6 +610,13 @@ int ib_open ( struct ib_device *ibdev ) {
610 610
 		return 0;
611 611
 	}
612 612
 
613
+	/* Open device */
614
+	if ( ( rc = ibdev->op->open ( ibdev ) ) != 0 ) {
615
+		DBGC ( ibdev, "IBDEV %p could not open: %s\n",
616
+		       ibdev, strerror ( rc ) );
617
+		goto err_open;
618
+	}
619
+
613 620
 	/* Create subnet management interface */
614 621
 	ibdev->smi = ib_create_mi ( ibdev, IB_QPT_SMI );
615 622
 	if ( ! ibdev->smi ) {
@@ -633,13 +640,6 @@ int ib_open ( struct ib_device *ibdev ) {
633 640
 		goto err_create_gsi;
634 641
 	}
635 642
 
636
-	/* Open device */
637
-	if ( ( rc = ibdev->op->open ( ibdev ) ) != 0 ) {
638
-		DBGC ( ibdev, "IBDEV %p could not open: %s\n",
639
-		       ibdev, strerror ( rc ) );
640
-		goto err_open;
641
-	}
642
-
643 643
 	/* Add to head of open devices list */
644 644
 	list_add ( &ibdev->open_list, &open_ib_devices );
645 645
 
@@ -649,14 +649,14 @@ int ib_open ( struct ib_device *ibdev ) {
649 649
 	assert ( ibdev->open_count == 1 );
650 650
 	return 0;
651 651
 
652
-	ibdev->op->close ( ibdev );
653
- err_open:
654 652
 	ib_destroy_mi ( ibdev, ibdev->gsi );
655 653
  err_create_gsi:
656 654
 	ib_destroy_sma ( ibdev, ibdev->smi );
657 655
  err_create_sma:
658 656
 	ib_destroy_mi ( ibdev, ibdev->smi );
659 657
  err_create_smi:
658
+	ibdev->op->close ( ibdev );
659
+ err_open:
660 660
 	assert ( ibdev->open_count == 1 );
661 661
 	ibdev->open_count = 0;
662 662
 	return rc;

Loading…
Отказ
Запис