From 443473d2f3a53100cfde67415feddde2b8781732 Mon Sep 17 00:00:00 2001 From: Michal Kalderon Date: Sun, 26 May 2019 15:22:24 +0300 Subject: qedr: Change the MSI-X vectors selection to be based on affined engine Use the msix vectors of the affined hwfn and not the leading one. Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller --- drivers/infiniband/hw/qedr/main.c | 9 +++++++-- drivers/infiniband/hw/qedr/qedr.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/infiniband') diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c index 806b3d0e57d8..055a63144480 100644 --- a/drivers/infiniband/hw/qedr/main.c +++ b/drivers/infiniband/hw/qedr/main.c @@ -505,11 +505,13 @@ static irqreturn_t qedr_irq_handler(int irq, void *handle) static void qedr_sync_free_irqs(struct qedr_dev *dev) { u32 vector; + u16 idx; int i; for (i = 0; i < dev->int_info.used_cnt; i++) { if (dev->int_info.msix_cnt) { - vector = dev->int_info.msix[i * dev->num_hwfns].vector; + idx = i * dev->num_hwfns + dev->affin_hwfn_idx; + vector = dev->int_info.msix[idx].vector; synchronize_irq(vector); free_irq(vector, &dev->cnq_array[i]); } @@ -521,6 +523,7 @@ static void qedr_sync_free_irqs(struct qedr_dev *dev) static int qedr_req_msix_irqs(struct qedr_dev *dev) { int i, rc = 0; + u16 idx; if (dev->num_cnq > dev->int_info.msix_cnt) { DP_ERR(dev, @@ -530,7 +533,8 @@ static int qedr_req_msix_irqs(struct qedr_dev *dev) } for (i = 0; i < dev->num_cnq; i++) { - rc = request_irq(dev->int_info.msix[i * dev->num_hwfns].vector, + idx = i * dev->num_hwfns + dev->affin_hwfn_idx; + rc = request_irq(dev->int_info.msix[idx].vector, qedr_irq_handler, 0, dev->cnq_array[i].name, &dev->cnq_array[i]); if (rc) { @@ -867,6 +871,7 @@ static struct qedr_dev *qedr_add(struct qed_dev *cdev, struct pci_dev *pdev, dev->user_dpm_enabled = dev_info.user_dpm_enabled; dev->rdma_type = dev_info.rdma_type; dev->num_hwfns = dev_info.common.num_hwfns; + dev->affin_hwfn_idx = dev->ops->common->get_affin_hwfn_idx(cdev); dev->rdma_ctx = dev->ops->rdma_get_rdma_ctx(cdev); dev->num_cnq = dev->ops->rdma_get_min_cnq_msix(cdev); diff --git a/drivers/infiniband/hw/qedr/qedr.h b/drivers/infiniband/hw/qedr/qedr.h index 6175d1e98717..a92ca22e5de1 100644 --- a/drivers/infiniband/hw/qedr/qedr.h +++ b/drivers/infiniband/hw/qedr/qedr.h @@ -157,6 +157,8 @@ struct qedr_dev { u32 dp_module; u8 dp_level; u8 num_hwfns; +#define QEDR_IS_CMT(dev) ((dev)->num_hwfns > 1) + u8 affin_hwfn_idx; u8 gsi_ll2_handle; uint wq_multiplier; -- cgit v1.2.3