Lines Matching +full:msi +full:- +full:base +full:- +full:vec
1 // SPDX-License-Identifier: GPL-2.0
15 * - NPS packet ring, AQMQ ring and ZQMQ ring
19 /* base entry for packet ring/port */
24 * nps_pkt_slc_isr - IRQ handler for NPS solicit port
32 struct nitrox_cmdq *cmdq = qvec->cmdq; in nps_pkt_slc_isr()
34 slc_cnts.value = readq(cmdq->compl_cnt_csr_addr); in nps_pkt_slc_isr()
37 tasklet_hi_schedule(&qvec->resp_tasklet); in nps_pkt_slc_isr()
207 struct nitrox_device *ndev = qvec->ndev; in nps_core_int_tasklet()
210 if (ndev->mode == __NDEV_MODE_PF) { in nps_core_int_tasklet()
220 * nps_core_int_isr - interrupt handler for NITROX errors and
226 struct nitrox_device *ndev = qvec->ndev; in nps_core_int_isr()
265 struct pci_dev *pdev = ndev->pdev; in nitrox_unregister_interrupts()
268 for (i = 0; i < ndev->num_vecs; i++) { in nitrox_unregister_interrupts()
270 int vec; in nitrox_unregister_interrupts() local
272 qvec = ndev->qvec + i; in nitrox_unregister_interrupts()
273 if (!qvec->valid) in nitrox_unregister_interrupts()
277 vec = pci_irq_vector(pdev, i); in nitrox_unregister_interrupts()
278 irq_set_affinity_hint(vec, NULL); in nitrox_unregister_interrupts()
279 free_irq(vec, qvec); in nitrox_unregister_interrupts()
281 tasklet_disable(&qvec->resp_tasklet); in nitrox_unregister_interrupts()
282 tasklet_kill(&qvec->resp_tasklet); in nitrox_unregister_interrupts()
283 qvec->valid = false; in nitrox_unregister_interrupts()
285 kfree(ndev->qvec); in nitrox_unregister_interrupts()
286 ndev->qvec = NULL; in nitrox_unregister_interrupts()
292 struct pci_dev *pdev = ndev->pdev; in nitrox_register_interrupts()
294 int nr_vecs, vec, cpu; in nitrox_register_interrupts() local
298 * PF MSI-X vectors in nitrox_register_interrupts()
311 dev_err(DEV(ndev), "Error in getting vec count %d\n", nr_vecs); in nitrox_register_interrupts()
315 /* Enable MSI-X */ in nitrox_register_interrupts()
321 ndev->num_vecs = nr_vecs; in nitrox_register_interrupts()
323 ndev->qvec = kcalloc(nr_vecs, sizeof(*qvec), GFP_KERNEL); in nitrox_register_interrupts()
324 if (!ndev->qvec) { in nitrox_register_interrupts()
326 return -ENOMEM; in nitrox_register_interrupts()
330 for (i = PKT_RING_MSIX_BASE; i < (nr_vecs - 1); i += NR_RING_VECTORS) { in nitrox_register_interrupts()
331 qvec = &ndev->qvec[i]; in nitrox_register_interrupts()
333 qvec->ring = i / NR_RING_VECTORS; in nitrox_register_interrupts()
334 if (qvec->ring >= ndev->nr_queues) in nitrox_register_interrupts()
337 qvec->cmdq = &ndev->pkt_inq[qvec->ring]; in nitrox_register_interrupts()
338 snprintf(qvec->name, IRQ_NAMESZ, "nitrox-pkt%d", qvec->ring); in nitrox_register_interrupts()
340 vec = pci_irq_vector(pdev, i); in nitrox_register_interrupts()
341 ret = request_irq(vec, nps_pkt_slc_isr, 0, qvec->name, qvec); in nitrox_register_interrupts()
344 qvec->ring); in nitrox_register_interrupts()
347 cpu = qvec->ring % num_online_cpus(); in nitrox_register_interrupts()
348 irq_set_affinity_hint(vec, get_cpu_mask(cpu)); in nitrox_register_interrupts()
350 tasklet_init(&qvec->resp_tasklet, pkt_slc_resp_tasklet, in nitrox_register_interrupts()
352 qvec->valid = true; in nitrox_register_interrupts()
357 qvec = &ndev->qvec[i]; in nitrox_register_interrupts()
358 qvec->ndev = ndev; in nitrox_register_interrupts()
360 snprintf(qvec->name, IRQ_NAMESZ, "nitrox-core-int%d", i); in nitrox_register_interrupts()
362 vec = pci_irq_vector(pdev, i); in nitrox_register_interrupts()
363 ret = request_irq(vec, nps_core_int_isr, 0, qvec->name, qvec); in nitrox_register_interrupts()
365 dev_err(DEV(ndev), "irq failed for nitrox-core-int%d\n", i); in nitrox_register_interrupts()
369 irq_set_affinity_hint(vec, get_cpu_mask(cpu)); in nitrox_register_interrupts()
371 tasklet_init(&qvec->resp_tasklet, nps_core_int_tasklet, in nitrox_register_interrupts()
373 qvec->valid = true; in nitrox_register_interrupts()
384 struct pci_dev *pdev = ndev->pdev; in nitrox_sriov_unregister_interrupts()
387 for (i = 0; i < ndev->num_vecs; i++) { in nitrox_sriov_unregister_interrupts()
389 int vec; in nitrox_sriov_unregister_interrupts() local
391 qvec = ndev->qvec + i; in nitrox_sriov_unregister_interrupts()
392 if (!qvec->valid) in nitrox_sriov_unregister_interrupts()
395 vec = ndev->iov.msix.vector; in nitrox_sriov_unregister_interrupts()
396 irq_set_affinity_hint(vec, NULL); in nitrox_sriov_unregister_interrupts()
397 free_irq(vec, qvec); in nitrox_sriov_unregister_interrupts()
399 tasklet_disable(&qvec->resp_tasklet); in nitrox_sriov_unregister_interrupts()
400 tasklet_kill(&qvec->resp_tasklet); in nitrox_sriov_unregister_interrupts()
401 qvec->valid = false; in nitrox_sriov_unregister_interrupts()
403 kfree(ndev->qvec); in nitrox_sriov_unregister_interrupts()
404 ndev->qvec = NULL; in nitrox_sriov_unregister_interrupts()
410 struct pci_dev *pdev = ndev->pdev; in nitrox_sriov_register_interupts()
412 int vec, cpu; in nitrox_sriov_register_interupts() local
417 * for PF in SR-IOV mode. in nitrox_sriov_register_interupts()
419 ndev->iov.msix.entry = NON_RING_MSIX_BASE; in nitrox_sriov_register_interupts()
420 ret = pci_enable_msix_exact(pdev, &ndev->iov.msix, NR_NON_RING_VECTORS); in nitrox_sriov_register_interupts()
422 dev_err(DEV(ndev), "failed to allocate nps-core-int%d\n", in nitrox_sriov_register_interupts()
430 return -ENOMEM; in nitrox_sriov_register_interupts()
432 qvec->ndev = ndev; in nitrox_sriov_register_interupts()
434 ndev->qvec = qvec; in nitrox_sriov_register_interupts()
435 ndev->num_vecs = NR_NON_RING_VECTORS; in nitrox_sriov_register_interupts()
436 snprintf(qvec->name, IRQ_NAMESZ, "nitrox-core-int%d", in nitrox_sriov_register_interupts()
439 vec = ndev->iov.msix.vector; in nitrox_sriov_register_interupts()
440 ret = request_irq(vec, nps_core_int_isr, 0, qvec->name, qvec); in nitrox_sriov_register_interupts()
442 dev_err(DEV(ndev), "irq failed for nitrox-core-int%d\n", in nitrox_sriov_register_interupts()
447 irq_set_affinity_hint(vec, get_cpu_mask(cpu)); in nitrox_sriov_register_interupts()
449 tasklet_init(&qvec->resp_tasklet, nps_core_int_tasklet, in nitrox_sriov_register_interupts()
451 qvec->valid = true; in nitrox_sriov_register_interupts()