Skip to content

Commit 9ef845f

Browse files
Rao Shoaibdavem330
authored andcommitted
rds: If one path needs re-connection, check all and re-connect
In testing with mprds enabled, Oracle Cluster nodes after reboot were not able to communicate with others nodes and so failed to rejoin the cluster. Peers with lower IP address initiated connection but the node could not respond as it choose a different path and could not initiate a connection as it had a higher IP address. With this patch, when a node sends out a packet and the selected path is down, all other paths are also checked and any down paths are re-connected. Reviewed-by: Ka-cheong Poon <ka-cheong.poon@oracle.com> Reviewed-by: David Edmondson <david.edmondson@oracle.com> Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com> Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e6ced83 commit 9ef845f

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

‎net/rds/connection.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,17 @@ void rds_conn_path_connect_if_down(struct rds_conn_path *cp)
905905
}
906906
EXPORT_SYMBOL_GPL(rds_conn_path_connect_if_down);
907907

908+
/* Check connectivity of all paths
909+
*/
910+
void rds_check_all_paths(struct rds_connection *conn)
911+
{
912+
int i = 0;
913+
914+
do {
915+
rds_conn_path_connect_if_down(&conn->c_path[i]);
916+
} while (++i < conn->c_npaths);
917+
}
918+
908919
void rds_conn_connect_if_down(struct rds_connection *conn)
909920
{
910921
WARN_ON(conn->c_trans->t_mp_capable);

‎net/rds/rds.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ void rds_conn_drop(struct rds_connection *conn);
778778
void rds_conn_path_drop(struct rds_conn_path *cpath, bool destroy);
779779
void rds_conn_connect_if_down(struct rds_connection *conn);
780780
void rds_conn_path_connect_if_down(struct rds_conn_path *cp);
781+
void rds_check_all_paths(struct rds_connection *conn);
781782
void rds_for_each_conn_info(struct socket *sock, unsigned int len,
782783
struct rds_info_iterator *iter,
783784
struct rds_info_lengths *lens,
@@ -822,6 +823,12 @@ rds_conn_path_up(struct rds_conn_path *cp)
822823
return atomic_read(&cp->cp_state) == RDS_CONN_UP;
823824
}
824825

826+
static inline int
827+
rds_conn_path_down(struct rds_conn_path *cp)
828+
{
829+
return atomic_read(&cp->cp_state) == RDS_CONN_DOWN;
830+
}
831+
825832
static inline int
826833
rds_conn_up(struct rds_connection *conn)
827834
{

‎net/rds/send.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,8 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
13401340
goto out;
13411341
}
13421342

1343-
rds_conn_path_connect_if_down(cpath);
1343+
if (rds_conn_path_down(cpath))
1344+
rds_check_all_paths(conn);
13441345

13451346
ret = rds_cong_wait(conn->c_fcong, dport, nonblock, rs);
13461347
if (ret) {

0 commit comments

Comments
 (0)