linux-stable/drivers/infiniband/hw/hfi1
Michael J. Ruhl 8737ce95c4 IB/hfi1: Fix an assign/ordering issue with shared context IDs
The current algorithm for generating sub-context IDs is FILO.  If the
contexts are not closed in that order, the uniqueness of the ID will be
compromised. I.e. logging the creation/deletion of context IDs with an
application that assigns and closes in a FIFO order reveals:

cache_id: assign: uctxt: 3    sub_ctxt: 0
cache_id: assign: uctxt: 3    sub_ctxt: 1
cache_id: assign: uctxt: 3    sub_ctxt: 2
cache_id: close:  uctxt: 3    sub_ctxt: 0
cache_id: assign: uctxt: 3    sub_ctxt: 2 <<<

The sub_ctxt ID 2 is reused incorrectly.

Update the sub-context ID assign algorithm to use a bitmask of in_use
contexts.  The new algorithm will allow the contexts to be closed in any
order, and will only re-use unused contexts.

Size subctxt and subctxt_cnt to match the user API size.

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: Doug Ledford <dledford@redhat.com>
2017-05-04 19:31:46 -04:00
..
affinity.c sched/core: Remove the tsk_cpus_allowed() wrapper 2017-03-02 08:42:24 +01:00
affinity.h Updates for 4.10 kernel merge window 2016-12-15 12:03:32 -08:00
aspm.h IB/hfi1: Virtual Network Interface Controller (VNIC) HW support 2017-04-20 15:19:35 -04:00
chip.c IB/hfi1: Clean up context initialization 2017-05-04 19:31:46 -04:00
chip.h IB/hfi1: Clean up context initialization 2017-05-04 19:31:46 -04:00
chip_registers.h IB/hfi1: Add active channel and backplane support for integrated devices 2016-11-15 16:37:27 -05:00
common.h IB/hfi1: Use defines from common headers 2017-04-28 13:48:01 -04:00
debugfs.c IB/hfi1: Virtual Network Interface Controller (VNIC) HW support 2017-04-20 15:19:35 -04:00
debugfs.h IB/hfi1: Add transmit fault injection feature 2017-04-05 14:45:09 -04:00
device.c
device.h
driver.c IB/hfi1: Fix an assign/ordering issue with shared context IDs 2017-05-04 19:31:46 -04:00
efivar.c IB/hfi1: Check upper-case EFI variables 2017-02-19 09:18:37 -05:00
efivar.h
eprom.c IB/hfi1: Read new EPROM format 2016-12-11 15:25:13 -05:00
eprom.h IB/hfi1: Add ability to read platform config from the EPROM 2016-10-02 08:42:20 -04:00
file_ops.c IB/hfi1: Fix an assign/ordering issue with shared context IDs 2017-05-04 19:31:46 -04:00
firmware.c IB/hfi1: Add a patch value to the firmware version string 2017-04-05 14:45:09 -04:00
hfi.h IB/hfi1: Fix an assign/ordering issue with shared context IDs 2017-05-04 19:31:46 -04:00
init.c IB/hfi1: Fix an assign/ordering issue with shared context IDs 2017-05-04 19:31:46 -04:00
intr.c IB/hfi1: Fix an assign/ordering issue with shared context IDs 2017-05-04 19:31:46 -04:00
iowait.h IB/hfi1: Add unique txwait_lock for txreq events 2016-11-15 16:25:59 -05:00
Kconfig Second round of merge items for 4.8 2016-08-04 20:26:31 -04:00
mad.c IB/core: Use rdma_ah_attr accessor functions 2017-05-01 14:32:43 -04:00
mad.h IB/hfi1: Clean up port state structure definition 2016-08-02 12:00:54 -04:00
Makefile IB/hfi1: VNIC SDMA support 2017-04-20 15:19:41 -04:00
mmu_rb.c IB/hfi1: constify mmu_notifier_ops structure 2016-12-11 15:29:42 -05:00
mmu_rb.h IB/hfi1: Remove unneeded mm argument in remove function 2016-08-02 22:46:21 -04:00
opa_compat.h
pcie.c IB/hfi1: Convert %Lx to %llx 2017-04-28 13:56:22 -04:00
pio.c IB/hfi1: Virtual Network Interface Controller (VNIC) HW support 2017-04-20 15:19:35 -04:00
pio.h IB/hfi: Fix up comments in engine mapping 2017-04-25 15:24:51 -04:00
pio_copy.c IB/hfi1: Optimize pio_buf and send_context structs 2016-11-15 16:37:27 -05:00
platform.c IB/hfi1: Add special setting for low power AOC 2016-12-11 15:29:42 -05:00
platform.h IB/hfi1: Define platform_config_table_limits once 2016-12-11 15:29:42 -05:00
qp.c IB/hfi1, IB/rdmavt: Move r_adefered to r_lock cache line 2017-05-04 19:31:46 -04:00
qp.h IB/hfi1, qib, rdmavt: Move AETH credit functions into rdmavt 2017-02-19 09:18:38 -05:00
qsfp.c IB/hfi1: Extend i2c timeout 2016-10-02 08:42:13 -04:00
qsfp.h IB/hfi1: Fetch monitor values on-demand for CableInfo query 2016-08-22 14:31:41 -04:00
rc.c IB/hfi1, IB/rdmavt: Move r_adefered to r_lock cache line 2017-05-04 19:31:46 -04:00
ruc.c IB/hfi1: Fix yield logic in send engine 2017-05-04 19:31:46 -04:00
sdma.c IB/hfi1: Ensure VL index is within bounds 2017-04-05 14:45:09 -04:00
sdma.h IB/hfi: Fix up comments in engine mapping 2017-04-25 15:24:51 -04:00
sdma_txreq.h
sysfs.c IB/hfi1: Virtual Network Interface Controller (VNIC) HW support 2017-04-20 15:19:35 -04:00
trace.c IB/hfi1: Add functions to parse 9B headers 2017-04-28 13:48:01 -04:00
trace.h IB/hfi1: Separate tracepoints into specific headers 2016-08-02 12:00:54 -04:00
trace_ctxts.h IB/hfi1: Clean up context initialization 2017-05-04 19:31:46 -04:00
trace_dbg.h IB/hfi1: Separate tracepoints into specific headers 2016-08-02 12:00:54 -04:00
trace_ibhdrs.h IB/hfi1: Use defines from common headers 2017-04-28 13:48:01 -04:00
trace_misc.h IB/hfi1: Add receive fault injection feature 2017-04-05 14:45:09 -04:00
trace_rc.h IB/rdmavt, IB/hfi1: Fix timer migration regressions 2017-04-05 14:45:09 -04:00
trace_rx.h IB/hfi1: Remove leftover snoop references 2016-11-15 16:16:43 -05:00
trace_tx.h IB/hfi1: Fix yield logic in send engine 2017-05-04 19:31:46 -04:00
uc.c IB/core: Use rdma_ah_attr accessor functions 2017-05-01 14:32:43 -04:00
ud.c IB/core: Use rdma_ah_attr accessor functions 2017-05-01 14:32:43 -04:00
user_exp_rcv.c IB/hfi1: Clean up context initialization 2017-05-04 19:31:46 -04:00
user_exp_rcv.h IB/hfi1: Clean up context initialization 2017-05-04 19:31:46 -04:00
user_pages.c IB/hfi1: Virtual Network Interface Controller (VNIC) HW support 2017-04-20 15:19:35 -04:00
user_sdma.c IB/hfi1: Remove atomic operations for SDMA_REQ_HAVE_AHG bit 2017-05-04 19:31:46 -04:00
user_sdma.h IB/hfi1: Fix an assign/ordering issue with shared context IDs 2017-05-04 19:31:46 -04:00
verbs.c IB/core: Define 'ib' and 'roce' rdma_ah_attr types 2017-05-01 14:32:43 -04:00
verbs.h IB/hfi1: Fix yield logic in send engine 2017-05-04 19:31:46 -04:00
verbs_txreq.c IB/hfi1: Add unique txwait_lock for txreq events 2016-11-15 16:25:59 -05:00
verbs_txreq.h IB/hfi1: Remove dependence on qp->s_cur_size 2016-12-11 15:25:13 -05:00
vnic.h IB/hfi1: VNIC SDMA support 2017-04-20 15:19:41 -04:00
vnic_main.c IB/hfi1: Clean up context initialization 2017-05-04 19:31:46 -04:00
vnic_sdma.c IB/hfi1: VNIC SDMA support 2017-04-20 15:19:41 -04:00