Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302609
b: refs/heads/master
c: 3bea57a
h: refs/heads/master
i:
  302607: 7dda4af
v: v3
  • Loading branch information
Roland Dreier committed May 8, 2012
1 parent cbc6ab8 commit e1728f5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d9c0de4ab4ec00b8349d1af0b736a0d473671c2
refs/heads/master: 3bea57a5fc1762a72fb9ac88b9aa9e48dcbea8bc
39 changes: 22 additions & 17 deletions trunk/drivers/infiniband/core/uverbs_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@

#include "uverbs.h"

static struct lock_class_key pd_lock_key;
static struct lock_class_key mr_lock_key;
static struct lock_class_key cq_lock_key;
static struct lock_class_key qp_lock_key;
static struct lock_class_key ah_lock_key;
static struct lock_class_key srq_lock_key;
static struct lock_class_key xrcd_lock_key;
struct uverbs_lock_class {
struct lock_class_key key;
char name[16];
};

static struct uverbs_lock_class pd_lock_class = { .name = "PD-uobj" };
static struct uverbs_lock_class mr_lock_class = { .name = "MR-uobj" };
static struct uverbs_lock_class cq_lock_class = { .name = "CQ-uobj" };
static struct uverbs_lock_class qp_lock_class = { .name = "QP-uobj" };
static struct uverbs_lock_class ah_lock_class = { .name = "AH-uobj" };
static struct uverbs_lock_class srq_lock_class = { .name = "SRQ-uobj" };
static struct uverbs_lock_class xrcd_lock_class = { .name = "XRCD-uobj" };

#define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \
do { \
Expand Down Expand Up @@ -83,13 +88,13 @@ static struct lock_class_key xrcd_lock_key;
*/

static void init_uobj(struct ib_uobject *uobj, u64 user_handle,
struct ib_ucontext *context, struct lock_class_key *key)
struct ib_ucontext *context, struct uverbs_lock_class *c)
{
uobj->user_handle = user_handle;
uobj->context = context;
kref_init(&uobj->ref);
init_rwsem(&uobj->mutex);
lockdep_set_class(&uobj->mutex, key);
lockdep_set_class_and_name(&uobj->mutex, &c->key, c->name);
uobj->live = 0;
}

Expand Down Expand Up @@ -522,7 +527,7 @@ ssize_t ib_uverbs_alloc_pd(struct ib_uverbs_file *file,
if (!uobj)
return -ENOMEM;

init_uobj(uobj, 0, file->ucontext, &pd_lock_key);
init_uobj(uobj, 0, file->ucontext, &pd_lock_class);
down_write(&uobj->mutex);

pd = file->device->ib_dev->alloc_pd(file->device->ib_dev,
Expand Down Expand Up @@ -750,7 +755,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
goto err_tree_mutex_unlock;
}

init_uobj(&obj->uobject, 0, file->ucontext, &xrcd_lock_key);
init_uobj(&obj->uobject, 0, file->ucontext, &xrcd_lock_class);

down_write(&obj->uobject.mutex);

Expand Down Expand Up @@ -947,7 +952,7 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file,
if (!uobj)
return -ENOMEM;

init_uobj(uobj, 0, file->ucontext, &mr_lock_key);
init_uobj(uobj, 0, file->ucontext, &mr_lock_class);
down_write(&uobj->mutex);

pd = idr_read_pd(cmd.pd_handle, file->ucontext);
Expand Down Expand Up @@ -1115,7 +1120,7 @@ ssize_t ib_uverbs_create_cq(struct ib_uverbs_file *file,
if (!obj)
return -ENOMEM;

init_uobj(&obj->uobject, cmd.user_handle, file->ucontext, &cq_lock_key);
init_uobj(&obj->uobject, cmd.user_handle, file->ucontext, &cq_lock_class);
down_write(&obj->uobject.mutex);

if (cmd.comp_channel >= 0) {
Expand Down Expand Up @@ -1407,7 +1412,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
if (!obj)
return -ENOMEM;

init_uobj(&obj->uevent.uobject, cmd.user_handle, file->ucontext, &qp_lock_key);
init_uobj(&obj->uevent.uobject, cmd.user_handle, file->ucontext, &qp_lock_class);
down_write(&obj->uevent.uobject.mutex);

if (cmd.qp_type == IB_QPT_XRC_TGT) {
Expand Down Expand Up @@ -1585,7 +1590,7 @@ ssize_t ib_uverbs_open_qp(struct ib_uverbs_file *file,
if (!obj)
return -ENOMEM;

init_uobj(&obj->uevent.uobject, cmd.user_handle, file->ucontext, &qp_lock_key);
init_uobj(&obj->uevent.uobject, cmd.user_handle, file->ucontext, &qp_lock_class);
down_write(&obj->uevent.uobject.mutex);

xrcd = idr_read_xrcd(cmd.pd_handle, file->ucontext, &xrcd_uobj);
Expand Down Expand Up @@ -2272,7 +2277,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
if (!uobj)
return -ENOMEM;

init_uobj(uobj, cmd.user_handle, file->ucontext, &ah_lock_key);
init_uobj(uobj, cmd.user_handle, file->ucontext, &ah_lock_class);
down_write(&uobj->mutex);

pd = idr_read_pd(cmd.pd_handle, file->ucontext);
Expand Down Expand Up @@ -2476,7 +2481,7 @@ static int __uverbs_create_xsrq(struct ib_uverbs_file *file,
if (!obj)
return -ENOMEM;

init_uobj(&obj->uevent.uobject, cmd->user_handle, file->ucontext, &srq_lock_key);
init_uobj(&obj->uevent.uobject, cmd->user_handle, file->ucontext, &srq_lock_class);
down_write(&obj->uevent.uobject.mutex);

pd = idr_read_pd(cmd->pd_handle, file->ucontext);
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/infiniband/ulp/iser/iscsi_iser.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,10 @@ iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,

err = iser_connect(ib_conn, NULL, (struct sockaddr_in *)dst_addr,
non_blocking);
if (err)
if (err) {
iscsi_destroy_endpoint(ep);
return ERR_PTR(err);

}
return ep;
}

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/infiniband/ulp/iser/iser_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,8 @@ int iser_connect(struct iser_conn *ib_conn,
ib_conn->cma_id = NULL;
addr_failure:
ib_conn->state = ISER_CONN_DOWN;
iser_conn_put(ib_conn, 1); /* deref ib conn's cma id */
connect_failure:
iser_conn_put(ib_conn, 1); /* deref ib conn deallocate */
iser_conn_release(ib_conn, 1);
return err;
}

Expand Down

0 comments on commit e1728f5

Please sign in to comment.