The branch main has been updated by seuros:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f195b9f3f6f768ff2ae1e4523cab59a305666491

commit f195b9f3f6f768ff2ae1e4523cab59a305666491
Author:     Abdelkader Boudih <[email protected]>
AuthorDate: 2026-09-08 00:20:53 +0000
Commit:     Abdelkader Boudih <[email protected]>
CommitDate: 2026-09-08 00:20:53 +0000

    nvme: limit I/O queue trackers to Identify MAXCMD
    
    MAXCMD is the maximum number of commands the controller processes at
    one time for a particular I/O queue. Allocating more trackers than
    that only queues commands inside the controller. Controllers
    reporting 0 are unaffected.
    
    Approved by: ngie (co-mentor)
    
    Reviewed by:    ngie, imp
    Differential Revision:  https://reviews.freebsd.org/D59154
---
 sys/dev/nvme/nvme_ctrlr.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index 5c90e252b748..a8d8d1b99647 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -191,6 +191,13 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller 
*ctrlr)
         */
        num_trackers = min(num_trackers, (num_entries-1));
 
+       if (ctrlr->cdata.maxcmd != 0 && num_trackers > ctrlr->cdata.maxcmd) {
+               nvme_printf(ctrlr,
+                   "limiting trackers per I/O queue to MAXCMD (%u -> %u)\n",
+                   num_trackers, ctrlr->cdata.maxcmd);
+               num_trackers = ctrlr->cdata.maxcmd;
+       }
+
        if (ctrlr->quirks & QUIRK_APPLE_SHARED_CID_SPACE)
                num_trackers = min(num_trackers,
                    NVME_ADMIN_ENTRIES - ctrlr->adminq.num_trackers);

Reply via email to