Thread (27 messages) 27 messages, 3 authors, 2021-09-09

Re: [PATCH for-next 4/4] RDMA/efa: CQ notifications

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2021-08-20 18:27:06

On Wed, Aug 11, 2021 at 06:11:31PM +0300, Gal Pressman wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
index 417dea5f90cf..29db4dec02f0 100644
+++ b/drivers/infiniband/hw/efa/efa_main.c
@@ -67,6 +67,46 @@ static void efa_release_bars(struct efa_dev *dev, int bars_mask)
 	pci_release_selected_regions(pdev, release_bars);
 }
 
+static void efa_process_comp_eqe(struct efa_dev *dev, struct efa_admin_eqe *eqe)
+{
+	u16 cqn = eqe->u.comp_event.cqn;
+	struct efa_cq *cq;
+
+	cq = xa_load(&dev->cqs_xa, cqn);
+	if (unlikely(!cq)) {
This seems unlikely to be correct, what prevents cq from being
destroyed concurrently?

A comp_handler cannot be running after cq destroy completes.
quoted hunk ↗ jump to hunk
@@ -421,6 +551,7 @@ static struct efa_dev *efa_probe_device(struct pci_dev *pdev)
 	edev->efa_dev = dev;
 	edev->dmadev = &pdev->dev;
 	dev->pdev = pdev;
+	xa_init_flags(&dev->cqs_xa, XA_FLAGS_LOCK_IRQ);
And this is confusing too, since the above is the only reference and
doesn't take the xa_lock why does the xa need to use LOCK_IRQ?

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help