From nobody Wed Apr 24 22:14:59 2024 X-Original-To: dev-commits-src-branches@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 4VPtZq5PQhz5JDdl; Wed, 24 Apr 2024 22:14:59 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VPtZq4tCHz4dNl; Wed, 24 Apr 2024 22:14:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713996899; 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=gbwcMY7oJ0dr8cBa23TzWJ/HP1YAC2DcqYTjaLeorZ4=; b=FFQ/ZbLEngbGcB7Kf7kZ5R9u4kRKHhqnXxTH/Nj8rZFsUxpHLQN7s/KxYuV/12jNG6nUVm fJ9uCuj8s2C064xvLsO1V+Tvmn8eiuSOXVRtIH/46+hmC+u2sym0R2JHvCY8a7aFIqspdq y6FgxQR5AKK9IdQid84D+0ASMbeDHPF6mB3/Jvn9JVklvTJozK91B2f99Gh8PoPD3OX9c7 3BZLPJgHeWkm0N1Psd/jki7J9LRt/H2nyPzTxsFNHOsetpOigak4upInVkheKgNWhm0CoI LsWwGcnQRkjArZdXEFDhxOjEkwCvUYXOEIGzmc56qnG+12K9Xm5UXyHc2F336Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713996899; a=rsa-sha256; cv=none; b=I1CBAyor/rGxok85H2cMeRjZ1U+YTj9eEKOtOEoeIRYe3WA1GFCa5o/+hKPCBFh0Tz3dtk mCcIKV9uG8G8eido6+B5Jfevxsvb3oR/K+ShqWaY1RqRFVVYSv9wzzrRy+Zakb9usJnoA5 zqT5GRuVA7uCk3HVS0RJ/lX35Zns11H6P5RBylaWqSMHR5pnGbkltnK3FQ5S//MTvFwy9l rwGBy6t9utp9JocHoJaNS9F7CaPOyymi5XGyfSoTp9t2Wm9z4dbhfPoj7bUrvPUvPU5q8o 4bHTdybU3y0++W307Ypq6ZpWSrE2guoh/4C7wRKTOwwJFyK0OSgMhU5OwlLcZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713996899; 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=gbwcMY7oJ0dr8cBa23TzWJ/HP1YAC2DcqYTjaLeorZ4=; b=dr4xbiuyWpJdsMF5vKw5gTt+9yhRkLoMl3crDrOzTQtgHMJkcYoNn5aiP+ril3Tg8hfwNY nacH0w70XVv6aQUG/bNJEamBcBJZhxboIW1P7yq5XTKtgedi75ok640k93wz8KtIuiQUMj SUdlZzkRczXVAGqOBGK4LYKCLercejTzVW8jcsxM6TxCym4z4YoPYY+iYgh2NdFmYKjVIr fMFZXhOc5KXHPr7rK4zLddDcdkhkPXomm028sFTXcSd8MzQx4qWDi/Pcfqt5A+m5JqTFsI B7pUePSsj1q+T0mO9+fPhU8VxBR47Xsl5FJoNmhvtX19Iaha86mdKLURvEH0qA== 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 4VPtZq4TWTzYvT; Wed, 24 Apr 2024 22:14:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43OMExtE071293; Wed, 24 Apr 2024 22:14:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43OMExmi071290; Wed, 24 Apr 2024 22:14:59 GMT (envelope-from git) Date: Wed, 24 Apr 2024 22:14:59 GMT Message-Id: <202404242214.43OMExmi071290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: ff28ca091142 - stable/14 - iflib: Add sysctl to request extra MSIX vectors on driver load List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ff28ca091142538330b3469be7c9af678db65107 Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=ff28ca091142538330b3469be7c9af678db65107 commit ff28ca091142538330b3469be7c9af678db65107 Author: Eric Joyner AuthorDate: 2023-03-22 19:18:44 +0000 Commit: Eric Joyner CommitDate: 2024-04-24 22:14:48 +0000 iflib: Add sysctl to request extra MSIX vectors on driver load Intended to be used with upcoming feature to add sub-interfaces, since those new interfaces will be dynamically created and will need to have spare MSI-X interrupts already allocated for them on driver load. This sysctl is marked as a tunable since it will need to be set before the driver is loaded since MSI-X interrupt allocation and setup is done during the attach process. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D41326 (cherry picked from commit 3c7da27a473e339392121404e06c506df040c16f) --- sys/net/iflib.c | 14 ++++++++++++++ sys/net/iflib.h | 1 + 2 files changed, 15 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 999a86fabc79..ac27450480c9 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -194,6 +194,7 @@ struct iflib_ctx { #define CORE_OFFSET_UNSPECIFIED 0xffff uint8_t ifc_sysctl_separate_txrx; uint8_t ifc_sysctl_use_logical_cores; + uint16_t ifc_sysctl_extra_msix_vectors; bool ifc_cpus_are_physical_cores; qidx_t ifc_sysctl_ntxds[8]; @@ -264,6 +265,13 @@ iflib_get_sctx(if_ctx_t ctx) return (ctx->ifc_sctx); } +uint16_t +iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx) +{ + + return (ctx->ifc_sysctl_extra_msix_vectors); +} + #define IP_ALIGNED(m) ((((uintptr_t)(m)->m_data) & 0x3) == 0x2) #define CACHE_PTR_INCREMENT (CACHE_LINE_SIZE/sizeof(void*)) #define CACHE_PTR_NEXT(ptr) ((void *)(((uintptr_t)(ptr)+CACHE_LINE_SIZE-1) & (CACHE_LINE_SIZE-1))) @@ -6802,6 +6810,12 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "use_logical_cores", CTLFLAG_RDTUN, &ctx->ifc_sysctl_use_logical_cores, 0, "try to make use of logical cores for TX and RX"); + SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "use_extra_msix_vectors", + CTLFLAG_RDTUN, &ctx->ifc_sysctl_extra_msix_vectors, 0, + "attempt to reserve the given number of extra MSI-X vectors during driver load for the creation of additional interfaces later"); + SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "allocated_msix_vectors", + CTLFLAG_RDTUN, &ctx->ifc_softc_ctx.isc_vectors, 0, + "total # of MSI-X vectors allocated by driver"); /* XXX change for per-queue sizes */ SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", diff --git a/sys/net/iflib.h b/sys/net/iflib.h index b16e2805aab6..5e1adccf202c 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -489,5 +489,6 @@ void iflib_led_create(if_ctx_t ctx); void iflib_add_int_delay_sysctl(if_ctx_t, const char *, const char *, if_int_delay_info_t, int, int); +uint16_t iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx); #endif /* __IFLIB_H_ */