|
@@ -791,7 +791,8 @@ static void ipoib_link_state_changed ( struct ib_device *ibdev ) {
|
791
|
791
|
int rc;
|
792
|
792
|
|
793
|
793
|
/* Leave existing broadcast group */
|
794
|
|
- ipoib_leave_broadcast_group ( ipoib );
|
|
794
|
+ if ( ipoib->qp )
|
|
795
|
+ ipoib_leave_broadcast_group ( ipoib );
|
795
|
796
|
|
796
|
797
|
/* Update MAC address based on potentially-new GID prefix */
|
797
|
798
|
memcpy ( &ipoib->mac.gid.s.prefix, &ibdev->gid.s.prefix,
|
|
@@ -806,7 +807,7 @@ static void ipoib_link_state_changed ( struct ib_device *ibdev ) {
|
806
|
807
|
netdev_link_err ( netdev, ( rc ? rc : -EINPROGRESS_JOINING ) );
|
807
|
808
|
|
808
|
809
|
/* Join new broadcast group */
|
809
|
|
- if ( ib_is_open ( ibdev ) && ib_link_ok ( ibdev ) &&
|
|
810
|
+ if ( ib_is_open ( ibdev ) && ib_link_ok ( ibdev ) && ipoib->qp &&
|
810
|
811
|
( ( rc = ipoib_join_broadcast_group ( ipoib ) ) != 0 ) ) {
|
811
|
812
|
DBGC ( ipoib, "IPoIB %p could not rejoin broadcast group: "
|
812
|
813
|
"%s\n", ipoib, strerror ( rc ) );
|
|
@@ -894,7 +895,9 @@ static void ipoib_close ( struct net_device *netdev ) {
|
894
|
895
|
|
895
|
896
|
/* Tear down the queues */
|
896
|
897
|
ib_destroy_qp ( ibdev, ipoib->qp );
|
|
898
|
+ ipoib->qp = NULL;
|
897
|
899
|
ib_destroy_cq ( ibdev, ipoib->cq );
|
|
900
|
+ ipoib->cq = NULL;
|
898
|
901
|
|
899
|
902
|
/* Close IB device */
|
900
|
903
|
ib_close ( ibdev );
|