[PATCH 2/5] nvmet: cq: prepare for completion queue sharing

Wilfred Mallawa wilfred.mallawa at wdc.com
Wed May 7 00:47:27 PDT 2025


On Wed, 2025-05-07 at 16:38 +0900, Damien Le Moal wrote:
> On 5/7/25 4:34 PM, Wilfred Mallawa wrote:
> > > > diff --git a/drivers/nvme/target/pci-epf.c
> > > > b/drivers/nvme/target/pci-epf.c
> > > > index 7fab7f3d79b7..7dda4156d86c 100644
> > > > --- a/drivers/nvme/target/pci-epf.c
> > > > +++ b/drivers/nvme/target/pci-epf.c
> > > > @@ -1346,6 +1346,7 @@ static u16 nvmet_pci_epf_delete_cq(struct
> > > > nvmet_ctrl *tctrl, u16 cqid)
> > > >  	nvmet_pci_epf_drain_queue(cq);
> > > >  	nvmet_pci_epf_remove_irq_vector(ctrl, cq->vector);
> > > >  	nvmet_pci_epf_mem_unmap(ctrl->nvme_epf, &cq->pci_map);
> > > > +	tctrl->cqs[cqid] = NULL;
> > > 
> > > I do not think we need for this hunk in this patch as we are not
> > > yet
> > > using the
> > > cqs array, and patch 4 removes this line to change it with a call
> > > to
> > > nvmet_cq_put().
> > > 
> > Hey Damien,
> > 
> > This is added to undo the effects of `nvmet_cq_setup()`. If we
> > don't,
> > when a CQ is deleted and created (same id) it would incorrectly
> > fail
> > the `create && ctrl->cqs[cqid]` check in nvmet_check_cqid().
> 
> Oops. Yes, absolutely. Forgot that we already are calling
> nvmet_cq_setup().
> Need more coffee :)
ha! yep me too :P
> 
> Sorry for the noise.
> 



More information about the Linux-nvme mailing list