]> bbs.cooldavid.org Git - net-next-2.6.git/commit
RDS/IB: always process recv completions
authorZach Brown <zach.brown@oracle.com>
Tue, 6 Jul 2010 22:04:34 +0000 (15:04 -0700)
committerAndy Grover <andy.grover@oracle.com>
Thu, 9 Sep 2010 01:16:36 +0000 (18:16 -0700)
commitd455ab64096b9a86849c7315c53e595330842db6
tree2e02538ae4cb9c708c5dd474d7fbd739a31c0ab1
parent80c51be56ffa257d3177f0d750d90be65d30c22f
RDS/IB: always process recv completions

The recv refill path was leaking fragments because the recv event handler had
marked a ring element as free without freeing its frag.  This was happening
because it wasn't processing receives when the conn wasn't marked up or
connecting, as can be the case if it races with rmmod.

Two observations support always processing receives in the callback.

First, buildup should only post receives, thus triggering recv event handler
calls, once it has built up all the state to handle them.  Teardown should
destroy the CQ and drain the ring before tearing down the state needed to
process recvs.  Both appear to be true today.

Second, this test was fundamentally racy.  There is nothing to stop rmmod and
connection destruction from swooping in the moment after the conn state was
sampled but before real receive procesing starts.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
net/rds/ib_recv.c