Commit 9ef845f8 authored by Rao Shoaib's avatar Rao Shoaib Committed by David S. Miller

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: default avatarKa-cheong Poon <ka-cheong.poon@oracle.com>
Reviewed-by: default avatarDavid Edmondson <david.edmondson@oracle.com>
Signed-off-by: default avatarSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: default avatarRao Shoaib <rao.shoaib@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e6ced831
......@@ -905,6 +905,17 @@ void rds_conn_path_connect_if_down(struct rds_conn_path *cp)
}
EXPORT_SYMBOL_GPL(rds_conn_path_connect_if_down);
/* Check connectivity of all paths
*/
void rds_check_all_paths(struct rds_connection *conn)
{
int i = 0;
do {
rds_conn_path_connect_if_down(&conn->c_path[i]);
} while (++i < conn->c_npaths);
}
void rds_conn_connect_if_down(struct rds_connection *conn)
{
WARN_ON(conn->c_trans->t_mp_capable);
......
......@@ -778,6 +778,7 @@ void rds_conn_drop(struct rds_connection *conn);
void rds_conn_path_drop(struct rds_conn_path *cpath, bool destroy);
void rds_conn_connect_if_down(struct rds_connection *conn);
void rds_conn_path_connect_if_down(struct rds_conn_path *cp);
void rds_check_all_paths(struct rds_connection *conn);
void rds_for_each_conn_info(struct socket *sock, unsigned int len,
struct rds_info_iterator *iter,
struct rds_info_lengths *lens,
......@@ -822,6 +823,12 @@ rds_conn_path_up(struct rds_conn_path *cp)
return atomic_read(&cp->cp_state) == RDS_CONN_UP;
}
static inline int
rds_conn_path_down(struct rds_conn_path *cp)
{
return atomic_read(&cp->cp_state) == RDS_CONN_DOWN;
}
static inline int
rds_conn_up(struct rds_connection *conn)
{
......
......@@ -1340,7 +1340,8 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
goto out;
}
rds_conn_path_connect_if_down(cpath);
if (rds_conn_path_down(cpath))
rds_check_all_paths(conn);
ret = rds_cong_wait(conn->c_fcong, dport, nonblock, rs);
if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment