Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2006 Oracle. All rights reserved. |
| 3 | * |
| 4 | * This software is available to you under a choice of one of two |
| 5 | * licenses. You may choose to be licensed under the terms of the GNU |
| 6 | * General Public License (GPL) Version 2, available from the file |
| 7 | * COPYING in the main directory of this source tree, or the |
| 8 | * OpenIB.org BSD license below: |
| 9 | * |
| 10 | * Redistribution and use in source and binary forms, with or |
| 11 | * without modification, are permitted provided that the following |
| 12 | * conditions are met: |
| 13 | * |
| 14 | * - Redistributions of source code must retain the above |
| 15 | * copyright notice, this list of conditions and the following |
| 16 | * disclaimer. |
| 17 | * |
| 18 | * - Redistributions in binary form must reproduce the above |
| 19 | * copyright notice, this list of conditions and the following |
| 20 | * disclaimer in the documentation and/or other materials |
| 21 | * provided with the distribution. |
| 22 | * |
| 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 25 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 26 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 27 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 28 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 30 | * SOFTWARE. |
| 31 | * |
| 32 | */ |
| 33 | #include <linux/kernel.h> |
| 34 | #include <linux/list.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 35 | #include <linux/slab.h> |
Paul Gortmaker | bc3b2d7 | 2011-07-15 11:47:34 -0400 | [diff] [blame] | 36 | #include <linux/export.h> |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 37 | #include <net/inet_hashtables.h> |
| 38 | |
Sowmini Varadhan | 0cb4396 | 2016-06-13 09:44:26 -0700 | [diff] [blame] | 39 | #include "rds_single_path.h" |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 40 | #include "rds.h" |
| 41 | #include "loop.h" |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 42 | |
| 43 | #define RDS_CONNECTION_HASH_BITS 12 |
| 44 | #define RDS_CONNECTION_HASH_ENTRIES (1 << RDS_CONNECTION_HASH_BITS) |
| 45 | #define RDS_CONNECTION_HASH_MASK (RDS_CONNECTION_HASH_ENTRIES - 1) |
| 46 | |
| 47 | /* converting this to RCU is a chore for another day.. */ |
| 48 | static DEFINE_SPINLOCK(rds_conn_lock); |
| 49 | static unsigned long rds_conn_count; |
| 50 | static struct hlist_head rds_conn_hash[RDS_CONNECTION_HASH_ENTRIES]; |
| 51 | static struct kmem_cache *rds_conn_slab; |
| 52 | |
| 53 | static struct hlist_head *rds_conn_bucket(__be32 laddr, __be32 faddr) |
| 54 | { |
Hannes Frederic Sowa | 1bbdcee | 2013-10-19 21:48:57 +0200 | [diff] [blame] | 55 | static u32 rds_hash_secret __read_mostly; |
| 56 | |
| 57 | unsigned long hash; |
| 58 | |
| 59 | net_get_random_once(&rds_hash_secret, sizeof(rds_hash_secret)); |
| 60 | |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 61 | /* Pass NULL, don't need struct net for hash */ |
Hannes Frederic Sowa | 1bbdcee | 2013-10-19 21:48:57 +0200 | [diff] [blame] | 62 | hash = __inet_ehashfn(be32_to_cpu(laddr), 0, |
| 63 | be32_to_cpu(faddr), 0, |
| 64 | rds_hash_secret); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 65 | return &rds_conn_hash[hash & RDS_CONNECTION_HASH_MASK]; |
| 66 | } |
| 67 | |
| 68 | #define rds_conn_info_set(var, test, suffix) do { \ |
| 69 | if (test) \ |
| 70 | var |= RDS_INFO_CONNECTION_FLAG_##suffix; \ |
| 71 | } while (0) |
| 72 | |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 73 | /* rcu read lock must be held or the connection spinlock */ |
Sowmini Varadhan | 8f384c0 | 2015-09-03 16:24:52 -0400 | [diff] [blame] | 74 | static struct rds_connection *rds_conn_lookup(struct net *net, |
| 75 | struct hlist_head *head, |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 76 | __be32 laddr, __be32 faddr, |
| 77 | struct rds_transport *trans) |
| 78 | { |
| 79 | struct rds_connection *conn, *ret = NULL; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 80 | |
Sasha Levin | b67bfe0 | 2013-02-27 17:06:00 -0800 | [diff] [blame] | 81 | hlist_for_each_entry_rcu(conn, head, c_hash_node) { |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 82 | if (conn->c_faddr == faddr && conn->c_laddr == laddr && |
Sowmini Varadhan | 8f384c0 | 2015-09-03 16:24:52 -0400 | [diff] [blame] | 83 | conn->c_trans == trans && net == rds_conn_net(conn)) { |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 84 | ret = conn; |
| 85 | break; |
| 86 | } |
| 87 | } |
| 88 | rdsdebug("returning conn %p for %pI4 -> %pI4\n", ret, |
| 89 | &laddr, &faddr); |
| 90 | return ret; |
| 91 | } |
| 92 | |
| 93 | /* |
| 94 | * This is called by transports as they're bringing down a connection. |
| 95 | * It clears partial message state so that the transport can start sending |
| 96 | * and receiving over this connection again in the future. It is up to |
| 97 | * the transport to have serialized this call with its send and recv. |
| 98 | */ |
stephen hemminger | ff51bf8 | 2010-10-19 08:08:33 +0000 | [diff] [blame] | 99 | static void rds_conn_reset(struct rds_connection *conn) |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 100 | { |
| 101 | rdsdebug("connection %pI4 to %pI4 reset\n", |
| 102 | &conn->c_laddr, &conn->c_faddr); |
| 103 | |
| 104 | rds_stats_inc(s_conn_reset); |
| 105 | rds_send_reset(conn); |
| 106 | conn->c_flags = 0; |
| 107 | |
| 108 | /* Do not clear next_rx_seq here, else we cannot distinguish |
| 109 | * retransmitted packets from new packets, and will hand all |
| 110 | * of them to the application. That is not consistent with the |
| 111 | * reliability guarantees of RDS. */ |
| 112 | } |
| 113 | |
Sowmini Varadhan | 1c5113c | 2016-06-13 09:44:40 -0700 | [diff] [blame^] | 114 | static void __rds_conn_path_init(struct rds_connection *conn, |
| 115 | struct rds_conn_path *cp, bool is_outgoing) |
| 116 | { |
| 117 | spin_lock_init(&cp->cp_lock); |
| 118 | cp->cp_next_tx_seq = 1; |
| 119 | init_waitqueue_head(&cp->cp_waitq); |
| 120 | INIT_LIST_HEAD(&cp->cp_send_queue); |
| 121 | INIT_LIST_HEAD(&cp->cp_retrans); |
| 122 | |
| 123 | cp->cp_conn = conn; |
| 124 | atomic_set(&cp->cp_state, RDS_CONN_DOWN); |
| 125 | cp->cp_send_gen = 0; |
| 126 | /* cp_outgoing is per-path. So we can only set it here |
| 127 | * for the single-path transports. |
| 128 | */ |
| 129 | if (!conn->c_trans->t_mp_capable) |
| 130 | cp->cp_outgoing = (is_outgoing ? 1 : 0); |
| 131 | cp->cp_reconnect_jiffies = 0; |
| 132 | INIT_DELAYED_WORK(&cp->cp_send_w, rds_send_worker); |
| 133 | INIT_DELAYED_WORK(&cp->cp_recv_w, rds_recv_worker); |
| 134 | INIT_DELAYED_WORK(&cp->cp_conn_w, rds_connect_worker); |
| 135 | INIT_WORK(&cp->cp_down_w, rds_shutdown_worker); |
| 136 | mutex_init(&cp->cp_cm_lock); |
| 137 | cp->cp_flags = 0; |
| 138 | } |
| 139 | |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 140 | /* |
| 141 | * There is only every one 'conn' for a given pair of addresses in the |
| 142 | * system at a time. They contain messages to be retransmitted and so |
| 143 | * span the lifetime of the actual underlying transport connections. |
| 144 | * |
| 145 | * For now they are not garbage collected once they're created. They |
| 146 | * are torn down as the module is removed, if ever. |
| 147 | */ |
Sowmini Varadhan | d5a8ac2 | 2015-08-05 01:43:25 -0400 | [diff] [blame] | 148 | static struct rds_connection *__rds_conn_create(struct net *net, |
| 149 | __be32 laddr, __be32 faddr, |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 150 | struct rds_transport *trans, gfp_t gfp, |
| 151 | int is_outgoing) |
| 152 | { |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 153 | struct rds_connection *conn, *parent = NULL; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 154 | struct hlist_head *head = rds_conn_bucket(laddr, faddr); |
Zach Brown | 5adb5bc | 2010-07-23 10:32:31 -0700 | [diff] [blame] | 155 | struct rds_transport *loop_trans; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 156 | unsigned long flags; |
| 157 | int ret; |
| 158 | |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 159 | rcu_read_lock(); |
Sowmini Varadhan | 8f384c0 | 2015-09-03 16:24:52 -0400 | [diff] [blame] | 160 | conn = rds_conn_lookup(net, head, laddr, faddr, trans); |
Joe Perches | f64f9e7 | 2009-11-29 16:55:45 -0800 | [diff] [blame] | 161 | if (conn && conn->c_loopback && conn->c_trans != &rds_loop_transport && |
Sowmini Varadhan | 1789b2c07 | 2015-04-08 12:33:46 -0400 | [diff] [blame] | 162 | laddr == faddr && !is_outgoing) { |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 163 | /* This is a looped back IB connection, and we're |
| 164 | * called by the code handling the incoming connect. |
| 165 | * We need a second connection object into which we |
| 166 | * can stick the other QP. */ |
| 167 | parent = conn; |
| 168 | conn = parent->c_passive; |
| 169 | } |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 170 | rcu_read_unlock(); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 171 | if (conn) |
| 172 | goto out; |
| 173 | |
Wei Yongjun | 05a178e | 2009-04-09 14:09:44 +0000 | [diff] [blame] | 174 | conn = kmem_cache_zalloc(rds_conn_slab, gfp); |
Andy Grover | 8690bfa | 2010-01-12 11:56:44 -0800 | [diff] [blame] | 175 | if (!conn) { |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 176 | conn = ERR_PTR(-ENOMEM); |
| 177 | goto out; |
| 178 | } |
| 179 | |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 180 | INIT_HLIST_NODE(&conn->c_hash_node); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 181 | conn->c_laddr = laddr; |
| 182 | conn->c_faddr = faddr; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 183 | |
Sowmini Varadhan | 1c5113c | 2016-06-13 09:44:40 -0700 | [diff] [blame^] | 184 | rds_conn_net_set(conn, net); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 185 | |
| 186 | ret = rds_cong_get_maps(conn); |
| 187 | if (ret) { |
| 188 | kmem_cache_free(rds_conn_slab, conn); |
| 189 | conn = ERR_PTR(ret); |
| 190 | goto out; |
| 191 | } |
| 192 | |
| 193 | /* |
| 194 | * This is where a connection becomes loopback. If *any* RDS sockets |
| 195 | * can bind to the destination address then we'd rather the messages |
| 196 | * flow through loopback rather than either transport. |
| 197 | */ |
Sowmini Varadhan | d5a8ac2 | 2015-08-05 01:43:25 -0400 | [diff] [blame] | 198 | loop_trans = rds_trans_get_preferred(net, faddr); |
Zach Brown | 5adb5bc | 2010-07-23 10:32:31 -0700 | [diff] [blame] | 199 | if (loop_trans) { |
| 200 | rds_trans_put(loop_trans); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 201 | conn->c_loopback = 1; |
| 202 | if (is_outgoing && trans->t_prefer_loopback) { |
| 203 | /* "outgoing" connection - and the transport |
| 204 | * says it wants the connection handled by the |
| 205 | * loopback transport. This is what TCP does. |
| 206 | */ |
| 207 | trans = &rds_loop_transport; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | conn->c_trans = trans; |
| 212 | |
| 213 | ret = trans->conn_alloc(conn, gfp); |
| 214 | if (ret) { |
| 215 | kmem_cache_free(rds_conn_slab, conn); |
| 216 | conn = ERR_PTR(ret); |
| 217 | goto out; |
| 218 | } |
| 219 | |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 220 | rdsdebug("allocated conn %p for %pI4 -> %pI4 over %s %s\n", |
| 221 | conn, &laddr, &faddr, |
| 222 | trans->t_name ? trans->t_name : "[unknown]", |
| 223 | is_outgoing ? "(outgoing)" : ""); |
| 224 | |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 225 | /* |
| 226 | * Since we ran without holding the conn lock, someone could |
| 227 | * have created the same conn (either normal or passive) in the |
| 228 | * interim. We check while holding the lock. If we won, we complete |
| 229 | * init and return our conn. If we lost, we rollback and return the |
| 230 | * other one. |
| 231 | */ |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 232 | spin_lock_irqsave(&rds_conn_lock, flags); |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 233 | if (parent) { |
| 234 | /* Creating passive conn */ |
| 235 | if (parent->c_passive) { |
Sowmini Varadhan | 1c5113c | 2016-06-13 09:44:40 -0700 | [diff] [blame^] | 236 | trans->conn_free(conn->c_path[0].cp_transport_data); |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 237 | kmem_cache_free(rds_conn_slab, conn); |
| 238 | conn = parent->c_passive; |
| 239 | } else { |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 240 | parent->c_passive = conn; |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 241 | rds_cong_add_conn(conn); |
| 242 | rds_conn_count++; |
| 243 | } |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 244 | } else { |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 245 | /* Creating normal conn */ |
| 246 | struct rds_connection *found; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 247 | |
Sowmini Varadhan | 3b20fc3 | 2015-09-30 16:54:07 -0400 | [diff] [blame] | 248 | found = rds_conn_lookup(net, head, laddr, faddr, trans); |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 249 | if (found) { |
Sowmini Varadhan | 1c5113c | 2016-06-13 09:44:40 -0700 | [diff] [blame^] | 250 | struct rds_conn_path *cp; |
| 251 | int i; |
| 252 | |
| 253 | for (i = 0; i < RDS_MPATH_WORKERS; i++) { |
| 254 | cp = &conn->c_path[i]; |
| 255 | trans->conn_free(cp->cp_transport_data); |
| 256 | if (!trans->t_mp_capable) |
| 257 | break; |
| 258 | } |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 259 | kmem_cache_free(rds_conn_slab, conn); |
| 260 | conn = found; |
| 261 | } else { |
Sowmini Varadhan | 1c5113c | 2016-06-13 09:44:40 -0700 | [diff] [blame^] | 262 | int i; |
| 263 | |
| 264 | for (i = 0; i < RDS_MPATH_WORKERS; i++) { |
| 265 | __rds_conn_path_init(conn, &conn->c_path[i], |
| 266 | is_outgoing); |
| 267 | conn->c_path[i].cp_index = i; |
| 268 | } |
| 269 | |
Sowmini Varadhan | 3b20fc3 | 2015-09-30 16:54:07 -0400 | [diff] [blame] | 270 | hlist_add_head_rcu(&conn->c_hash_node, head); |
Andy Grover | cb24405 | 2009-07-17 13:13:36 +0000 | [diff] [blame] | 271 | rds_cong_add_conn(conn); |
| 272 | rds_conn_count++; |
| 273 | } |
| 274 | } |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 275 | spin_unlock_irqrestore(&rds_conn_lock, flags); |
| 276 | |
| 277 | out: |
| 278 | return conn; |
| 279 | } |
| 280 | |
Sowmini Varadhan | d5a8ac2 | 2015-08-05 01:43:25 -0400 | [diff] [blame] | 281 | struct rds_connection *rds_conn_create(struct net *net, |
| 282 | __be32 laddr, __be32 faddr, |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 283 | struct rds_transport *trans, gfp_t gfp) |
| 284 | { |
Sowmini Varadhan | d5a8ac2 | 2015-08-05 01:43:25 -0400 | [diff] [blame] | 285 | return __rds_conn_create(net, laddr, faddr, trans, gfp, 0); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 286 | } |
Andy Grover | 616b757 | 2009-08-21 12:28:32 +0000 | [diff] [blame] | 287 | EXPORT_SYMBOL_GPL(rds_conn_create); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 288 | |
Sowmini Varadhan | d5a8ac2 | 2015-08-05 01:43:25 -0400 | [diff] [blame] | 289 | struct rds_connection *rds_conn_create_outgoing(struct net *net, |
| 290 | __be32 laddr, __be32 faddr, |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 291 | struct rds_transport *trans, gfp_t gfp) |
| 292 | { |
Sowmini Varadhan | d5a8ac2 | 2015-08-05 01:43:25 -0400 | [diff] [blame] | 293 | return __rds_conn_create(net, laddr, faddr, trans, gfp, 1); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 294 | } |
Andy Grover | 616b757 | 2009-08-21 12:28:32 +0000 | [diff] [blame] | 295 | EXPORT_SYMBOL_GPL(rds_conn_create_outgoing); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 296 | |
Andy Grover | 2dc3935 | 2010-06-11 13:49:13 -0700 | [diff] [blame] | 297 | void rds_conn_shutdown(struct rds_connection *conn) |
| 298 | { |
| 299 | /* shut it down unless it's down already */ |
| 300 | if (!rds_conn_transition(conn, RDS_CONN_DOWN, RDS_CONN_DOWN)) { |
| 301 | /* |
| 302 | * Quiesce the connection mgmt handlers before we start tearing |
| 303 | * things down. We don't hold the mutex for the entire |
| 304 | * duration of the shutdown operation, else we may be |
| 305 | * deadlocking with the CM handler. Instead, the CM event |
| 306 | * handler is supposed to check for state DISCONNECTING |
| 307 | */ |
| 308 | mutex_lock(&conn->c_cm_lock); |
| 309 | if (!rds_conn_transition(conn, RDS_CONN_UP, RDS_CONN_DISCONNECTING) |
| 310 | && !rds_conn_transition(conn, RDS_CONN_ERROR, RDS_CONN_DISCONNECTING)) { |
| 311 | rds_conn_error(conn, "shutdown called in state %d\n", |
| 312 | atomic_read(&conn->c_state)); |
| 313 | mutex_unlock(&conn->c_cm_lock); |
| 314 | return; |
| 315 | } |
| 316 | mutex_unlock(&conn->c_cm_lock); |
| 317 | |
Zach Brown | 0f4b1c7 | 2010-06-04 14:41:41 -0700 | [diff] [blame] | 318 | wait_event(conn->c_waitq, |
| 319 | !test_bit(RDS_IN_XMIT, &conn->c_flags)); |
santosh.shilimkar@oracle.com | 73ce431 | 2015-08-22 15:45:26 -0700 | [diff] [blame] | 320 | wait_event(conn->c_waitq, |
| 321 | !test_bit(RDS_RECV_REFILL, &conn->c_flags)); |
Chris Mason | 7e3f295 | 2010-05-11 15:11:11 -0700 | [diff] [blame] | 322 | |
Andy Grover | 2dc3935 | 2010-06-11 13:49:13 -0700 | [diff] [blame] | 323 | conn->c_trans->conn_shutdown(conn); |
| 324 | rds_conn_reset(conn); |
Andy Grover | 2dc3935 | 2010-06-11 13:49:13 -0700 | [diff] [blame] | 325 | |
| 326 | if (!rds_conn_transition(conn, RDS_CONN_DISCONNECTING, RDS_CONN_DOWN)) { |
| 327 | /* This can happen - eg when we're in the middle of tearing |
| 328 | * down the connection, and someone unloads the rds module. |
| 329 | * Quite reproduceable with loopback connections. |
| 330 | * Mostly harmless. |
| 331 | */ |
| 332 | rds_conn_error(conn, |
| 333 | "%s: failed to transition to state DOWN, " |
| 334 | "current state is %d\n", |
| 335 | __func__, |
| 336 | atomic_read(&conn->c_state)); |
| 337 | return; |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | /* Then reconnect if it's still live. |
| 342 | * The passive side of an IB loopback connection is never added |
| 343 | * to the conn hash, so we never trigger a reconnect on this |
| 344 | * conn - the reconnect is always triggered by the active peer. */ |
| 345 | cancel_delayed_work_sync(&conn->c_conn_w); |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 346 | rcu_read_lock(); |
| 347 | if (!hlist_unhashed(&conn->c_hash_node)) { |
| 348 | rcu_read_unlock(); |
Sowmini Varadhan | 3b20fc3 | 2015-09-30 16:54:07 -0400 | [diff] [blame] | 349 | if (conn->c_trans->t_type != RDS_TRANS_TCP || |
Sowmini Varadhan | 0cb4396 | 2016-06-13 09:44:26 -0700 | [diff] [blame] | 350 | conn->c_path[0].cp_outgoing == 1) |
| 351 | rds_queue_reconnect(&conn->c_path[0]); |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 352 | } else { |
| 353 | rcu_read_unlock(); |
| 354 | } |
Andy Grover | 2dc3935 | 2010-06-11 13:49:13 -0700 | [diff] [blame] | 355 | } |
| 356 | |
| 357 | /* |
| 358 | * Stop and free a connection. |
Zach Brown | ffcec0e | 2010-07-23 10:36:58 -0700 | [diff] [blame] | 359 | * |
| 360 | * This can only be used in very limited circumstances. It assumes that once |
| 361 | * the conn has been shutdown that no one else is referencing the connection. |
| 362 | * We can only ensure this in the rmmod path in the current code. |
Andy Grover | 2dc3935 | 2010-06-11 13:49:13 -0700 | [diff] [blame] | 363 | */ |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 364 | void rds_conn_destroy(struct rds_connection *conn) |
| 365 | { |
| 366 | struct rds_message *rm, *rtmp; |
Zach Brown | fe8ff6b | 2010-07-23 10:30:45 -0700 | [diff] [blame] | 367 | unsigned long flags; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 368 | |
| 369 | rdsdebug("freeing conn %p for %pI4 -> " |
| 370 | "%pI4\n", conn, &conn->c_laddr, |
| 371 | &conn->c_faddr); |
| 372 | |
Chris Mason | abf4543 | 2010-05-11 15:14:52 -0700 | [diff] [blame] | 373 | /* Ensure conn will not be scheduled for reconnect */ |
| 374 | spin_lock_irq(&rds_conn_lock); |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 375 | hlist_del_init_rcu(&conn->c_hash_node); |
Chris Mason | abf4543 | 2010-05-11 15:14:52 -0700 | [diff] [blame] | 376 | spin_unlock_irq(&rds_conn_lock); |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 377 | synchronize_rcu(); |
| 378 | |
Zach Brown | ffcec0e | 2010-07-23 10:36:58 -0700 | [diff] [blame] | 379 | /* shut the connection down */ |
| 380 | rds_conn_drop(conn); |
| 381 | flush_work(&conn->c_down_w); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 382 | |
Zach Brown | 4518071 | 2010-07-23 10:37:33 -0700 | [diff] [blame] | 383 | /* make sure lingering queued work won't try to ref the conn */ |
| 384 | cancel_delayed_work_sync(&conn->c_send_w); |
| 385 | cancel_delayed_work_sync(&conn->c_recv_w); |
| 386 | |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 387 | /* tear down queued messages */ |
| 388 | list_for_each_entry_safe(rm, rtmp, |
| 389 | &conn->c_send_queue, |
| 390 | m_conn_item) { |
| 391 | list_del_init(&rm->m_conn_item); |
| 392 | BUG_ON(!list_empty(&rm->m_sock_item)); |
| 393 | rds_message_put(rm); |
| 394 | } |
| 395 | if (conn->c_xmit_rm) |
| 396 | rds_message_put(conn->c_xmit_rm); |
| 397 | |
| 398 | conn->c_trans->conn_free(conn->c_transport_data); |
| 399 | |
| 400 | /* |
| 401 | * The congestion maps aren't freed up here. They're |
| 402 | * freed by rds_cong_exit() after all the connections |
| 403 | * have been freed. |
| 404 | */ |
| 405 | rds_cong_remove_conn(conn); |
| 406 | |
| 407 | BUG_ON(!list_empty(&conn->c_retrans)); |
| 408 | kmem_cache_free(rds_conn_slab, conn); |
| 409 | |
Zach Brown | fe8ff6b | 2010-07-23 10:30:45 -0700 | [diff] [blame] | 410 | spin_lock_irqsave(&rds_conn_lock, flags); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 411 | rds_conn_count--; |
Zach Brown | fe8ff6b | 2010-07-23 10:30:45 -0700 | [diff] [blame] | 412 | spin_unlock_irqrestore(&rds_conn_lock, flags); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 413 | } |
Andy Grover | 616b757 | 2009-08-21 12:28:32 +0000 | [diff] [blame] | 414 | EXPORT_SYMBOL_GPL(rds_conn_destroy); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 415 | |
| 416 | static void rds_conn_message_info(struct socket *sock, unsigned int len, |
| 417 | struct rds_info_iterator *iter, |
| 418 | struct rds_info_lengths *lens, |
| 419 | int want_send) |
| 420 | { |
| 421 | struct hlist_head *head; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 422 | struct list_head *list; |
| 423 | struct rds_connection *conn; |
| 424 | struct rds_message *rm; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 425 | unsigned int total = 0; |
Zach Brown | 501dccc | 2010-06-04 14:25:27 -0700 | [diff] [blame] | 426 | unsigned long flags; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 427 | size_t i; |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 428 | int j; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 429 | |
| 430 | len /= sizeof(struct rds_info_message); |
| 431 | |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 432 | rcu_read_lock(); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 433 | |
| 434 | for (i = 0, head = rds_conn_hash; i < ARRAY_SIZE(rds_conn_hash); |
| 435 | i++, head++) { |
Sasha Levin | b67bfe0 | 2013-02-27 17:06:00 -0800 | [diff] [blame] | 436 | hlist_for_each_entry_rcu(conn, head, c_hash_node) { |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 437 | struct rds_conn_path *cp; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 438 | |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 439 | for (j = 0; j < RDS_MPATH_WORKERS; j++) { |
| 440 | cp = &conn->c_path[j]; |
| 441 | if (want_send) |
| 442 | list = &cp->cp_send_queue; |
| 443 | else |
| 444 | list = &cp->cp_retrans; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 445 | |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 446 | spin_lock_irqsave(&cp->cp_lock, flags); |
| 447 | |
| 448 | /* XXX too lazy to maintain counts.. */ |
| 449 | list_for_each_entry(rm, list, m_conn_item) { |
| 450 | total++; |
| 451 | if (total <= len) |
| 452 | rds_inc_info_copy(&rm->m_inc, |
| 453 | iter, |
| 454 | conn->c_laddr, |
| 455 | conn->c_faddr, |
| 456 | 0); |
| 457 | } |
| 458 | |
| 459 | spin_unlock_irqrestore(&cp->cp_lock, flags); |
| 460 | if (!conn->c_trans->t_mp_capable) |
| 461 | break; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 462 | } |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 463 | } |
| 464 | } |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 465 | rcu_read_unlock(); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 466 | |
| 467 | lens->nr = total; |
| 468 | lens->each = sizeof(struct rds_info_message); |
| 469 | } |
| 470 | |
| 471 | static void rds_conn_message_info_send(struct socket *sock, unsigned int len, |
| 472 | struct rds_info_iterator *iter, |
| 473 | struct rds_info_lengths *lens) |
| 474 | { |
| 475 | rds_conn_message_info(sock, len, iter, lens, 1); |
| 476 | } |
| 477 | |
| 478 | static void rds_conn_message_info_retrans(struct socket *sock, |
| 479 | unsigned int len, |
| 480 | struct rds_info_iterator *iter, |
| 481 | struct rds_info_lengths *lens) |
| 482 | { |
| 483 | rds_conn_message_info(sock, len, iter, lens, 0); |
| 484 | } |
| 485 | |
| 486 | void rds_for_each_conn_info(struct socket *sock, unsigned int len, |
| 487 | struct rds_info_iterator *iter, |
| 488 | struct rds_info_lengths *lens, |
| 489 | int (*visitor)(struct rds_connection *, void *), |
| 490 | size_t item_len) |
| 491 | { |
| 492 | uint64_t buffer[(item_len + 7) / 8]; |
| 493 | struct hlist_head *head; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 494 | struct rds_connection *conn; |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 495 | size_t i; |
| 496 | |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 497 | rcu_read_lock(); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 498 | |
| 499 | lens->nr = 0; |
| 500 | lens->each = item_len; |
| 501 | |
| 502 | for (i = 0, head = rds_conn_hash; i < ARRAY_SIZE(rds_conn_hash); |
| 503 | i++, head++) { |
Sasha Levin | b67bfe0 | 2013-02-27 17:06:00 -0800 | [diff] [blame] | 504 | hlist_for_each_entry_rcu(conn, head, c_hash_node) { |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 505 | |
| 506 | /* XXX no c_lock usage.. */ |
| 507 | if (!visitor(conn, buffer)) |
| 508 | continue; |
| 509 | |
| 510 | /* We copy as much as we can fit in the buffer, |
| 511 | * but we count all items so that the caller |
| 512 | * can resize the buffer. */ |
| 513 | if (len >= item_len) { |
| 514 | rds_info_copy(iter, buffer, item_len); |
| 515 | len -= item_len; |
| 516 | } |
| 517 | lens->nr++; |
| 518 | } |
| 519 | } |
Chris Mason | bcf50ef | 2010-05-11 15:15:15 -0700 | [diff] [blame] | 520 | rcu_read_unlock(); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 521 | } |
Andy Grover | 616b757 | 2009-08-21 12:28:32 +0000 | [diff] [blame] | 522 | EXPORT_SYMBOL_GPL(rds_for_each_conn_info); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 523 | |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 524 | void rds_walk_conn_path_info(struct socket *sock, unsigned int len, |
| 525 | struct rds_info_iterator *iter, |
| 526 | struct rds_info_lengths *lens, |
| 527 | int (*visitor)(struct rds_conn_path *, void *), |
| 528 | size_t item_len) |
| 529 | { |
| 530 | u64 buffer[(item_len + 7) / 8]; |
| 531 | struct hlist_head *head; |
| 532 | struct rds_connection *conn; |
| 533 | size_t i; |
| 534 | int j; |
| 535 | |
| 536 | rcu_read_lock(); |
| 537 | |
| 538 | lens->nr = 0; |
| 539 | lens->each = item_len; |
| 540 | |
| 541 | for (i = 0, head = rds_conn_hash; i < ARRAY_SIZE(rds_conn_hash); |
| 542 | i++, head++) { |
| 543 | hlist_for_each_entry_rcu(conn, head, c_hash_node) { |
| 544 | struct rds_conn_path *cp; |
| 545 | |
| 546 | for (j = 0; j < RDS_MPATH_WORKERS; j++) { |
| 547 | cp = &conn->c_path[j]; |
| 548 | |
| 549 | /* XXX no cp_lock usage.. */ |
| 550 | if (!visitor(cp, buffer)) |
| 551 | continue; |
| 552 | if (!conn->c_trans->t_mp_capable) |
| 553 | break; |
| 554 | } |
| 555 | |
| 556 | /* We copy as much as we can fit in the buffer, |
| 557 | * but we count all items so that the caller |
| 558 | * can resize the buffer. |
| 559 | */ |
| 560 | if (len >= item_len) { |
| 561 | rds_info_copy(iter, buffer, item_len); |
| 562 | len -= item_len; |
| 563 | } |
| 564 | lens->nr++; |
| 565 | } |
| 566 | } |
| 567 | rcu_read_unlock(); |
| 568 | } |
| 569 | |
| 570 | static int rds_conn_info_visitor(struct rds_conn_path *cp, void *buffer) |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 571 | { |
| 572 | struct rds_info_connection *cinfo = buffer; |
| 573 | |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 574 | cinfo->next_tx_seq = cp->cp_next_tx_seq; |
| 575 | cinfo->next_rx_seq = cp->cp_next_rx_seq; |
| 576 | cinfo->laddr = cp->cp_conn->c_laddr; |
| 577 | cinfo->faddr = cp->cp_conn->c_faddr; |
| 578 | strncpy(cinfo->transport, cp->cp_conn->c_trans->t_name, |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 579 | sizeof(cinfo->transport)); |
| 580 | cinfo->flags = 0; |
| 581 | |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 582 | rds_conn_info_set(cinfo->flags, test_bit(RDS_IN_XMIT, &cp->cp_flags), |
Zach Brown | 0f4b1c7 | 2010-06-04 14:41:41 -0700 | [diff] [blame] | 583 | SENDING); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 584 | /* XXX Future: return the state rather than these funky bits */ |
| 585 | rds_conn_info_set(cinfo->flags, |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 586 | atomic_read(&cp->cp_state) == RDS_CONN_CONNECTING, |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 587 | CONNECTING); |
| 588 | rds_conn_info_set(cinfo->flags, |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 589 | atomic_read(&cp->cp_state) == RDS_CONN_UP, |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 590 | CONNECTED); |
| 591 | return 1; |
| 592 | } |
| 593 | |
| 594 | static void rds_conn_info(struct socket *sock, unsigned int len, |
| 595 | struct rds_info_iterator *iter, |
| 596 | struct rds_info_lengths *lens) |
| 597 | { |
Sowmini Varadhan | 992c9ec | 2016-06-13 09:44:38 -0700 | [diff] [blame] | 598 | rds_walk_conn_path_info(sock, len, iter, lens, |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 599 | rds_conn_info_visitor, |
| 600 | sizeof(struct rds_info_connection)); |
| 601 | } |
| 602 | |
Zach Brown | ef87b7e | 2010-07-09 12:26:20 -0700 | [diff] [blame] | 603 | int rds_conn_init(void) |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 604 | { |
| 605 | rds_conn_slab = kmem_cache_create("rds_connection", |
| 606 | sizeof(struct rds_connection), |
| 607 | 0, 0, NULL); |
Andy Grover | 8690bfa | 2010-01-12 11:56:44 -0800 | [diff] [blame] | 608 | if (!rds_conn_slab) |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 609 | return -ENOMEM; |
| 610 | |
| 611 | rds_info_register_func(RDS_INFO_CONNECTIONS, rds_conn_info); |
| 612 | rds_info_register_func(RDS_INFO_SEND_MESSAGES, |
| 613 | rds_conn_message_info_send); |
| 614 | rds_info_register_func(RDS_INFO_RETRANS_MESSAGES, |
| 615 | rds_conn_message_info_retrans); |
| 616 | |
| 617 | return 0; |
| 618 | } |
| 619 | |
| 620 | void rds_conn_exit(void) |
| 621 | { |
| 622 | rds_loop_exit(); |
| 623 | |
| 624 | WARN_ON(!hlist_empty(rds_conn_hash)); |
| 625 | |
| 626 | kmem_cache_destroy(rds_conn_slab); |
| 627 | |
| 628 | rds_info_deregister_func(RDS_INFO_CONNECTIONS, rds_conn_info); |
| 629 | rds_info_deregister_func(RDS_INFO_SEND_MESSAGES, |
| 630 | rds_conn_message_info_send); |
| 631 | rds_info_deregister_func(RDS_INFO_RETRANS_MESSAGES, |
| 632 | rds_conn_message_info_retrans); |
| 633 | } |
| 634 | |
| 635 | /* |
| 636 | * Force a disconnect |
| 637 | */ |
Sowmini Varadhan | 0cb4396 | 2016-06-13 09:44:26 -0700 | [diff] [blame] | 638 | void rds_conn_path_drop(struct rds_conn_path *cp) |
| 639 | { |
| 640 | atomic_set(&cp->cp_state, RDS_CONN_ERROR); |
| 641 | queue_work(rds_wq, &cp->cp_down_w); |
| 642 | } |
| 643 | EXPORT_SYMBOL_GPL(rds_conn_path_drop); |
| 644 | |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 645 | void rds_conn_drop(struct rds_connection *conn) |
| 646 | { |
Sowmini Varadhan | 0cb4396 | 2016-06-13 09:44:26 -0700 | [diff] [blame] | 647 | rds_conn_path_drop(&conn->c_path[0]); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 648 | } |
Andy Grover | 616b757 | 2009-08-21 12:28:32 +0000 | [diff] [blame] | 649 | EXPORT_SYMBOL_GPL(rds_conn_drop); |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 650 | |
| 651 | /* |
Zach Brown | f3c6808 | 2010-05-24 13:14:36 -0700 | [diff] [blame] | 652 | * If the connection is down, trigger a connect. We may have scheduled a |
| 653 | * delayed reconnect however - in this case we should not interfere. |
| 654 | */ |
Sowmini Varadhan | 3c0a590 | 2016-06-13 09:44:37 -0700 | [diff] [blame] | 655 | void rds_conn_path_connect_if_down(struct rds_conn_path *cp) |
| 656 | { |
| 657 | if (rds_conn_path_state(cp) == RDS_CONN_DOWN && |
| 658 | !test_and_set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags)) |
| 659 | queue_delayed_work(rds_wq, &cp->cp_conn_w, 0); |
| 660 | } |
| 661 | |
Zach Brown | f3c6808 | 2010-05-24 13:14:36 -0700 | [diff] [blame] | 662 | void rds_conn_connect_if_down(struct rds_connection *conn) |
| 663 | { |
Sowmini Varadhan | 3c0a590 | 2016-06-13 09:44:37 -0700 | [diff] [blame] | 664 | WARN_ON(conn->c_trans->t_mp_capable); |
| 665 | rds_conn_path_connect_if_down(&conn->c_path[0]); |
Zach Brown | f3c6808 | 2010-05-24 13:14:36 -0700 | [diff] [blame] | 666 | } |
| 667 | EXPORT_SYMBOL_GPL(rds_conn_connect_if_down); |
| 668 | |
| 669 | /* |
Andy Grover | 00e0f34 | 2009-02-24 15:30:23 +0000 | [diff] [blame] | 670 | * An error occurred on the connection |
| 671 | */ |
| 672 | void |
| 673 | __rds_conn_error(struct rds_connection *conn, const char *fmt, ...) |
| 674 | { |
| 675 | va_list ap; |
| 676 | |
| 677 | va_start(ap, fmt); |
| 678 | vprintk(fmt, ap); |
| 679 | va_end(ap); |
| 680 | |
| 681 | rds_conn_drop(conn); |
| 682 | } |
Sowmini Varadhan | fb1b3dc | 2016-06-13 09:44:39 -0700 | [diff] [blame] | 683 | |
| 684 | void |
| 685 | __rds_conn_path_error(struct rds_conn_path *cp, const char *fmt, ...) |
| 686 | { |
| 687 | va_list ap; |
| 688 | |
| 689 | va_start(ap, fmt); |
| 690 | vprintk(fmt, ap); |
| 691 | va_end(ap); |
| 692 | |
| 693 | rds_conn_path_drop(cp); |
| 694 | } |