OpenCloudOS-Kernel/drivers/infiniband/hw
Sebastian Sanchez 5d18ee67d4 IB/{hfi1, rdmavt, qib}: Implement CQ completion vector support
Currently the driver doesn't support completion vectors. These
are used to indicate which sets of CQs should be grouped together
into the same vector. A vector is a CQ processing thread that
runs on a specific CPU.

If an application has several CQs bound to different completion
vectors, and each completion vector runs on different CPUs, then
the completion queue workload is balanced. This helps scale as more
nodes are used.

Implement CQ completion vector support using a global workqueue
where a CQ entry is queued to the CPU corresponding to the CQ's
completion vector. Since the workqueue is global, it's guaranteed
to always be there when queueing CQ entries; Therefore, the RCU
locking for cq->rdi->worker in the hot path is superfluous.

Each completion vector is assigned to a different CPU. The number of
completion vectors available is computed by taking the number of
online, physical CPUs from the local NUMA node and subtracting the
CPUs used for kernel receive queues and the general interrupt.
Special use cases:

  * If there are no CPUs left for completion vectors, the same CPU
    for the general interrupt is used; Therefore, there would only
    be one completion vector available.

  * For multi-HFI systems, the number of completion vectors available
    for each device is the total number of completion vectors in
    the local NUMA node divided by the number of devices in the same
    NUMA node. If there's a division remainder, the first device to
    get initialized gets an extra completion vector.

Upon a CQ creation, an invalid completion vector could be specified.
Handle it as follows:

  * If the completion vector is less than 0, set it to 0.

  * Set the completion vector to the result of the passed completion
    vector moded with the number of device completion vectors
    available.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2018-05-09 15:53:30 -04:00
..
bnxt_re RDMA: Use ib_gid_attr during GID modification 2018-04-03 21:34:16 -06:00
cxgb3 RDMA/cxgb3: Use structs to describe the uABI instead of opencoding 2018-03-22 12:42:48 -06:00
cxgb4 Merge branch 'k.o/for-rc' into k.o/wip/dl-for-next 2018-05-09 15:48:48 -04:00
hfi1 IB/{hfi1, rdmavt, qib}: Implement CQ completion vector support 2018-05-09 15:53:30 -04:00
hns Merge branch 'k.o/for-rc' into k.o/wip/dl-for-next 2018-05-09 15:48:48 -04:00
i40iw infiniband: i40iw: Replace GFP_ATOMIC with GFP_KERNEL in i40iw_l2param_change 2018-04-17 19:57:12 -06:00
mlx4 IB/mlx4: Fix integer overflow when calculating optimal MTT size 2018-05-03 15:31:43 -04:00
mlx5 Merge branch 'k.o/for-rc' into k.o/wip/dl-for-next 2018-05-09 15:48:48 -04:00
mthca IB/uverbs: Extend uverbs_ioctl header with driver_id 2018-03-19 14:45:17 -06:00
nes IB/nes: fix nes_netdev_start_xmit()'s return type 2018-04-27 14:07:30 -04:00
ocrdma IB/providers: Avoid null netdev check for RoCE 2018-04-03 21:33:51 -06:00
qedr RDMA/qedr: fix spelling mistake: "failes" -> "fails" 2018-05-01 11:36:24 -04:00
qib IB/{hfi1, rdmavt, qib}: Implement CQ completion vector support 2018-05-09 15:53:30 -04:00
usnic Merge candidates for 4.17 merge window 2018-04-06 17:35:43 -07:00
vmw_pvrdma RDMA: Use ib_gid_attr during GID modification 2018-04-03 21:34:16 -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