linux/drivers/infiniband/hw/cxgb4
Steve Wise b4e2901c52 RDMA/cxgb4: SQ flush fix
There is a race when moving a QP from RTS->CLOSING where a SQ work
request could be posted after the FW receives the RDMA_RI/FINI WR.
The SQ work request will never get processed, and should be completed
with FLUSHED status.  Function c4iw_flush_sq(), however was dropping
the oldest SQ work request when in CLOSING or IDLE states, instead of
completing the pending work request. If that oldest pending work
request was actually complete and has a CQE in the CQ, then when that
CQE is proceessed in poll_cq, we'll BUG_ON() due to the inconsistent
SQ/CQ state.

This is a very small timing hole and has only been hit once so far.

The fix is two-fold:

1) c4iw_flush_sq() MUST always flush all non-completed WRs with FLUSHED
   status regardless of the QP state.

2) In c4iw_modify_rc_qp(), always set the "in error" bit on the queue
   before moving the state out of RTS.  This ensures that the state
   transition will not happen while another thread is in
   post_rc_send(), because set_state() and post_rc_send() both aquire
   the qp spinlock.  Also, once we transition the state out of RTS,
   subsequent calls to post_rc_send() will fail because the "in error"
   bit is set.  I don't think this fully closes the race where the FW
   can get a FINI followed a SQ work request being posted (because
   they are posted to differente EQs), but the #1 fix will handle the
   issue by flushing the SQ work request.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2014-04-11 11:36:08 -07:00
..
Kconfig RDMA/cxgb4: Add support for active and passive open connection with IPv6 address 2013-08-13 11:55:06 -07:00
Makefile RDMA/cxgb4: Remove kfifo usage 2012-05-18 13:22:36 -07:00
cm.c RDMA/cxgb4: Endpoint timeout fixes 2014-04-11 11:36:07 -07:00
cq.c RDMA/cxgb4: SQ flush fix 2014-04-11 11:36:08 -07:00
device.c RDMA/cxgb4: Use the BAR2/WC path for kernel QPs and T5 devices 2014-04-11 11:36:01 -07:00
ev.c RDMA/cxgb4: Handle newer firmware changes 2013-08-13 11:55:44 -07:00
id_table.c drivers/infiniband/hw: rename random32() to prandom_u32() 2013-05-07 18:38:27 -07:00
iw_cxgb4.h RDMA/cxgb4: Use the BAR2/WC path for kernel QPs and T5 devices 2014-04-11 11:36:01 -07:00
mem.c Merge branches 'core', 'cxgb4', 'ip-roce', 'iser', 'misc', 'mlx4', 'nes', 'ocrdma', 'qib', 'sgwrapper', 'srp' and 'usnic' into for-next 2014-04-03 08:30:17 -07:00
provider.c RDMA/cxgb4: set error code on kmalloc() failure 2014-03-28 14:55:21 -04:00
qp.c RDMA/cxgb4: SQ flush fix 2014-04-11 11:36:08 -07:00
resource.c RDMA/cxgb4: Remove kfifo usage 2012-05-18 13:22:36 -07:00
t4.h RDMA/cxgb4: rmb() after reading valid gen bit 2014-04-11 11:36:07 -07:00
t4fw_ri_api.h RDMA/cxgb4: Add module option to tweak delayed ack 2010-07-21 10:53:52 -07:00
user.h cxgb4/iw_cxgb4: Doorbell Drop Avoidance Bug Fixes 2014-03-14 22:44:11 -04:00