Skip to content

Commit 391aa63

Browse files
Hakon-Buggejfvogel
authored andcommitted
rds: ib: Use a delay when reconnecting to the very same IP address
An RDS IB connection may be formed from the very same IB port using HCA level internal loop-back. If this connection attempt is performed after RDS has cleared the ARP cache of the same IP address, an ARP IB multicast is sent out on the IPoIB interface. If the above scenario is performed on IPoIB interfaces that are members of an IB Limited Partition, the ARP multicast will be dropped by the HCA port. A corresponding PKey Violation is counted and a corresponding PKey Violation Trap is sent to the OpenSM, subject to rate control. Now, due to a bug in RDS connection management, where it was not anticipated that the peers of a connection could actually be the very same port and have the same IP address, the reconnect attempts happens with zero delay. This leads to about 7700 connection attempts per second, about 4400 PKey Violations per second, and 8500 ARP multicasts per second. This commit reduces the reconnect rate down to one second. This because the RDS uses exponential backoff to calculate the delay, which will shortly end up at rds_sysctl_reconnect_max_jiffies, which by default is HZ, in other words, a delay at one second after the 10 first reconnects. Orabug: 29161384 Signed-off-by: Håkon Bugge <[email protected]> Reviewed-by: Ka-cheong Poon <[email protected]> Orabug: 33590097 UEK6 => UEK7 (cherry picked from commit fbbedf3) cherry-pick-repo=UEK/production/linux-uek.git Signed-off-by: Gerd Rausch <[email protected]> Reviewed-by: William Kucharski <[email protected]>
1 parent dd7911e commit 391aa63

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

net/rds/threads.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ EXPORT_SYMBOL_GPL(rds_connect_complete);
134134
*/
135135
void rds_queue_reconnect(struct rds_conn_path *cp)
136136
{
137-
unsigned long rand;
138137
struct rds_connection *conn = cp->cp_conn;
139138
bool is_tcp = conn->c_trans->t_type == RDS_TRANS_TCP;
140139

@@ -154,17 +153,16 @@ void rds_queue_reconnect(struct rds_conn_path *cp)
154153
return;
155154
}
156155

157-
get_random_bytes(&rand, sizeof(rand));
158156
rds_rtd_ptr(RDS_RTD_CM_EXT,
159-
"%lu delay %lu ceil conn %p for %pI6c -> %pI6c tos %d\n",
160-
rand % cp->cp_reconnect_jiffies, cp->cp_reconnect_jiffies,
161-
conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos);
157+
"delay %lu conn %p for %pI6c -> %pI6c tos %d\n",
158+
cp->cp_reconnect_jiffies, conn, &conn->c_laddr,
159+
&conn->c_faddr, conn->c_tos);
162160

163-
if (rds_addr_cmp(&conn->c_laddr, &conn->c_faddr) >= 0)
161+
if (rds_addr_cmp(&conn->c_laddr, &conn->c_faddr) > 0)
164162
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w, 0);
165163
else
166164
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w,
167-
msecs_to_jiffies(100));
165+
cp->cp_reconnect_jiffies);
168166

169167
cp->cp_reconnect_jiffies = min(cp->cp_reconnect_jiffies * 2,
170168
rds_sysctl_reconnect_max_jiffies);

0 commit comments

Comments
 (0)