Browse Source

[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 years ago
parent
commit
1e7fbc5bf3
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      src/net/infiniband.c

+ 9
- 9
src/net/infiniband.c View File

610
 		return 0;
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
 	/* Create subnet management interface */
620
 	/* Create subnet management interface */
614
 	ibdev->smi = ib_create_mi ( ibdev, IB_QPT_SMI );
621
 	ibdev->smi = ib_create_mi ( ibdev, IB_QPT_SMI );
615
 	if ( ! ibdev->smi ) {
622
 	if ( ! ibdev->smi ) {
633
 		goto err_create_gsi;
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
 	/* Add to head of open devices list */
643
 	/* Add to head of open devices list */
644
 	list_add ( &ibdev->open_list, &open_ib_devices );
644
 	list_add ( &ibdev->open_list, &open_ib_devices );
645
 
645
 
649
 	assert ( ibdev->open_count == 1 );
649
 	assert ( ibdev->open_count == 1 );
650
 	return 0;
650
 	return 0;
651
 
651
 
652
-	ibdev->op->close ( ibdev );
653
- err_open:
654
 	ib_destroy_mi ( ibdev, ibdev->gsi );
652
 	ib_destroy_mi ( ibdev, ibdev->gsi );
655
  err_create_gsi:
653
  err_create_gsi:
656
 	ib_destroy_sma ( ibdev, ibdev->smi );
654
 	ib_destroy_sma ( ibdev, ibdev->smi );
657
  err_create_sma:
655
  err_create_sma:
658
 	ib_destroy_mi ( ibdev, ibdev->smi );
656
 	ib_destroy_mi ( ibdev, ibdev->smi );
659
  err_create_smi:
657
  err_create_smi:
658
+	ibdev->op->close ( ibdev );
659
+ err_open:
660
 	assert ( ibdev->open_count == 1 );
660
 	assert ( ibdev->open_count == 1 );
661
 	ibdev->open_count = 0;
661
 	ibdev->open_count = 0;
662
 	return rc;
662
 	return rc;

Loading…
Cancel
Save