diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2015-09-30 22:54:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-05 12:34:51 +0200 |
commit | 3b20fc389705a4c959adebc494578cb99bb8be9e (patch) | |
tree | c108cf3b2a4221995ae3b8c7dc91431fc5322b0e /net/rds/rds.h | |
parent | Merge branch 'xgbe-next' (diff) | |
download | linux-3b20fc389705a4c959adebc494578cb99bb8be9e.tar.xz linux-3b20fc389705a4c959adebc494578cb99bb8be9e.zip |
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/rds.h')
-rw-r--r-- | net/rds/rds.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/rds/rds.h b/net/rds/rds.h index afb4048d0cfd..b4c7ac021d5b 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h @@ -86,7 +86,9 @@ struct rds_connection { struct hlist_node c_hash_node; __be32 c_laddr; __be32 c_faddr; - unsigned int c_loopback:1; + unsigned int c_loopback:1, + c_outgoing:1, + c_pad_to_32:30; struct rds_connection *c_passive; struct rds_cong_map *c_lcong; |