Heiko> 7.  ipoib_qp_create wants to modify the IPoIB QP (priv->qp)
    Heiko> which is NULL, because the QP was destroy earlier in time
    Heiko> by the error handling routine in ipoib_qp_create (see 5.)

    Heiko> I think this error could also show up on Mellanox based IB
    Heiko> cards when ib_modify_qp failes in ipoib_qp_create.

Yes, this is a bug.  I think something like the patch below is needed
-- ipoib_qp_create() should not destroy the QP on failure, since it no
longer creates the QP.  In fact we should fix the name as well, since
creation of the QP has moved elsewhere.

I'll check this in and queue it for 2.6.15.

Thanks,
  Roland

--- infiniband/ulp/ipoib/ipoib_verbs.c  (revision 3707)
+++ infiniband/ulp/ipoib/ipoib_verbs.c  (working copy)
@@ -92,7 +92,7 @@ int ipoib_mcast_detach(struct net_device
        return ret;
 }
 
-int ipoib_qp_create(struct net_device *dev)
+int ipoib_init_qp(struct net_device *dev)
 {
        struct ipoib_dev_priv *priv = netdev_priv(dev);
        int ret;
@@ -149,10 +149,11 @@ int ipoib_qp_create(struct net_device *d
        return 0;
 
 out_fail:
-       ib_destroy_qp(priv->qp);
-       priv->qp = NULL;
+       qp_attr.qp_state = IB_QPS_RESET;
+       if (ib_modify_qp(priv->qp, &qp_attr, IB_QP_STATE))
+               ipoib_warn(priv, "Failed to modify QP to RESET state\n");
 
-       return -EINVAL;
+       return ret;
 }
 
 int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
--- infiniband/ulp/ipoib/ipoib.h        (revision 3707)
+++ infiniband/ulp/ipoib/ipoib.h        (working copy)
@@ -277,7 +277,7 @@ int ipoib_mcast_attach(struct net_device
 int ipoib_mcast_detach(struct net_device *dev, u16 mlid,
                       union ib_gid *mgid);
 
-int ipoib_qp_create(struct net_device *dev);
+int ipoib_init_qp(struct net_device *dev);
 int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca);
 void ipoib_transport_dev_cleanup(struct net_device *dev);
 
--- infiniband/ulp/ipoib/ipoib_ib.c     (revision 3707)
+++ infiniband/ulp/ipoib/ipoib_ib.c     (working copy)
@@ -387,9 +387,9 @@ int ipoib_ib_dev_open(struct net_device 
        struct ipoib_dev_priv *priv = netdev_priv(dev);
        int ret;
 
-       ret = ipoib_qp_create(dev);
+       ret = ipoib_init_qp(dev);
        if (ret) {
-               ipoib_warn(priv, "ipoib_qp_create returned %d\n", ret);
+               ipoib_warn(priv, "ipoib_init_qp returned %d\n", ret);
                return -1;
        }
 
_______________________________________________
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to