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

Michael S. Tsirkin mst at dev.mellanox.co.il
Thu May 10 07:09:33 PDT 2007


> @@ -638,10 +660,32 @@ void ipoib_ib_dev_flush(struct work_stru
>  		return;
>  	}
>  
> +	if (pkey_event) {
> +		if (ib_find_pkey(priv->ca, priv->port, priv->pkey, &new_index)) {
> +			clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
> +			ipoib_ib_dev_down(dev, 0);
> +			ipoib_pkey_dev_delay_open(dev);
> +			return;
> +		}
> +		set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);
> +
> +		/* restart qp only of pkey index is cahnged */
> +		if (new_index == priv->pkey_index) {
> +			ipoib_dbg(priv, "Not flushing - pkey index not changed.\n");
> +			return;
> +		}
> +		priv->pkey_index = new_index;
> +	}
> +
>  	ipoib_dbg(priv, "flushing\n");
>  

Say, what if IPOIB_PKEY_ASSIGNED was cleared previously?
priv->pkey_index will be wrong, won't it?

-- 
MST



More information about the general mailing list