From nobody Mon Oct 21 15:24:51 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 4XXJyX0sr2z5ZQF7; Mon, 21 Oct 2024 15:24:52 +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 4XXJyX0Jhnz4pQt; Mon, 21 Oct 2024 15:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729524292; 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=K0tTN8Y2rQKDQGhMZnZ8hkW7QTcihM72O3e3z0D+4zg=; b=SbtwfxHTa31Xls2UQcwNCi3X0khc+TA4AQ7Y+PP9fuV4XHD2zIWkVyjDkfLVpPobeqQVxw mrq8zjUF416SeRpFsPLo/CM3wyNAUUIerE8JIpr9BxRj2RQn7snM9POMnstva0YVM4J1xY 0z77gBLfvsjjCWnLR8lakK3H+7vBt+eKgt/3gaeAk2tGQCO/T8+GmaQ41px6JeD92D9j0g SGgz3Md4iKetUgieiDcpb/ccfrvMxDSgDVADYe4Dn8vZkZjldC2bOrPtHyyoEIvZ64m+hE e4NRXVu7JemOoZzrXMljL0X+WX58oKuzuZUu0Jsw1mhBaEvYwi/up4wcc1RNRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729524292; 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=K0tTN8Y2rQKDQGhMZnZ8hkW7QTcihM72O3e3z0D+4zg=; b=sbhnfxghct0U3mHCZcC4/417yolwljThNCTVvimWxl2eJQhLJNW6HjQhCxv8TD2pBSheUk sL2NRU9TwzZfbwdra+rPmccgp33MaujGZu4Z/bRfCA7P+cYWs7sjbshIt8H83aBapli9tX hMXaciCbzQtGel9rgOahviPU/UwobgvVA49vgeyD2DkTm5KYIYwP/yNV7ajwdYcGg6bz+n gXOI3LPp2JIiGJ4L5YDY4BrcuR9YVASlWhqAZqFoH1URoYdY5x1nM0wsrTA+XDHgsMythn k2vz3Fee7k8eI/6+ENH6XwU3OAKFJVTSYMT48TAoWWdM8CcfhhjyvBwqjKB71A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729524292; a=rsa-sha256; cv=none; b=cjPgxnHikz2+xaAn27BwUIvxD/+D+IPyYQzXBQZi+yVb5aPWUTNjYzLwISTdoOYNhqo/uJ CPmsarESVCusfM0+hUAeKcqF28VCKi8z1k0UcyxuiNd72lOs9+UirVX8fip/YUE399i5Yq YhUKZagHjorqnDPZW0D5aKlFKBbnguVXg9wabcubeCZDVIxVc9AsTcYzvIy71pJ/FK/YyJ rAz7JPicSfeSdKQAXfym2vvrqK5nxKrSSKZU+c0Iv+QVcKfxzuEJzF954tdOPv1Jl1mRt1 SHbwV+9JL3bKWtSZhkfCxMiHQQc9jlz7mAkDVtQpIbKasDBv0semyxziERM+nw== 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 4XXJyW71pPzbYK; Mon, 21 Oct 2024 15:24:51 +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 49LFOpCV083922; Mon, 21 Oct 2024 15:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LFOp3k083919; Mon, 21 Oct 2024 15:24:51 GMT (envelope-from git) Date: Mon, 21 Oct 2024 15:24:51 GMT Message-Id: <202410211524.49LFOp3k083919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: dd8392810169 - stable/13 - igc: Add sysctl for DMA Coalesce 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dd8392810169827e53586c1864c5d6b3be259605 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=dd8392810169827e53586c1864c5d6b3be259605 commit dd8392810169827e53586c1864c5d6b3be259605 Author: Kevin Bowling AuthorDate: 2024-10-14 12:55:18 +0000 Commit: Kevin Bowling CommitDate: 2024-10-21 15:11:52 +0000 igc: Add sysctl for DMA Coalesce This feature can increase efficiency at the expense of latency It does not work well with the default interrupt delay, but expose the otherwise unconnected code in the driver in case people want to experiment. See https://www.intel.com/content/dam/support/us/en/documents/network/adapter/pro100/sb/466827_intel_r__dma_coalescing_white_paper_v003.pdf Sponsored by: BBOX.io (cherry picked from commit 68b1f5dc59368ce5175e3300bf95476ea5a560bc) --- sys/dev/igc/if_igc.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 7d95c2909b7a..d73b3a9aa510 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -141,6 +141,7 @@ static int igc_msix_link(void *); static void igc_handle_link(void *context); static int igc_set_flowcntl(SYSCTL_HANDLER_ARGS); +static int igc_sysctl_dmac(SYSCTL_HANDLER_ARGS); static int igc_sysctl_eee(SYSCTL_HANDLER_ARGS); static int igc_get_regs(SYSCTL_HANDLER_ARGS); @@ -491,6 +492,12 @@ igc_if_attach_pre(if_ctx_t ctx) CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, adapter, 0, igc_get_rs, "I", "Dump RS indexes"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "dmac", + CTLTYPE_INT | CTLFLAG_RW, adapter, 0, + igc_sysctl_dmac, "I", "DMA Coalesce"); + /* Determine hardware and mac info */ igc_identify_hardware(ctx); @@ -3031,6 +3038,55 @@ igc_set_flowcntl(SYSCTL_HANDLER_ARGS) return (error); } +/* + * Manage DMA Coalesce: + * Control values: + * 0/1 - off/on + * Legal timer values are: + * 250,500,1000-10000 in thousands + */ +static int +igc_sysctl_dmac(SYSCTL_HANDLER_ARGS) +{ + struct igc_adapter *sc = (struct igc_adapter *) arg1; + int error; + + error = sysctl_handle_int(oidp, &sc->dmac, 0, req); + + if ((error) || (req->newptr == NULL)) + return (error); + + switch (sc->dmac) { + case 0: + /* Disabling */ + break; + case 1: /* Just enable and use default */ + sc->dmac = 1000; + break; + case 250: + case 500: + case 1000: + case 2000: + case 3000: + case 4000: + case 5000: + case 6000: + case 7000: + case 8000: + case 9000: + case 10000: + /* Legal values - allow */ + break; + default: + /* Do nothing, illegal value */ + sc->dmac = 0; + return (EINVAL); + } + /* Reinit the interface */ + igc_if_init(sc->ctx); + return (error); +} + /* * Manage Energy Efficient Ethernet: * Control values: