]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
RDS: only use passive connections when addresses match
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Wed, 8 Apr 2015 16:33:46 +0000 (12:33 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Apr 2015 19:17:23 +0000 (15:17 -0400)
commit1789b2c077f6d6c82b04cfe49a0fec020dc42488
tree7bcfd62b3386e53bb5c5999963de4a71230a9c5b
parentebe96e641dee2cbd135ee802ae7e40c361640088
RDS: only use passive connections when addresses match

Passive connections were added for the case where one loopback IB
connection between identical addresses needs another connection to store
the second QP.  Unfortunately, they were also created in the case where
the addesses differ and we already have both QPs.

This lead to a message reordering bug.

- two different IB interfaces and addresses on a machine: A B
- traffic is sent from A to B
- connection from A-B is created, connect request sent
- listening accepts connect request, B-A is created
- traffic flows, next_rx is incremented
- unacked messages exist on the retrans list
- connection A-B is shut down, new connect request sent
- listen sees existing loopback B-A, creates new passive B-A
- retrans messages are sent and delivered because of 0 next_rx

The problem is that the second connection request saw the previously
existing parent connection.  Instead of using it, and using the existing
next_rx_seq state for the traffic between those IPs, it mistakenly
thought that it had to create a passive connection.

We fix this by only using passive connections in the special case where
laddr and faddr match.  In this case we'll only ever have one parent
sending connection requests and one passive connection created as the
listening path sees the existing parent connection which initiated the
request.

Original patch by Zach Brown

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/connection.c