<div>Hi Vlad,</div>
<div> </div>
<div>Please add this patch to OFED 1.3.1</div>
<div>In additional to the main purpose of this patch it is also fixes issues we saw with partitioning and SM failover because of:</div>
<div> </div>
<div><em>Also, switch to using ib_find_pkey() instead of ib_find_cached_pkey()<br>everywhere in IPoIB, since none of the places that look for P_Keys are<br>in a fast path or in non-sleeping context, and in general we want to<br>
kill off the whole caching infrastructure eventually. This also fixes<br>consistency problems caused because some IPoIB queries were cached and<br>some were uncached during the window where the cache was not updated.</em></div>
<div><em></em> </div>
<div>Thanks</div>
<div>Olga</div>
<div><br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Roland Dreier</b> <<a href="mailto:rdreier@cisco.com">rdreier@cisco.com</a>><br>Date: Apr 15, 2008 8:55 AM<br>
Subject: [ofa-general] [PATCH/RFC] IPoIB: Handle case when P_Key is deleted and re-added at same index<br>To: <a href="mailto:general@lists.openfabrics.org">general@lists.openfabrics.org</a><br><br></span>If a P_Key is deleted and then re-added at the same index, then IPoIB<br>
gets confused because __ipoib_ib_dev_flush() only checks whether the<br>index is the same without checking whether the P_Key was present, so<br>the interface is stopped when the P_Key is deleted, but the event when<br>the P_Key is re-added gets ignored and the interface never gets<br>
restarted.<br><br>Also, switch to using ib_find_pkey() instead of ib_find_cached_pkey()<br>everywhere in IPoIB, since none of the places that look for P_Keys are<br>in a fast path or in non-sleeping context, and in general we want to<br>
kill off the whole caching infrastructure eventually. This also fixes<br>consistency problems caused because some IPoIB queries were cached and<br>some were uncached during the window where the cache was not updated.<br>
<br>Thanks to Venkata Subramonyam <<a href="mailto:vsubramo@cisco.com">vsubramo@cisco.com</a>> for debugging this<br>problem and testing this fix.<br><br>Signed-off-by: Roland Dreier <<a href="mailto:rolandd@cisco.com">rolandd@cisco.com</a>><br>
---<br>drivers/infiniband/ulp/ipoib/ipoib_cm.c | 4 ++--<br>drivers/infiniband/ulp/ipoib/ipoib_ib.c | 10 +++++-----<br>2 files changed, 7 insertions(+), 7 deletions(-)<br><br>diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c<br>
index 9d411f2..9db7b0b 100644<br>--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c<br>+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c<br>@@ -1007,9 +1007,9 @@ static int ipoib_cm_modify_tx_init(struct net_device *dev,<br> struct ipoib_dev_priv *priv = netdev_priv(dev);<br>
struct ib_qp_attr qp_attr;<br> int qp_attr_mask, ret;<br>- ret = ib_find_cached_pkey(priv->ca, priv->port, priv->pkey, &qp_attr.pkey_index);<br>+ ret = ib_find_pkey(priv->ca, priv->port, priv->pkey, &qp_attr.pkey_index);<br>
if (ret) {<br>- ipoib_warn(priv, "pkey 0x%x not in cache: %d\n", priv->pkey, ret);<br>+ ipoib_warn(priv, "pkey 0x%x not found: %d\n", priv->pkey, ret);<br> return ret;<br>
}<br><br>diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c<br>index 8b4ff69..0205eb7 100644<br>--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c<br>+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c<br>
@@ -594,7 +594,7 @@ static void ipoib_pkey_dev_check_presence(struct net_device *dev)<br> struct ipoib_dev_priv *priv = netdev_priv(dev);<br> u16 pkey_index = 0;<br><br>- if (ib_find_cached_pkey(priv->ca, priv->port, priv->pkey, &pkey_index))<br>
+ if (ib_find_pkey(priv->ca, priv->port, priv->pkey, &pkey_index))<br> clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);<br> else<br> set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);<br>
@@ -835,13 +835,13 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv, int pkey_event)<br> clear_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);<br> ipoib_ib_dev_down(dev, 0);<br>
ipoib_ib_dev_stop(dev, 0);<br>- ipoib_pkey_dev_delay_open(dev);<br>- return;<br>+ if (ipoib_pkey_dev_delay_open(dev))<br>+ return;<br>
}<br>- set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags);<br><br> /* restart QP only if P_Key index is changed */<br>- if (new_index == priv->pkey_index) {<br>+ if (test_and_set_bit(IPOIB_PKEY_ASSIGNED, &priv->flags) &&<br>
+ new_index == priv->pkey_index) {<br> ipoib_dbg(priv, "Not flushing - P_Key index not changed.\n");<br> return;<br> }<br>--<br>1.5.5<br>
<br>_______________________________________________<br>general mailing list<br><a href="mailto:general@lists.openfabrics.org">general@lists.openfabrics.org</a><br><a href="http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general">http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general</a><br>
<br>To unsubscribe, please visit <a href="http://openib.org/mailman/listinfo/openib-general">http://openib.org/mailman/listinfo/openib-general</a><br> </div>