[PATCH] nvmet: pci-epf: Keep completion queues mapped

Damien Le Moal dlemoal at kernel.org
Wed Mar 12 23:35:43 PDT 2025


On 3/13/25 15:32, Christoph Hellwig wrote:
> On Thu, Mar 13, 2025 at 10:12:06AM +0900, Damien Le Moal wrote:
>> Instead of mapping and unmapping the completion queues memory to the
>> host PCI address space whenever nvmet_pci_epf_cq_work() is called, map
>> a completion queue to the host PCI address space when the completion
>> queue is created with nvmet_pci_epf_create_cq() and unmap it when the
>> completion queue is deleted with nvmet_pci_epf_delete_cq().
> 
> Yeah, that sounds much more sensible..
> 
>> +
>> +static inline void nvmet_pci_epf_unmap_queue(struct nvmet_pci_epf_ctrl *ctrl,
>> +					     struct nvmet_pci_epf_queue *queue)
>> +{
>> +	nvmet_pci_epf_mem_unmap(ctrl->nvme_epf, &queue->pci_map);
>> +}
> 
> Is there much of a point in having this wrapper?

Maybe not anymore. It was used also for SQs in earlier versions. I will send a
patch to remove it. nvmet_pci_epf_map_queue() is also used in one place only, so
it can be open coded too.

> 
> With or without it the change looks good:
> 
> Reviewed-by: Christoph Hellwig <hch at lst.de>


-- 
Damien Le Moal
Western Digital Research



More information about the Linux-nvme mailing list