[ofa-general] Re: [PATCHv4 2/2] ipoib: handle pkey change events

Michael S. Tsirkin mst at dev.mellanox.co.il
Thu May 10 05:38:55 PDT 2007


> --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2007-05-08 15:46:53.000000000 +0300
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2007-05-10 15:16:47.592982550 +0300
> @@ -413,6 +413,18 @@ int ipoib_ib_dev_open(struct net_device 
>  	struct ipoib_dev_priv *priv = netdev_priv(dev);
>  	int ret;
>  
> +	/*
> +	 * Search through the port P_Key table for the requested pkey value.
> +	 * The port has to be assigned to the respective IB partition in
> +	 * advance.
> +	 */
> +	if (ib_find_pkey(priv->ca, priv->port, priv->pkey, &priv->pkey_index)) {
> +		ipoib_warn(priv, "pkey 0x%04x nof found\n", priv->pkey);
> +		clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
> +		return -1;
> +	}
> +	set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
> +
>  	ret = ipoib_init_qp(dev);
>  	if (ret) {
>  		ipoib_warn(priv, "ipoib_init_qp returned %d\n", ret);

Return some error code -ENXIO.

-- 
MST



More information about the general mailing list