From 69b92b5b7419846e2a0d61a097b11b17a089e046 Mon Sep 17 00:00:00 2001 From: Sowmini Varadhan Date: Wed, 21 Jun 2017 13:40:12 -0700 Subject: rds: tcp: send handshake ping-probe from passive endpoint The RDS handshake ping probe added by commit 5916e2c1554f ("RDS: TCP: Enable multipath RDS for TCP") is sent from rds_sendmsg() before the first data packet is sent to a peer. If the conversation is not bidirectional (i.e., one side is always passive and never invokes rds_sendmsg()) and the passive side restarts its rds_tcp module, a new HS ping probe needs to be sent, so that the number of paths can be re-established. This patch achieves that by sending a HS ping probe from rds_tcp_accept_one() when c_npaths is 0 (i.e., we have not done a handshake probe with this peer yet). Signed-off-by: Sowmini Varadhan Tested-by: Jenny Xu Signed-off-by: David S. Miller --- net/rds/recv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'net/rds/recv.c') diff --git a/net/rds/recv.c b/net/rds/recv.c index 49493dbc43a1..373a6aa1d976 100644 --- a/net/rds/recv.c +++ b/net/rds/recv.c @@ -227,6 +227,7 @@ static void rds_recv_hs_exthdrs(struct rds_header *hdr, } /* if RDS_EXTHDR_NPATHS was not found, default to a single-path */ conn->c_npaths = max_t(int, conn->c_npaths, 1); + conn->c_ping_triggered = 0; rds_conn_peer_gen_update(conn, new_peer_gen_num); } @@ -244,8 +245,7 @@ static void rds_recv_hs_exthdrs(struct rds_header *hdr, * called after reception of the probe-pong on all mprds_paths. * Otherwise (sender of probe-ping is not the smaller ip addr): just call * rds_conn_path_connect_if_down on the hashed path. (see rule 4) - * 4. when cp_index > 0, rds_connect_worker must only trigger - * a connection if laddr < faddr. + * 4. rds_connect_worker must only trigger a connection if laddr < faddr. * 5. sender may end up queuing the packet on the cp. will get sent out later. * when connection is completed. */ @@ -256,7 +256,7 @@ static void rds_start_mprds(struct rds_connection *conn) if (conn->c_npaths > 1 && IS_CANONICAL(conn->c_laddr, conn->c_faddr)) { - for (i = 1; i < conn->c_npaths; i++) { + for (i = 0; i < conn->c_npaths; i++) { cp = &conn->c_path[i]; rds_conn_path_connect_if_down(cp); } -- cgit