Skip to content

Commit c82ac7e

Browse files
sowminivdavem330
authored andcommitted
net/rds: RDS-TCP: only initiate reconnect attempt on outgoing TCP socket.
When the peer of an RDS-TCP connection restarts, a reconnect attempt should only be made from the active side of the TCP connection, i.e. the side that has a transient TCP port number. Do not add the passive side of the TCP connection to the c_hash_node and thus avoid triggering rds_queue_reconnect() for passive rds connections. Signed-off-by: Sowmini Varadhan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f711a6a commit c82ac7e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

net/rds/connection.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,22 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
234234
/* Creating normal conn */
235235
struct rds_connection *found;
236236

237-
found = rds_conn_lookup(head, laddr, faddr, trans);
237+
if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP)
238+
found = NULL;
239+
else
240+
found = rds_conn_lookup(head, laddr, faddr, trans);
238241
if (found) {
239242
trans->conn_free(conn->c_transport_data);
240243
kmem_cache_free(rds_conn_slab, conn);
241244
conn = found;
242245
} else {
243-
hlist_add_head_rcu(&conn->c_hash_node, head);
246+
if ((is_outgoing && otrans->t_type == RDS_TRANS_TCP) ||
247+
(otrans->t_type != RDS_TRANS_TCP)) {
248+
/* Only the active side should be added to
249+
* reconnect list for TCP.
250+
*/
251+
hlist_add_head_rcu(&conn->c_hash_node, head);
252+
}
244253
rds_cong_add_conn(conn);
245254
rds_conn_count++;
246255
}

0 commit comments

Comments
 (0)