Skip to content

Commit a9b63e2

Browse files
sowminivMukesh Kacker
authored andcommitted
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. Orabug: 20930687 Upstream commit-id: c82ac7e Signed-off-by: Sowmini Varadhan <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Mukesh Kacker <[email protected]>
1 parent 945da83 commit a9b63e2

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
@@ -253,13 +253,22 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
253253
/* Creating normal conn */
254254
struct rds_connection *found;
255255

256-
found = rds_conn_lookup(head, laddr, faddr, trans, tos);
256+
if (!is_outgoing && otrans->t_type == RDS_TRANS_TCP)
257+
found = NULL;
258+
else
259+
found = rds_conn_lookup(head, laddr, faddr, trans, tos);
257260
if (found) {
258261
trans->conn_free(conn->c_transport_data);
259262
kmem_cache_free(rds_conn_slab, conn);
260263
conn = found;
261264
} else {
262-
hlist_add_head_rcu(&conn->c_hash_node, head);
265+
if ((is_outgoing && otrans->t_type == RDS_TRANS_TCP) ||
266+
(otrans->t_type != RDS_TRANS_TCP)) {
267+
/* Only the active side should be added to
268+
* reconnect list for RDS-TCP.
269+
*/
270+
hlist_add_head_rcu(&conn->c_hash_node, head);
271+
}
263272
rds_cong_add_conn(conn);
264273
rds_conn_count++;
265274
}

0 commit comments

Comments
 (0)