diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2015-09-30 23:54:07 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-05 13:34:51 +0300 |
commit | 3b20fc389705a4c959adebc494578cb99bb8be9e (patch) | |
tree | c108cf3b2a4221995ae3b8c7dc91431fc5322b0e /net/rds/tcp_send.c | |
parent | 393159e917242c39a5c07173914a0e2a2367ee69 (diff) | |
download | linux-3b20fc389705a4c959adebc494578cb99bb8be9e.tar.xz |
RDS: Use a single TCP socket for both send and receive.
Commit f711a6ae062c ("net/rds: RDS-TCP: Always create a new rds_sock
for an incoming connection.") modified rds-tcp so that an incoming SYN
would ignore an existing "client" TCP connection which had the local
port set to the transient port. The motivation for ignoring the existing
"client" connection in f711a6ae was to avoid race conditions and an
endless duel of reconnect attempts triggered by a restart/abort of one
of the nodes in the TCP connection.
However, having separate sockets for active and passive sides
is avoidable, and the simpler model of a single TCP socket for
both send and receives of all RDS connections associated with
that tcp socket makes for easier observability. We avoid the race
conditions from f711a6ae by attempting reconnects in rds_conn_shutdown
if, and only if, the (new) c_outgoing bit is set for RDS_TRANS_TCP.
The c_outgoing bit is initialized in __rds_conn_create().
A side-effect of re-using the client rds_connection for an incoming
SYN is the potential of encountering duelling SYNs, i.e., we
have an outgoing RDS_CONN_CONNECTING socket when we get the incoming
SYN. The logic to arbitrate this criss-crossing SYN exchange in
rds_tcp_accept_one() has been modified to emulate the BGP state
machine: the smaller IP address should back off from the connection attempt.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/tcp_send.c')
0 files changed, 0 insertions, 0 deletions