linux_dsm_epyc7002/drivers/infiniband/hw
Michael J. Ruhl 28a9a9e83c IB/hfi1: Remove race conditions in user_sdma send path
Packet queue state is over used to determine SDMA descriptor
availablitity and packet queue request state.

cpu 0  ret = user_sdma_send_pkts(req, pcount);
cpu 0  if (atomic_read(&pq->n_reqs))
cpu 1  IRQ user_sdma_txreq_cb calls pq_update() (state to _INACTIVE)
cpu 0        xchg(&pq->state, SDMA_PKT_Q_ACTIVE);

At this point pq->n_reqs == 0 and pq->state is incorrectly
SDMA_PKT_Q_ACTIVE.  The close path will hang waiting for the state
to return to _INACTIVE.

This can also change the state from _DEFERRED to _ACTIVE.  However,
this is a mostly benign race.

Remove the racy code path.

Use n_reqs to determine if a packet queue is active or not.

Reviewed-by: Mitko Haralanov <mitko.haralanov@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2018-09-11 10:05:17 -06:00
..
bnxt_re Merge branch 'uverbs_dev_cleanups' into rdma.git for-next 2018-09-05 16:21:22 -06:00
cxgb3 RDMA/providers: Remove pointless functions 2018-07-30 20:31:54 -06:00
cxgb4 iw_cxgb4: only allow 1 flush on user qps 2018-09-04 15:07:56 -06:00
hfi1 IB/hfi1: Remove race conditions in user_sdma send path 2018-09-11 10:05:17 -06:00
hns RDMA/hns: Fix an error code in hns_roce_v2_init_eq_table() 2018-09-11 10:00:23 -06:00
i40iw RDMA/providers: Remove pointless functions 2018-07-30 20:31:54 -06:00
mlx4 Linux 4.18 2018-08-16 13:12:00 -06:00
mlx5 RDMA/mlx5: Allow creating a matcher for a NIC TX flow table 2018-09-11 09:28:07 -06:00
mthca RDMA/providers: Fix return value from create_srq callbacks 2018-07-30 20:29:45 -06:00
nes RDMA/nes: Delete impossible debug prints 2018-09-05 15:58:30 -06:00
ocrdma RDMA/providers: Remove pointless functions 2018-07-30 20:31:54 -06:00
qedr RDMA/qedr: remove set but not used variable 'ctx' 2018-09-05 15:55:22 -06:00
qib IB/{hfi1, qib, rdmavt}: Schedule multi RC/UC packets instead of posting 2018-09-11 09:55:02 -06:00
usnic infiniband: remove redundant condition check before debugfs_remove 2018-09-11 09:37:05 -06:00
vmw_pvrdma RDMA/providers: Remove pointless functions 2018-07-30 20:31:54 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00