git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
drivers
/
infiniband
/
ulp
/
ipoib
/
ipoib_verbs.c
diff --git
a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
index
4933edf
..
faaf10e
100644
(file)
--- a/
drivers/infiniband/ulp/ipoib/ipoib_verbs.c
+++ b/
drivers/infiniband/ulp/ipoib/ipoib_verbs.c
@@
-1,5
+1,6
@@
/*
* Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
/*
* Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
+ * Copyright (c) 2005 Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
@@
-32,7
+33,7
@@
* $Id: ipoib_verbs.c 1349 2004-12-16 21:09:43Z roland $
*/
* $Id: ipoib_verbs.c 1349 2004-12-16 21:09:43Z roland $
*/
-#include <ib_cache.h>
+#include <
rdma/
ib_cache.h>
#include "ipoib.h"
#include "ipoib.h"
@@
-40,7
+41,6
@@
int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
struct ib_qp_attr *qp_attr;
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
struct ib_qp_attr *qp_attr;
- int attr_mask;
int ret;
u16 pkey_index;
int ret;
u16 pkey_index;
@@
-58,17
+58,16
@@
int ipoib_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid)
/* set correct QKey for QP */
qp_attr->qkey = priv->qkey;
/* set correct QKey for QP */
qp_attr->qkey = priv->qkey;
- attr_mask = IB_QP_QKEY;
- ret = ib_modify_qp(priv->qp, qp_attr, attr_mask);
+ ret = ib_modify_qp(priv->qp, qp_attr, IB_QP_QKEY);
if (ret) {
ipoib_warn(priv, "failed to modify QP, ret = %d\n", ret);
goto out;
}
/* attach QP to multicast group */
if (ret) {
ipoib_warn(priv, "failed to modify QP, ret = %d\n", ret);
goto out;
}
/* attach QP to multicast group */
-
down
(&priv->mcast_mutex);
+
mutex_lock
(&priv->mcast_mutex);
ret = ib_attach_mcast(priv->qp, mgid, mlid);
ret = ib_attach_mcast(priv->qp, mgid, mlid);
-
up
(&priv->mcast_mutex);
+
mutex_unlock
(&priv->mcast_mutex);
if (ret)
ipoib_warn(priv, "failed to attach to multicast group, ret = %d\n", ret);
if (ret)
ipoib_warn(priv, "failed to attach to multicast group, ret = %d\n", ret);
@@
-82,16
+81,16
@@
int ipoib_mcast_detach(struct net_device *dev, u16 mlid, union ib_gid *mgid)
struct ipoib_dev_priv *priv = netdev_priv(dev);
int ret;
struct ipoib_dev_priv *priv = netdev_priv(dev);
int ret;
-
down
(&priv->mcast_mutex);
+
mutex_lock
(&priv->mcast_mutex);
ret = ib_detach_mcast(priv->qp, mgid, mlid);
ret = ib_detach_mcast(priv->qp, mgid, mlid);
-
up
(&priv->mcast_mutex);
+
mutex_unlock
(&priv->mcast_mutex);
if (ret)
ipoib_warn(priv, "ib_detach_mcast failed (result = %d)\n", ret);
return ret;
}
if (ret)
ipoib_warn(priv, "ib_detach_mcast failed (result = %d)\n", ret);
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;
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
int ret;
@@
-148,10
+147,11
@@
int ipoib_qp_create(struct net_device *dev)
return 0;
out_fail:
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)
}
int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)