[openfabrics-ewg] [PATCH 1/3] IB/VNIC Fix failover from secondary path back to primary path

Vladimir Sokolovsky vlad at dev.mellanox.co.il
Wed Dec 20 04:31:17 PST 2006


Ramachandra K wrote:
> This fixes a bug due to which failover from secondary path back to primary path
> was not working.
>
> Signed-off-by: Ramachandra K <ramachandra.kuchimanchi at qlogic.com>
> ---
>
>  drivers/infiniband/ulp/vnic/vnic_ib.c   |    4 +++-
>  drivers/infiniband/ulp/vnic/vnic_main.c |    9 +++++----
>  2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/vnic/vnic_ib.c b/drivers/infiniband/ulp/vnic/vnic_ib.c
> index 6196e20..56ae9f7 100644
> --- a/drivers/infiniband/ulp/vnic/vnic_ib.c
> +++ b/drivers/infiniband/ulp/vnic/vnic_ib.c
> @@ -303,10 +303,12 @@ int vnic_ib_get_path(struct netpath *net
>  			       " path record query\n",
>  			       config->path_info.status);
>  
> -		netpath_timer(netpath, vnic->config->no_path_timeout);
>  		ret = config->path_info.status;
>  	}
>  out:
> +	if (ret)
> +		netpath_timer(netpath, vnic->config->no_path_timeout);
> +
>  	return ret;
>  }
>  
> diff --git a/drivers/infiniband/ulp/vnic/vnic_main.c b/drivers/infiniband/ulp/vnic/vnic_main.c
> index fca2b90..e15d3f9 100644
> --- a/drivers/infiniband/ulp/vnic/vnic_main.c
> +++ b/drivers/infiniband/ulp/vnic/vnic_main.c
> @@ -710,17 +710,18 @@ static struct vnic * vnic_handle_npevent
>  	case VNIC_PRINP_TIMEREXPIRED:
>  		netpath = &vnic->primary_path;
>  		netpath->timer_state = NETPATH_TS_EXPIRED;
> -		if (netpath->carrier)
> +		if (!netpath->carrier)
>  			update_path_and_reconnect(netpath, vnic);
>  		break;
>  	case VNIC_SECNP_TIMEREXPIRED:
>  		netpath = &vnic->secondary_path;
>  		netpath->timer_state = NETPATH_TS_EXPIRED;
> -		if (netpath->carrier) {
> +		if (!netpath->carrier)
> +			update_path_and_reconnect(netpath, vnic);
> +		else {
>  			if (vnic->state == VNIC_UNINITIALIZED)
>  				vnic_npevent_register(vnic, netpath);
> -		} else
> -			update_path_and_reconnect(netpath, vnic);
> +		}
>  		break;
>  	case VNIC_PRINP_LINKUP:
>  		vnic->primary_path.carrier = 1;
>
>
>
> _______________________________________________
> openfabrics-ewg mailing list
> openfabrics-ewg at openib.org
> http://openib.org/mailman/listinfo/openfabrics-ewg
>   
Added to kernel_patches/fixes

Regards,
Vladimir




More information about the ewg mailing list