Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214438
b: refs/heads/master
c: fc19de3
h: refs/heads/master
v: v3
  • Loading branch information
Zach Brown authored and Andy Grover committed Sep 9, 2010
1 parent 087d08c commit b3cdcf3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 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: f3c6808d3d8513db2b0543538fc35c25a60fe7a7
refs/heads/master: fc19de38be924728fea76026c0d1a6c4b6156084
25 changes: 24 additions & 1 deletion trunk/net/rds/ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,27 @@ struct list_head rds_ib_devices;
DEFINE_SPINLOCK(ib_nodev_conns_lock);
LIST_HEAD(ib_nodev_conns);

void rds_ib_nodev_connect(void)
{
struct rds_ib_connection *ic;

spin_lock(&ib_nodev_conns_lock);
list_for_each_entry(ic, &ib_nodev_conns, ib_node)
rds_conn_connect_if_down(ic->conn);
spin_unlock(&ib_nodev_conns_lock);
}

void rds_ib_dev_shutdown(struct rds_ib_device *rds_ibdev)
{
struct rds_ib_connection *ic;
unsigned long flags;

spin_lock_irqsave(&rds_ibdev->spinlock, flags);
list_for_each_entry(ic, &rds_ibdev->conn_list, ib_node)
rds_conn_drop(ic->conn);
spin_unlock_irqrestore(&rds_ibdev->spinlock, flags);
}

/*
* rds_ib_destroy_mr_pool() blocks on a few things and mrs drop references
* from interrupt context so we push freing off into a work struct in krdsd.
Expand Down Expand Up @@ -156,6 +177,8 @@ void rds_ib_add_one(struct ib_device *device)
ib_set_client_data(device, &rds_ib_client, rds_ibdev);
atomic_inc(&rds_ibdev->refcount);

rds_ib_nodev_connect();

put_dev:
rds_ib_dev_put(rds_ibdev);
free_attr:
Expand Down Expand Up @@ -205,7 +228,7 @@ void rds_ib_remove_one(struct ib_device *device)
if (!rds_ibdev)
return;

rds_ib_destroy_conns(rds_ibdev);
rds_ib_dev_shutdown(rds_ibdev);

/*
* prevent future connection attempts from getting a reference to this
Expand Down

0 comments on commit b3cdcf3

Please sign in to comment.