diff options
Diffstat (limited to 'net/rds')
-rw-r--r-- | net/rds/ib.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/net/rds/ib.c b/net/rds/ib.c index 1732f8effb59..b21e24fd060c 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c | |||
@@ -59,6 +59,27 @@ struct list_head rds_ib_devices; | |||
59 | DEFINE_SPINLOCK(ib_nodev_conns_lock); | 59 | DEFINE_SPINLOCK(ib_nodev_conns_lock); |
60 | LIST_HEAD(ib_nodev_conns); | 60 | LIST_HEAD(ib_nodev_conns); |
61 | 61 | ||
62 | void rds_ib_nodev_connect(void) | ||
63 | { | ||
64 | struct rds_ib_connection *ic; | ||
65 | |||
66 | spin_lock(&ib_nodev_conns_lock); | ||
67 | list_for_each_entry(ic, &ib_nodev_conns, ib_node) | ||
68 | rds_conn_connect_if_down(ic->conn); | ||
69 | spin_unlock(&ib_nodev_conns_lock); | ||
70 | } | ||
71 | |||
72 | void rds_ib_dev_shutdown(struct rds_ib_device *rds_ibdev) | ||
73 | { | ||
74 | struct rds_ib_connection *ic; | ||
75 | unsigned long flags; | ||
76 | |||
77 | spin_lock_irqsave(&rds_ibdev->spinlock, flags); | ||
78 | list_for_each_entry(ic, &rds_ibdev->conn_list, ib_node) | ||
79 | rds_conn_drop(ic->conn); | ||
80 | spin_unlock_irqrestore(&rds_ibdev->spinlock, flags); | ||
81 | } | ||
82 | |||
62 | /* | 83 | /* |
63 | * rds_ib_destroy_mr_pool() blocks on a few things and mrs drop references | 84 | * rds_ib_destroy_mr_pool() blocks on a few things and mrs drop references |
64 | * from interrupt context so we push freing off into a work struct in krdsd. | 85 | * from interrupt context so we push freing off into a work struct in krdsd. |
@@ -156,6 +177,8 @@ void rds_ib_add_one(struct ib_device *device) | |||
156 | ib_set_client_data(device, &rds_ib_client, rds_ibdev); | 177 | ib_set_client_data(device, &rds_ib_client, rds_ibdev); |
157 | atomic_inc(&rds_ibdev->refcount); | 178 | atomic_inc(&rds_ibdev->refcount); |
158 | 179 | ||
180 | rds_ib_nodev_connect(); | ||
181 | |||
159 | put_dev: | 182 | put_dev: |
160 | rds_ib_dev_put(rds_ibdev); | 183 | rds_ib_dev_put(rds_ibdev); |
161 | free_attr: | 184 | free_attr: |
@@ -205,7 +228,7 @@ void rds_ib_remove_one(struct ib_device *device) | |||
205 | if (!rds_ibdev) | 228 | if (!rds_ibdev) |
206 | return; | 229 | return; |
207 | 230 | ||
208 | rds_ib_destroy_conns(rds_ibdev); | 231 | rds_ib_dev_shutdown(rds_ibdev); |
209 | 232 | ||
210 | /* | 233 | /* |
211 | * prevent future connection attempts from getting a reference to this | 234 | * prevent future connection attempts from getting a reference to this |