Skip to content

Commit 4fe0a79

Browse files
Wei Lin GuayLinuxMinion
authored andcommitted
Revert "net/rds: determine active/passive connection with IP addresses"
This reverts commit 1f2ea7a ("net/rds: determine active/passive connection with IP addresses"). The plan is to use the original, well tested one-sided reconnection that was reverted in "812c02791: RDS: restore the exponential back-off scheme". Orabug: 26497333 Signed-off-by: Wei Lin Guay <[email protected]> Reviewed-by: Håkon Bugge <[email protected]> Reviewed-by: Avinash Repaka <[email protected]> Reviewed-by: Ajaykumar Hotchandani <[email protected]>
1 parent 9dedfd6 commit 4fe0a79

File tree

3 files changed

+6
-54
lines changed

3 files changed

+6
-54
lines changed

net/rds/ib_cm.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -922,14 +922,6 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
922922
* see the comment above rds_queue_reconnect()
923923
*/
924924
mutex_lock(&conn->c_cm_lock);
925-
if (rds_conn_transition(conn, RDS_CONN_DOWN, RDS_CONN_DOWN) &&
926-
(conn->c_laddr < conn->c_faddr)) {
927-
rds_rtd(RDS_RTD_CM_EXT_P,
928-
"incoming passive connection is trying to connect %p\n",
929-
conn);
930-
rds_conn_drop(conn, DR_IB_CONN_DROP_RACE);
931-
goto out;
932-
}
933925
if (!rds_conn_transition(conn, RDS_CONN_DOWN, RDS_CONN_CONNECTING)) {
934926
/*
935927
* in both of the cases below, the conn is half setup.
@@ -960,39 +952,10 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
960952
NIPQUAD(conn->c_laddr),
961953
NIPQUAD(conn->c_faddr),
962954
conn->c_tos);
963-
rds_rtd(RDS_RTD_CM, "RDS/IB: connection "
964-
" id %p conn %p "
965-
"<%u.%u.%u.%u,%u.%u.%u.%u,%d> "
966-
"racing for 15s, forcing reset\n",
967-
cm_id, conn,
968-
NIPQUAD(conn->c_laddr),
969-
NIPQUAD(conn->c_faddr),
970-
conn->c_tos);
971955
rds_conn_drop(conn, DR_IB_REQ_WHILE_CONNECTING);
972956
rds_ib_stats_inc(s_ib_listen_closed_stale);
973957
} else {
974958
/* Wait and see - our connect may still be succeeding */
975-
rds_rtd(RDS_RTD_CM, "RDS/IB: connection "
976-
" id %p conn %p "
977-
"<%u.%u.%u.%u,%u.%u.%u.%u,%d> "
978-
" will be rejected\n",
979-
cm_id, conn,
980-
NIPQUAD(conn->c_laddr),
981-
NIPQUAD(conn->c_faddr),
982-
conn->c_tos);
983-
if (test_and_clear_bit(RDS_INITIAL_RECONNECT, &conn->c_flags) ||
984-
(conn->c_laddr > conn->c_faddr) ||
985-
rds_conn_self_loopback_passive(conn)) {
986-
rds_rtd(RDS_RTD_CM, "RDS/IB: connection "
987-
" id %p conn %p "
988-
"<%u.%u.%u.%u,%u.%u.%u.%u,%d> "
989-
" will be rejected as passive conn\n",
990-
cm_id, conn,
991-
NIPQUAD(conn->c_laddr),
992-
NIPQUAD(conn->c_faddr),
993-
conn->c_tos);
994-
rds_conn_drop(conn, DR_IB_CONN_DROP_RACE);
995-
}
996959
rds_ib_stats_inc(s_ib_connect_raced);
997960
}
998961
}

net/rds/rds.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ enum {
137137
#define RDS_IN_XMIT 2
138138
#define RDS_RECV_REFILL 3
139139
#define RDS_DESTROY_PENDING 4
140-
#define RDS_INITIAL_RECONNECT 5
141140

142141
#define RDS_RDMA_RESOLVE_TO_MAX_INDEX 5
143142
#define RDS_ADDR_RES_TM_INDEX_MAX 5

net/rds/threads.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ EXPORT_SYMBOL_GPL(rds_connect_complete);
132132
*/
133133
void rds_queue_reconnect(struct rds_conn_path *cp, int reason)
134134
{
135-
unsigned long delay = 0;
136135
unsigned long rand;
137136
struct rds_connection *conn = cp->cp_conn;
138137
bool is_tcp = conn->c_trans->t_type == RDS_TRANS_TCP;
@@ -146,31 +145,22 @@ void rds_queue_reconnect(struct rds_conn_path *cp, int reason)
146145
if (is_tcp && !IS_CANONICAL(conn->c_laddr, conn->c_faddr))
147146
return;
148147

149-
if (reason == DR_IB_BASE_CONN_DOWN) {
150-
cp->cp_reconnect_jiffies = 0;
151-
delay = msecs_to_jiffies(500);
152-
}
153-
154148
set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags);
155149
if (cp->cp_reconnect_jiffies == 0) {
156-
set_bit(RDS_INITIAL_RECONNECT, &cp->cp_flags);
157-
get_random_bytes(&rand, sizeof(rand));
158150
cp->cp_reconnect_jiffies = rds_sysctl_reconnect_min_jiffies;
159-
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w,
160-
delay + (rand % cp->cp_reconnect_jiffies));
151+
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w, 0);
161152
return;
162153
}
163154

164-
clear_bit(RDS_INITIAL_RECONNECT, &cp->cp_flags);
165-
if ((conn->c_laddr > conn->c_faddr) ||
166-
rds_conn_self_loopback_passive(conn))
167-
delay = msecs_to_jiffies(15000);
155+
get_random_bytes(&rand, sizeof(rand));
168156
rds_rtd(RDS_RTD_CM_EXT,
169157
"%lu delay %lu ceil conn %p for %pI4 -> %pI4 tos %d\n",
170-
delay, cp->cp_reconnect_jiffies,
158+
rand % cp->cp_reconnect_jiffies, cp->cp_reconnect_jiffies,
171159
conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos);
172160

173-
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w, delay);
161+
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w,
162+
rand % cp->cp_reconnect_jiffies);
163+
174164
cp->cp_reconnect_jiffies = min(cp->cp_reconnect_jiffies * 2,
175165
rds_sysctl_reconnect_max_jiffies);
176166
}

0 commit comments

Comments
 (0)