linux_dsm_epyc7002/drivers/infiniband/hw/cxgb4
Steve Wise c12a67fec8 iw_cxgb4: free EQ queue memory on last deref
Commit ad61a4c7a9 ("iw_cxgb4: don't block in destroy_qp awaiting
the last deref") introduced a bug where the RDMA QP EQ queue memory
(and QIDs) are possibly freed before the underlying connection has been
fully shutdown.  The result being a possible DMA read issued by HW after
the queue memory has been unmapped and freed.  This results in possible
WR corruption in the worst case, system bus errors if an IOMMU is in use,
and SGE "bad WR" errors reported in the very least.  The fix is to defer
unmap/free of queue memory and QID resources until the QP struct has
been fully dereferenced.  To do this, the c4iw_ucontext must also be kept
around until the last QP that references it is fully freed.  In addition,
since the last QP deref can happen in an IRQ disabled context, we need
a new workqueue thread to do the final unmap/free of the EQ queue memory.

Fixes: ad61a4c7a9 ("iw_cxgb4: don't block in destroy_qp awaiting the last deref")
Cc: stable@vger.kernel.org
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-01-10 14:01:38 -05:00
..
cm.c Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
cq.c iw_cxgb4: refactor sq/rq drain logic 2017-01-10 14:01:38 -05:00
device.c iw_cxgb4: free EQ queue memory on last deref 2017-01-10 14:01:38 -05:00
ev.c InfiniBand/RDMA changes for 3.20 merge window: 2015-02-21 12:53:21 -08:00
id_table.c drivers/infiniband/hw: rename random32() to prandom_u32() 2013-05-07 18:38:27 -07:00
iw_cxgb4.h iw_cxgb4: free EQ queue memory on last deref 2017-01-10 14:01:38 -05:00
Kconfig libcxgb,iw_cxgb4,cxgbit: add cxgb_get_4tuple() 2016-09-15 20:49:19 -04:00
Makefile libcxgb,iw_cxgb4,cxgbit: add cxgb_get_4tuple() 2016-09-15 20:49:19 -04:00
mem.c iw_cxgb4: invalidate the mr when posting a read_w_inv wr 2016-11-16 20:10:36 -05:00
provider.c iw_cxgb4: free EQ queue memory on last deref 2017-01-10 14:01:38 -05:00
qp.c iw_cxgb4: free EQ queue memory on last deref 2017-01-10 14:01:38 -05:00
resource.c RDMA/cxgb4: Add missing debug stats 2014-04-11 11:36:09 -07:00
t4.h iw_cxgb4: refactor sq/rq drain logic 2017-01-10 14:01:38 -05:00
t4fw_ri_api.h iw_cxgb4: add fast-path for small REG_MR operations 2016-10-07 16:54:40 -04:00