From nobody Wed Jul 31 04:38:19 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 4WYfVN0F18z5Sc09; Wed, 31 Jul 2024 04:38:20 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVM5Pqcz4XNd; Wed, 31 Jul 2024 04:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400699; 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=j7WiNdffnALDKOY38WH7PAo1MLCEIQMuXy/msQ++RLY=; b=Hl+iRFNIxp8fLAcMcSUWpwT0LgvbSJCHFrno6A495lTDbs3VRMr8VCngw+CZn2cIcpPAQ5 Dm/URfnOt5OzKPHjDgfa11QTBcHEjeebRxP07dm21E0meOiqaBn0PKjStw4YVxiYUz/WMZ keJwIkDlYyeRa9pDBpAggx2yDMHoBYoVLy+g2gU2wvTNSd+n/jOXVWS19364qAJuiuK188 WCWBk7yks8wNffhmBHK++FZGzPXuH4sKaSoPSAoQYuugHSfa2KyyVlNwfURajfCuSxPjHh 2Fuhw7ELRHlV16wuMhFmfsYoYMkEZ1Bgeg03h1YQLbwv4gyaCulg7AZP+07l2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400699; a=rsa-sha256; cv=none; b=ufeaHxkBKR+YwlVMLMYhh3OfKvfBoe6TYzrq7HiiMONDa2hYr9G5iVfHdd4JHmu+KIhCTg uL+0qa97doOKy5ulYKJO1z6CS9Y/ecbGiiaAQhD9pBCnhWqw0TbcCRoccsU1ru8nUwQzn9 veN6VQYv8FUH2PTmgoI4KfkdZOaeEz2JfxqUVvQFT85HHKbEqUfQcYvvMqXI2+GjZ2j5vx /P6crbYsQbS+OQ8p+/rasu7URWB4CKBPn+D6tK5Wn/oGbkPilbdOQ0uqQ4MZ4+iNw5ZKhT qIwO9wSX5NkOh4nNtRupVDovaZTg4EWxDKsVsAIaGRTkvLTYpye1NiZdMhqlSA== 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=1722400699; 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=j7WiNdffnALDKOY38WH7PAo1MLCEIQMuXy/msQ++RLY=; b=K68MKiofld9EXkEUGaIYpy+cgglLXF1f4PXFEfXAjy7niWfBMzVSXrHkUQAyF2OsSju1yP YVKIpFAI43rws+Nqtc9gpHSTxSQ4xyuQ7mMWNZ5XCrpFuLfZR1c8mTuyayVmLiOcWY0fa0 p8DG09jDt7/OnjA+rn75GOi/D/5cbhrEmZ67nPFb8Niz5npkLSD8vG9aT29MsnD+dKFHgz KoA90Evk9AL0xdjvDE50PWh/jUXHLF0DrMJ46qqqsemDgquvdcwo3BVVZT2n2DqcigdxSe 1Gh/x47LPrNiYgrsyqP6RsWZbMTLMyeEM0ivNcZEYbLaunG02+LpTxLskEu2vQ== 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 4WYfVM4dngzm9r; Wed, 31 Jul 2024 04:38:19 +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 46V4cJLn068574; Wed, 31 Jul 2024 04:38:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cJJl068571; Wed, 31 Jul 2024 04:38:19 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:19 GMT Message-Id: <202407310438.46V4cJJl068571@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: 1eb348e090fd - stable/13 - iflib: Add sysctl to request extra MSIX vectors on driver load 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1eb348e090fd3bda6c0f799fc4a22568f579f576 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=1eb348e090fd3bda6c0f799fc4a22568f579f576 commit 1eb348e090fd3bda6c0f799fc4a22568f579f576 Author: Eric Joyner AuthorDate: 2023-03-22 19:18:44 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:21 +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 fec432a0cb65..ed82ff9a3d09 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]; @@ -270,6 +271,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))) @@ -7027,6 +7035,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 a444a4937a3c..f9b1045266c4 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -498,6 +498,7 @@ 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); /* * Pseudo device support