From: Ajaykumar Hotchandani Date: Fri, 4 Mar 2016 03:23:05 +0000 (-0800) Subject: rds: add infrastructure to find more details for reconnect failure X-Git-Tag: v4.1.12-92~188^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a08ba9582f6951165af78c7e10b5c83b7ea9e72a;p=users%2Fjedix%2Flinux-maple.git rds: add infrastructure to find more details for reconnect failure This patch adds run-time support to debug scenarios where reconnect is not successful for certain time. We add two sysctl variables for start time and end time. These are number of seconds after reconnect was initiated. Orabug: 22631108 Signed-off-by: Ajaykumar Hotchandani Acked-by: Wengang Wang Reviewed-by: Santosh Shilimkar Signed-off-by: Brian Maly --- diff --git a/net/rds/rds.h b/net/rds/rds.h index f01c043eb07d..e9e81a814dd4 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h @@ -906,6 +906,8 @@ extern unsigned int rds_sysctl_max_unacked_bytes; extern unsigned int rds_sysctl_ping_enable; extern unsigned long rds_sysctl_trace_flags; extern unsigned int rds_sysctl_trace_level; +extern unsigned int rds_sysctl_shutdown_trace_start_time; +extern unsigned int rds_sysctl_shutdown_trace_end_time; /* threads.c */ int rds_threads_init(void); diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c index 05cba38afb6f..b22e8b8b6b89 100644 --- a/net/rds/sysctl.c +++ b/net/rds/sysctl.c @@ -49,6 +49,9 @@ unsigned int rds_sysctl_max_unacked_bytes = (16 << 20); unsigned int rds_sysctl_ping_enable = 1; +unsigned int rds_sysctl_shutdown_trace_start_time; +unsigned int rds_sysctl_shutdown_trace_end_time; + /* * We have official values, but must maintain the sysctl interface for existing * software that expects to find these values here. @@ -110,6 +113,20 @@ static struct ctl_table rds_sysctl_rds_table[] = { .mode = 0644, .proc_handler = proc_dointvec, }, + { + .procname = "shutdown_trace_start_time", + .data = &rds_sysctl_shutdown_trace_start_time, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, + { + .procname = "shutdown_trace_end_time", + .data = &rds_sysctl_shutdown_trace_end_time, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec, + }, { } }; diff --git a/net/rds/threads.c b/net/rds/threads.c index 0de85acd49c9..82b6f3e906ae 100644 --- a/net/rds/threads.c +++ b/net/rds/threads.c @@ -313,7 +313,16 @@ void rds_reconnect_timeout(struct work_struct *work) void rds_shutdown_worker(struct work_struct *work) { struct rds_connection *conn = container_of(work, struct rds_connection, c_down_w); + unsigned long now = get_seconds(); + if ((now - conn->c_reconnect_start > rds_sysctl_shutdown_trace_start_time) && + (now - conn->c_reconnect_start < rds_sysctl_shutdown_trace_end_time)) + pr_info("RDS/IB: connection <%u.%u.%u.%u,%u.%u.%u.%u,%d> " + "shutdown init due to '%s'\n", + NIPQUAD(conn->c_laddr), + NIPQUAD(conn->c_faddr), + conn->c_tos, + conn_drop_reason_str(conn->c_drop_source)); /* if racing is detected, lower IP backs off and let the higher IP * drives the reconnect (one-sided reconnect)