Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rao Shoaib and committed by
David S. Miller
9ef845f8 e6ced831

+20 -1
+11
net/rds/connection.c
··· 905 905 } 906 906 EXPORT_SYMBOL_GPL(rds_conn_path_connect_if_down); 907 907 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 + 908 919 void rds_conn_connect_if_down(struct rds_connection *conn) 909 920 { 910 921 WARN_ON(conn->c_trans->t_mp_capable);
+7
net/rds/rds.h
··· 778 778 void rds_conn_path_drop(struct rds_conn_path *cpath, bool destroy); 779 779 void rds_conn_connect_if_down(struct rds_connection *conn); 780 780 void rds_conn_path_connect_if_down(struct rds_conn_path *cp); 781 + void rds_check_all_paths(struct rds_connection *conn); 781 782 void rds_for_each_conn_info(struct socket *sock, unsigned int len, 782 783 struct rds_info_iterator *iter, 783 784 struct rds_info_lengths *lens, ··· 821 820 rds_conn_path_up(struct rds_conn_path *cp) 822 821 { 823 822 return atomic_read(&cp->cp_state) == RDS_CONN_UP; 823 + } 824 + 825 + static inline int 826 + rds_conn_path_down(struct rds_conn_path *cp) 827 + { 828 + return atomic_read(&cp->cp_state) == RDS_CONN_DOWN; 824 829 } 825 830 826 831 static inline int
+2 -1
net/rds/send.c
··· 1340 1340 goto out; 1341 1341 } 1342 1342 1343 - rds_conn_path_connect_if_down(cpath); 1343 + if (rds_conn_path_down(cpath)) 1344 + rds_check_all_paths(conn); 1344 1345 1345 1346 ret = rds_cong_wait(conn->c_fcong, dport, nonblock, rs); 1346 1347 if (ret) {