From nobody Wed Oct 02 19:53: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 4XJlq44xtVz5Y1dP; Wed, 02 Oct 2024 19:53: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 4XJlq369MGz4Xjy; Wed, 2 Oct 2024 19:53:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727898799; 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=/rRNzM4ocTI6OhkbVboczRSeRKa/QI6QxBqx19JuUMM=; b=UuLHEgiI4FVSUpcX526Bf3OxWMKRiAQNZ2qSBiCvtZRnArdceJnPtjTqMq9Vg7sGdRTGEA E5VI5YA3knp6Cir1iRi65NQ0BTWP/nywK5023ZDEcAYaQIXsKKfW49R0+mAd7PsbFS/aB7 aclPeIWZt94kZixXi5VShsfCoaDb0we9AOZi8Tr6e4WZNuB6k0x2234sOTKUoe0+8xpfG3 6zv8FGTzgV4TGjdSitaAmSwtvHFucAeLM24VPbytYgBbgPgk14Zj8M5w2rQTqj3SIyI8CS Fd6zB39/WG7vx2AArkYiO4VQrmVL+xjsaa8mwIhHLb8TbleCeONqfIxJe9PJ9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727898799; 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=/rRNzM4ocTI6OhkbVboczRSeRKa/QI6QxBqx19JuUMM=; b=UiWbVPLEUZ1xBoermaoR9dvnFDMpoaDhuFfoz8cmbcs0ag+rfem2EzHLLCBDR6klGbTefz GqGO8VeSB1zqizIvMU1oUHq9ayXYPAj2S4QfLnP0Fu0vzz+72P95i7h0zMhEe1y2Z5Tu+D Ew07d6I9nOVoorCz7/mZOgZDjENwqscXcJpBinaht79O9QrbxeoYwLGDWUAYa81U+vFvmZ 1tJz1ZbxbOqzhHbnWkc1TwlQ6jr3Iopm0u2GCK4BVnIWq5ynyBi7cRhMF87BrdsY65J5/M /eR5vdgzQMaB6aRYOxeFtkbNgzl5pSoJ1mrH3xRoyGBYS7f9NdnXVxmRtzyNIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727898799; a=rsa-sha256; cv=none; b=pk+M8q8RYZIB4B775zkuMXq6hYMyVx9sIQ3Xyy04owdS73FWJdm2OPKxIKO3Kjg3k/G5GR 5taUuOE8PzfFlJV8/a1fTHrQDbszkoirOqOtHh5vAbuboZHDDt817UBr24YkKGedK0sFO3 /APGxFa2/a1tELaS/pzfWRKrEIr77/dgynFsCrLEn7S0BNF7IaeQ0ePt6yALUFM+dXicYR nlPjf8G0gqgZag2llOjNBegN0n4ds6X5o/jwI6jIqce9/j2py+8/Z7RWtotxAp83ZeJAFg qIv20DkFL8/L4mTj5wQPaVOyAh0NvzP/qa3dL0YxVTvmnjFs0atomi0LzSkETA== 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 4XJlq35lMlzJnh; Wed, 2 Oct 2024 19:53: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 492JrJh4060576; Wed, 2 Oct 2024 19:53:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 492JrJM7060573; Wed, 2 Oct 2024 19:53:19 GMT (envelope-from git) Date: Wed, 2 Oct 2024 19:53:19 GMT Message-Id: <202410021953.492JrJM7060573@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: 262f8dd6143e - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 262f8dd6143e2cedea055763c5a453dedd449f85 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=262f8dd6143e2cedea055763c5a453dedd449f85 commit 262f8dd6143e2cedea055763c5a453dedd449f85 Author: Kevin Bowling AuthorDate: 2024-09-24 10:25:24 +0000 Commit: Kevin Bowling CommitDate: 2024-10-02 19:52:13 +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 Sponsored by: Blue Box Systems (cherry picked from commit c9021340a3266f924bf721182f14f2d265d8a82c) --- 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: