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>
This commit is contained in:

committed by
Doug Ledford

parent
cf38ea100e
commit
5d18ee67d4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright(c) 2015-2017 Intel Corporation.
|
||||
* Copyright(c) 2015 - 2018 Intel Corporation.
|
||||
*
|
||||
* This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
* redistributing this file, you may do so under either license.
|
||||
@@ -1244,6 +1244,8 @@ static void hfi1_clean_devdata(struct hfi1_devdata *dd)
|
||||
dd->rcv_limit = NULL;
|
||||
dd->send_schedule = NULL;
|
||||
dd->tx_opstats = NULL;
|
||||
kfree(dd->comp_vect);
|
||||
dd->comp_vect = NULL;
|
||||
sdma_clean(dd, dd->num_sdma);
|
||||
rvt_dealloc_device(&dd->verbs_dev.rdi);
|
||||
}
|
||||
@@ -1300,6 +1302,7 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra)
|
||||
dd->unit = ret;
|
||||
list_add(&dd->list, &hfi1_dev_list);
|
||||
}
|
||||
dd->node = -1;
|
||||
|
||||
spin_unlock_irqrestore(&hfi1_devs_lock, flags);
|
||||
idr_preload_end();
|
||||
@@ -1352,6 +1355,12 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra)
|
||||
goto bail;
|
||||
}
|
||||
|
||||
dd->comp_vect = kzalloc(sizeof(*dd->comp_vect), GFP_KERNEL);
|
||||
if (!dd->comp_vect) {
|
||||
ret = -ENOMEM;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
kobject_init(&dd->kobj, &hfi1_devdata_type);
|
||||
return dd;
|
||||
|
||||
@@ -1521,7 +1530,7 @@ module_init(hfi1_mod_init);
|
||||
static void __exit hfi1_mod_cleanup(void)
|
||||
{
|
||||
pci_unregister_driver(&hfi1_pci_driver);
|
||||
node_affinity_destroy();
|
||||
node_affinity_destroy_all();
|
||||
hfi1_wss_exit();
|
||||
hfi1_dbg_exit();
|
||||
|
||||
@@ -1605,6 +1614,8 @@ static void cleanup_device_data(struct hfi1_devdata *dd)
|
||||
static void postinit_cleanup(struct hfi1_devdata *dd)
|
||||
{
|
||||
hfi1_start_cleanup(dd);
|
||||
hfi1_comp_vectors_clean_up(dd);
|
||||
hfi1_dev_affinity_clean_up(dd);
|
||||
|
||||
hfi1_pcie_ddcleanup(dd);
|
||||
hfi1_pcie_cleanup(dd->pcidev);
|
||||
|
Reference in New Issue
Block a user