]> git.baikalelectronics.ru Git - kernel.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)
commit8ef08b24f053c57db403e8c8904dd0ac6010d408
tree2e02538ae4cb9c708c5dd474d7fbd739a31c0ab1
parent673555fdc3addfcbf146776be088a96db91e2e8f
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