Explorar el Código

[ipoib] Attempt the broadcast group join only if the link is up

Attempting the broadcast group join while the link is down is
harmless, but can generate annoying volumes of debug messages.
tags/v0.9.8
Michael Brown hace 15 años
padre
commit
47c4aaa9e2
Se han modificado 1 ficheros con 4 adiciones y 9 borrados
  1. 4
    9
      src/drivers/net/ipoib.c

+ 4
- 9
src/drivers/net/ipoib.c Ver fichero

@@ -535,17 +535,11 @@ static int ipoib_open ( struct net_device *netdev ) {
535 535
 	/* Fill receive rings */
536 536
 	ib_refill_recv ( ibdev, ipoib->qp );
537 537
 
538
-	/* Join broadcast group */
539
-	if ( ( rc = ipoib_join_broadcast_group ( ipoib ) ) != 0 ) {
540
-		DBGC ( ipoib, "IPoIB %p could not join broadcast group: %s\n",
541
-		       ipoib, strerror ( rc ) );
542
-		goto err_join_broadcast;
543
-	}
538
+	/* Fake a link status change to join the broadcast group */
539
+	ipoib_link_state_changed ( ibdev );
544 540
 
545 541
 	return 0;
546 542
 
547
-	ipoib_leave_broadcast_group ( ipoib );
548
- err_join_broadcast:
549 543
 	ib_destroy_qp ( ibdev, ipoib->qp );
550 544
  err_create_qp:
551 545
 	ib_destroy_cq ( ibdev, ipoib->cq );
@@ -639,7 +633,8 @@ void ipoib_link_state_changed ( struct ib_device *ibdev ) {
639 633
 	ipoib_set_ib_params ( ipoib );
640 634
 
641 635
 	/* Join new broadcast group */
642
-	if ( ( rc = ipoib_join_broadcast_group ( ipoib ) ) != 0 ) {
636
+	if ( ib_link_ok ( ibdev ) &&
637
+	     ( ( rc = ipoib_join_broadcast_group ( ipoib ) ) != 0 ) ) {
643 638
 		DBGC ( ipoib, "IPoIB %p could not rejoin broadcast group: "
644 639
 		       "%s\n", ipoib, strerror ( rc ) );
645 640
 		return;

Loading…
Cancelar
Guardar