components/open-fabrics/infiniband-diags/patches/003-infiniband-diags-ibportstate-enable.patch
branchs11u3-sru
changeset 7022 a132ff51166e
equal deleted inserted replaced
7019:de736f0de312 7022:a132ff51166e
       
     1 # This patch was developed both in-house and from outside. We plan to submit it
       
     2 # upstream, but do not yet have a target date for doing so
       
     3 # 
       
     4 # HG changeset patch
       
     5 # Parent  88a36501a87e8091b564f83dbb5a4f735c20abb1
       
     6 23302428 Re-enabling an already enabled IB port resets the port
       
     7 
       
     8 diff -r 88a36501a87e src/ibportstate.c
       
     9 --- a/src/ibportstate.c	Tue Aug 09 11:44:09 2016 -0700
       
    10 +++ b/src/ibportstate.c	Tue Aug 09 11:57:05 2016 -0700
       
    11 @@ -563,7 +563,14 @@
       
    12  				printf("Port is already in enable state\n");
       
    13  				goto close_port;
       
    14  			}
       
    15 +			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 2);
       
    16 +                       break;
       
    17  		case ENABLE:
       
    18 +			/* Do not have to enable a port which is already in ENABLE state */
       
    19 +			if(physstate == 5) {
       
    20 +				printf("Port is already in enable state, no need to re-enable\n");
       
    21 +				goto close_port;
       
    22 +			}
       
    23  		case RESET:
       
    24  			/* Polling */
       
    25  			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 2);