From nobody Mon Nov 11 16:39:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XnFd76tH1z5cJPd; Mon, 11 Nov 2024 16:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XnFd75dL0z4GMM; Mon, 11 Nov 2024 16:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731343179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MAb2xmr9tcazybh9vDxIpQr7drwYMJmQVybltl1cUgM=; b=W5uI8ZfUk1tkqxkjTOqg4OSayEwpOk6mqYL0IGU9VXFMGdJFnEEMB3sz9KZA8xXVwRoNv0 tKw65b8quA/cSUT+TESuCzLSUNafqE5HJRJDfzXyHVKgEtiLj8jo/3kY8nB1TarOTMAhfN Iyjh31X6UNwHnftGoCFPcDLrXq03IK7Lc5787iqvlkXsqSvZLb/FYdrt/ZeHvxDMyrTZpO o73wtdtrvlW6QaBleE0ntSJ3rUa4jmmatz+EA6r4qItI5dCIyShODp9lyNsFMuqrJAlcS8 sQ26VawiH88wJi3Rg/mOTHeJ6uuD4/FyRqS2eDX7PKWysme1vi45SotbEGN1MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731343179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MAb2xmr9tcazybh9vDxIpQr7drwYMJmQVybltl1cUgM=; b=kPRvxxcFe+ASvUT797++Eak2LPTA8vffX/vYOFvXtedJsvdFVOG6ls09WaziBzjrOF4xMd eXx6JYKsXZTdU6xalsJnII7LYrQ/kiqPenHuDc1QxqUjy308dKpC+PX21CG3R91uMiudec qDQklWGWE6lvcyD6j70E6c38gYJFqZBdBv5D6f2xUPdk4o8zLL3ltut9sEiAuSzE+9q55s refO1dJAlO0HpbNJGzdhEhm3vOXlVpKZi5OKerM/V14Wv+EBYfindwDqNA+0qd4IGHA1nA LSSJsFNkObAzF/aKz1m7za++NPGle+CphxbyHgGhVrMQTTqwjq2r0eIA4/mwjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731343179; a=rsa-sha256; cv=none; b=e6rx8vwLzO+EonlaEaVkD2uinKZLv1EFbS9dn/0exPasQOxnNacfXzoEXGNZ69svXkWm3o nIYZPEAlOs1Pemx+7pXaCAQ3VljfnHw9YmmTSMSG6pgu4mhuHLSsKTWRDMiKpGUw/Eqnuo 5LgL5Nbhfw/TKYp7dSEIwzOeL/yTOaD++sE5BPDQgMzGsYYgzwQ2ND8RtZNEum4f5eWawO h6jh0NzduMhOYreX5gHd0Hz1DZpU0/wH8ndMcQseU693GFb0c97R5pzg+C6Z2+xNdCVVi2 AiSkPzilnj80zXdmXALy6je40XzClFZQI9GQeFOs7Hny9dH/YCmief7mLgYwYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XnFd74Q4WzYRK; Mon, 11 Nov 2024 16:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4ABGdduM070452; Mon, 11 Nov 2024 16:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ABGddRw070449; Mon, 11 Nov 2024 16:39:39 GMT (envelope-from git) Date: Mon, 11 Nov 2024 16:39:39 GMT Message-Id: <202411111639.4ABGddRw070449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3ff90d91b433 - main - nvmf: Schedule requests across multiple I/O queues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ff90d91b433c1eafe857ba21470db5e5052b3b6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3ff90d91b433c1eafe857ba21470db5e5052b3b6 commit 3ff90d91b433c1eafe857ba21470db5e5052b3b6 Author: John Baldwin AuthorDate: 2024-11-11 16:37:32 +0000 Commit: John Baldwin CommitDate: 2024-11-11 16:37:32 +0000 nvmf: Schedule requests across multiple I/O queues Similar to nvme(4), use the current CPU to select which I/O queue to use. The assignment in nvmf_attach() had to be moved down since sc->num_io_queues is initialized in nvmf_establish_connection(). Note that nvmecontrol(8) still defaults to using a single I/O queue for an association. Sponsored by: Chelsio Communications --- sys/dev/nvmf/host/nvmf.c | 5 ++--- sys/dev/nvmf/host/nvmf_var.h | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index 804e7528c931..c726e36e1fae 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -479,9 +479,6 @@ nvmf_attach(device_t dev) nvmf_init_aer(sc); - /* TODO: Multiqueue support. */ - sc->max_pending_io = ivars->io_params[0].qsize /* * sc->num_io_queues */; - error = nvmf_establish_connection(sc, ivars); if (error != 0) goto out; @@ -509,6 +506,8 @@ nvmf_attach(device_t dev) NVME_CAP_HI_MPSMIN(sc->cap >> 32))); } + sc->max_pending_io = ivars->io_params[0].qsize * sc->num_io_queues; + error = nvmf_init_sim(sc); if (error != 0) goto out; diff --git a/sys/dev/nvmf/host/nvmf_var.h b/sys/dev/nvmf/host/nvmf_var.h index 0e52f36a80a5..e9f33207fea1 100644 --- a/sys/dev/nvmf/host/nvmf_var.h +++ b/sys/dev/nvmf/host/nvmf_var.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -112,8 +113,8 @@ struct nvmf_completion_status { static __inline struct nvmf_host_qpair * nvmf_select_io_queue(struct nvmf_softc *sc) { - /* TODO: Support multiple queues? */ - return (sc->io[0]); + u_int idx = curcpu * sc->num_io_queues / (mp_maxid + 1); + return (sc->io[idx]); } static __inline bool