RDMA/bnxt_re: Wait for all the CQ events before freeing CQ data structures
authorSelvin Xavier <selvin.xavier@broadcom.com>
Fri, 13 Mar 2020 17:34:02 +0000 (10:34 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 24 Mar 2020 23:15:36 +0000 (20:15 -0300)
commitb1d56fdcb66ebe6604166d71a26744d3cd03fecb
tree70276e8461ba051f3a2d78f0e4a6753e1c31956e
parenta766fa84738f52f8227eb96aed4362725a82ccf2
RDMA/bnxt_re: Wait for all the CQ events before freeing CQ data structures

Destroy CQ command to firmware returns the num_cnq_events as a
response. This indicates the driver about the number of CQ events
generated for this CQ. Driver should wait for all these events before
freeing the CQ host structures.  Also, add routine to clean all the
pending notification for the CQs getting destroyed. This avoids the
possibility of accessing the CQ data structures after its freed.

Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Link: https://lore.kernel.org/r/1584120842-3200-1-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/bnxt_re/qplib_fp.c
drivers/infiniband/hw/bnxt_re/qplib_fp.h