From nobody Thu Apr 18 23:23:17 2024 X-Original-To: dev-commits-src-main@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 4VLDNP5vJnz5HJ98; Thu, 18 Apr 2024 23:23:17 +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 4VLDNP5Fv5z4kGv; Thu, 18 Apr 2024 23:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713482597; 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=1lRQpwMReINw9QnX8oR8pqBtnlYhdD7WHcwNxfOoctk=; b=AfK39SHC5nPXX6rg0CMICPFPPAARZlJ7AiysXcu0lA89XexTQkCnZIgrwE6c9hWUjkdicC 2KzY8J5eog8nIPi81JqXg8RrPnEBNuVZ3wo1GQ6DLBDTI4SLWcjfsFOFLyHF7RRxKKUv4P F0V8YAdzw7yzUVOGuTPQZZDc9e+7O+gsVaofdqa3OVMM9OS9VkY1gOA4KkTzKj1jGM++7W odFMDJReLE69Em4QFSZYRyJCeP679j5fxw5DCURcJ52tfVrFwhPGrgna39S4sIGmB1xYWC z2J/YahGMKR98kwAxWnPLGnolq9/Omv6Zp1jtBYc0DprX+6Crn2+Ig3+iTNiKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713482597; a=rsa-sha256; cv=none; b=vZyFRYP81Dhh07LwjfBWh1yzSonPFcYRW7F3YkU4qjp6yuKdGSVPeiTaPZL7Z0w/3Jbplp 40U7474mpl1PlpsrNGCNyrrgXkvMuMN7kLH60pAxA2X3T5U+BBa3MJtPzbsiYaC4VaDaNH PSM3mYnWlI+SCFVkt5x2W1aCs5toQzYtlJlNdGYGVByZtv3I4q+Sjqfsd1zRfJLWBfzRWv Viar7t1cKzlYXLfOB5tfFYdl6mO8iKEV1gku3LG4WbDqCeU2YclV5TQuFVyRBCm8scRGQh WECfljyXtH37aU1adbfHvYZl8cGkhUBo9L+UB5kP33mrjdPr8EtIbhDOHzXlMQ== 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=1713482597; 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=1lRQpwMReINw9QnX8oR8pqBtnlYhdD7WHcwNxfOoctk=; b=IkauPCoZAmCmj41oeIxSq6JOmWwRwlWVvfZFLeEvoFZsw2NzzIVi8OedfiNpx1CT0MTAMS AvbbvSdvh4Z2TdwtTBy/Xgrhj9Gtwk/1tDL4q9CrZhWarcXNZI0Zw8rs3X9XHTOBB/lqQk SiwlOv4PFKIpPO6nrwuplelHQAeSXTqTudwVtW7Iqtbj0VnUuoFnu/vXsfqsnKmkefm9sC 8bWpiXcGSUvDpJ/pnaIkrM2RlNe3tHL3NWmELXm/IXn0Z5nwDuTBMmN3bm443Cp/U6quZU xDAhiNzrAycHc1nC92xWdWdzg5+OUHltI6ejQAMtQzEJ8Gc0Yy65VCzZJLk0Gw== 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 4VLDNP4r1RzVc7; Thu, 18 Apr 2024 23:23:17 +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 43INNH21045545; Thu, 18 Apr 2024 23:23:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43INNH1u045542; Thu, 18 Apr 2024 23:23:17 GMT (envelope-from git) Date: Thu, 18 Apr 2024 23:23:17 GMT Message-Id: <202404182323.43INNH1u045542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 3c7da27a473e - main - iflib: Add sysctl to request extra MSIX vectors on driver load List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 3c7da27a473e339392121404e06c506df040c16f Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=3c7da27a473e339392121404e06c506df040c16f commit 3c7da27a473e339392121404e06c506df040c16f Author: Eric Joyner AuthorDate: 2023-03-22 19:18:44 +0000 Commit: Eric Joyner CommitDate: 2024-04-18 23:13:47 +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 MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D41326 --- 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 5e1f71f6f9c2..9be99df08a81 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))) @@ -6803,6 +6811,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_ */