From nobody Tue Sep 24 10:48:54 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 4XCc6Z4C68z5Xdqw; Tue, 24 Sep 2024 10:48:54 +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 4XCc6Z3XSVz52W5; Tue, 24 Sep 2024 10:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727174934; 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=za/jhMlg2on0xIUDu/kN6seEpkDc8zvM1X7BMDoYcyA=; b=CQuoUSnkNGAAf/RICm9QTNwuaXcvtYWDrwFAun0nQvw4nwlCeIg+bCJUxkABE/EAe+MCLC 8JYOEYl7iBrJ7KKEY1YGLLi7dILYl/8yjHeBKzgtfuPjFAbB6WU/OG1JDFCA0C0Uns8VW6 R5ljRj8rlWuwW0zs5XiSd9CA0T9E8SExfLJ2SCwFRUakNrcbwn9/NMcA4ZpzQQO0NLRlk3 icJAI6vfcl5BEzMcxsFlOSm4nhqjYLxQ1PGE5gYfmHhdft1AfEldwUYasJAYPRK6u27x4P nKOwOhE/5dEWIe3AtzGxQpV5Q0RkRIdTAUeelyz9Q0hVOHs0RIvh3VusyymniQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727174934; a=rsa-sha256; cv=none; b=t/IiYLMJE1O3XKwih2Q8ojDe3zkRKztUtzqXHWnRZ/YVzdVDiak7GmLv6W74I+nHH2GOrI DYaqiHfE/MzO8xFlbnLlul8AyPpzYnyN9DA+xQIxyIDWoK1D2jgXewoKfFQke9FFBVXjmc UJfqVVJx/EFCfti10icX2azS00DrNZpA9AlHWLOM+v8AM37srafPkcWMqU4Lfo9Lf5MsS0 rFOhGPaBFt8JBSstkeyaD6+vp10orf7IFST5UNXcZOUSjcY2M9v4UFB7KQkvUuNFM++Abg vXBp5tCnG4HWE/wNKJG42indiIGev4tjmPmSH7GCwG35Z+Qxx/4Tu8Sfz5365g== 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=1727174934; 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=za/jhMlg2on0xIUDu/kN6seEpkDc8zvM1X7BMDoYcyA=; b=TmZ4bs7+QvT4CgAY92vvSDTqy3rtjs9f4stC8QYZ72TEXA104Xnp6aof0h2h1xGO5vkO26 nuTUuL9JjJCtXqkXIhR+FXx7hrBvJfZBIvYLHESbqLUtDACox5wUVseHhYKIENiBWGwLwF raJ5XO8p0zr8MCXGPfFFvVoR4hGvkbeMQ1Kmzjfjs1LJ1HOWG55OptHC1LoeMOLmY8Ac6Z fIvFxx6DycanE/TqcEuUwXcybpcvyyqLgdeS160oP4FFtPQUGgp8jJVW0qqfkJADm1Aal7 0MJsKz8SqBR4C01HoR2xWyY/8G/zx75MY7jf3qNbkyR+9kc69txM2Sb9eGiFrQ== 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 4XCc6Z2kJ7zQTs; Tue, 24 Sep 2024 10:48:54 +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 48OAmsr0027497; Tue, 24 Sep 2024 10:48:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48OAmsEl027494; Tue, 24 Sep 2024 10:48:54 GMT (envelope-from git) Date: Tue, 24 Sep 2024 10:48:54 GMT Message-Id: <202409241048.48OAmsEl027494@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: c9021340a326 - main - e1000: Add sysctl for igb(4) 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/main X-Git-Reftype: branch X-Git-Commit: c9021340a3266f924bf721182f14f2d265d8a82c Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c9021340a3266f924bf721182f14f2d265d8a82c commit c9021340a3266f924bf721182f14f2d265d8a82c Author: Kevin Bowling AuthorDate: 2024-09-24 10:25:24 +0000 Commit: Kevin Bowling CommitDate: 2024-09-24 10:47:05 +0000 e1000: Add sysctl for igb(4) 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 MFC after: 1 week Sponsored by: Blue Box Systems --- sys/dev/e1000/if_em.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index d06627bcfda1..ad12171487f6 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -354,6 +354,7 @@ static void em_enable_vectors_82574(if_ctx_t); static int em_set_flowcntl(SYSCTL_HANDLER_ARGS); static int em_sysctl_eee(SYSCTL_HANDLER_ARGS); +static int igb_sysctl_dmac(SYSCTL_HANDLER_ARGS); static void em_if_led_func(if_ctx_t, int); static int em_get_regs(SYSCTL_HANDLER_ARGS); @@ -855,6 +856,12 @@ em_if_attach_pre(if_ctx_t ctx) CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, em_get_rs, "I", "Dump RS indexes"); + if (hw->mac.type >= e1000_i350) { + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "dmac", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, + igb_sysctl_dmac, "I", "DMA Coalesce"); + } + scctx->isc_tx_nsegments = EM_MAX_SCATTER; scctx->isc_nrxqsets_max = scctx->isc_ntxqsets_max = em_set_num_queues(ctx); if (bootverbose) @@ -4973,6 +4980,55 @@ em_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 +igb_sysctl_dmac(SYSCTL_HANDLER_ARGS) +{ + struct e1000_softc *sc = (struct e1000_softc *) 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 */ + em_if_init(sc->ctx); + return (error); +} + /* * Manage Energy Efficient Ethernet: * Control values: