From nobody Sun Nov 24 03:21:55 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 4XwvJg4mvmz5dLBR; Sun, 24 Nov 2024 03:21:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XwvJg2W7pz4HnF; Sun, 24 Nov 2024 03:21:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732418515; 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=t1u00yC4ZtAymlerKx8bLsXlQZdq1RN7D0G0XCrYYzY=; b=LbtQf549ogkYcVDfm7+TlIaZGGEAayyn085jRVLXB3g++7qNVBjOL49yxFIh+89cUPnCdS MaP1iqrtFQtTfY9M9tAZZtuhT0HU+SzpPPpc3LRXEH0dsiBWzmN5MvKFD6P4WjJwcKiawz nSyH67ai+TcFrsj5kyreIi4Pc8S3Jff4L9wqa7/1d5mzTK0rveT3dVyj0Nx8F8qV8k8M/0 EzZ4oUBxT0+CtIJtahbL/KVlkaPtZTKMCr1nGJKQWyIZwVZ8J5Ynyd/vK1Hk0z4efQ7I0w Wri4S52zhvoaUrhUp5MoxRq5LiBHbzxZdVV7Qko6g+cgVT8wYJX6OhleITLrRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732418515; 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=t1u00yC4ZtAymlerKx8bLsXlQZdq1RN7D0G0XCrYYzY=; b=kIn6kP3W/tzbUfO6xsZ4E3EE49rKQuItcgopYzmGpKjNbBx5jqhyYJO7esymmJZGqr7k0F 1MFtCLs+ukSoB+qeACFSKpSuS2OWbIR5jBbDXM76VaIzsIGX9lPclmNU+G7Ro1NPO4p8MY aqHsuVdBTTYBdc9MGG7YL4CFHtKR4Xj00mzCVIsB9Bo30WMzyTV+KmjxYtpVshVuj85HBS lUW2JhtgOfT7LEqnjm8fWvf8DscwXO0d7P2zh+9FZT7Mo2pYlNNiUcqKXvpCpRAMzLmKLs Efzs7+qjum2leTurhmJC29vqB+xX3BdZVbX97x+PhR77mV0RuZQf358m4Sd5xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732418515; a=rsa-sha256; cv=none; b=nOkdzgrMGbuu9dNU9Ks+tcDb8sQjIGwfQMwWnDndfWQJgrithP1FIkBSJ1MMEERtQrsEs3 Re7ZMry0JvkQX19YTMda+XYYVNamqhgo39DLFye0n+LWKzVSjVp0rfrtiP8ajsKTVbAV+C yC2k9PLW7K1tVClAyf90dHto60kQ5rIIb2T9nwVLRPfUKLV4PEUC8Dcnc+kurSItjKAF3y 4BE5xcSDqa3sBGqBF502Sx0unV3ulxFcXB+VDy+nH8zE7hFt5ivzNTesWMguz1nEdheFrf xrvVZC48tW4xkMfCCH1kP8ssgdJmcVxGwNa1P4mHLoLqViqTbIngsd28R8uahQ== 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 4XwvJg27FLzdHL; Sun, 24 Nov 2024 03:21:55 +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 4AO3LtuF040858; Sun, 24 Nov 2024 03:21:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AO3Ltk6040855; Sun, 24 Nov 2024 03:21:55 GMT (envelope-from git) Date: Sun, 24 Nov 2024 03:21:55 GMT Message-Id: <202411240321.4AO3Ltk6040855@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: 9a89886460b6 - stable/14 - e1000: sysctl for TCP flag handling during TSO 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: 9a89886460b6932c7a93bc324529250241f25521 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=9a89886460b6932c7a93bc324529250241f25521 commit 9a89886460b6932c7a93bc324529250241f25521 Author: Michael Tuexen AuthorDate: 2024-11-21 02:22:10 +0000 Commit: Kevin Bowling CommitDate: 2024-11-24 03:21:17 +0000 e1000: sysctl for TCP flag handling during TSO Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment, and tso_tcp_flags_mask_last_segment sysctl-variables to control the handling of TCP flags during TSO. This allows to change the masks appropriate for classical ECN and to configure appropriate masks for accurate ECN. Reviewed by: rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44259 (cherry picked from commit 90853dfac851afa9e8840f5a38383256d75458b6) --- 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 0b99f1b06130..98521e6e6ee9 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -333,6 +333,7 @@ static int em_is_valid_ether_addr(u8 *); static void em_newitr(struct e1000_softc *, struct em_rx_queue *, struct tx_ring *, struct rx_ring *); static bool em_automask_tso(if_ctx_t); +static int em_sysctl_tso_tcp_flags_mask(SYSCTL_HANDLER_ARGS); static int em_sysctl_int_delay(SYSCTL_HANDLER_ARGS); static void em_add_int_delay_sysctl(struct e1000_softc *, const char *, const char *, struct em_int_delay_info *, int, int); @@ -876,6 +877,24 @@ em_if_attach_pre(if_ctx_t ctx) igb_sysctl_dmac, "I", "DMA Coalesce"); } + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, + "tso_tcp_flags_mask_first_segment", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 0, em_sysctl_tso_tcp_flags_mask, "IU", + "TSO TCP flags mask for first segment"); + + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, + "tso_tcp_flags_mask_middle_segment", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 1, em_sysctl_tso_tcp_flags_mask, "IU", + "TSO TCP flags mask for middle segment"); + + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, + "tso_tcp_flags_mask_last_segment", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 2, em_sysctl_tso_tcp_flags_mask, "IU", + "TSO TCP flags mask for last segment"); + scctx->isc_tx_nsegments = EM_MAX_SCATTER; scctx->isc_nrxqsets_max = scctx->isc_ntxqsets_max = em_set_num_queues(ctx); if (bootverbose) @@ -5182,6 +5201,43 @@ em_sysctl_int_delay(SYSCTL_HANDLER_ARGS) return (0); } +static int +em_sysctl_tso_tcp_flags_mask(SYSCTL_HANDLER_ARGS) +{ + struct e1000_softc *sc; + u32 reg, val, shift; + int error, mask; + + sc = oidp->oid_arg1; + switch (oidp->oid_arg2) { + case 0: + reg = E1000_DTXTCPFLGL; + shift = 0; + break; + case 1: + reg = E1000_DTXTCPFLGL; + shift = 16; + break; + case 2: + reg = E1000_DTXTCPFLGH; + shift = 0; + break; + default: + return (EINVAL); + break; + } + val = E1000_READ_REG(&sc->hw, reg); + mask = (val >> shift) & 0xfff; + error = sysctl_handle_int(oidp, &mask, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (mask < 0 || mask > 0xfff) + return (EINVAL); + val = (val & ~(0xfff << shift)) | (mask << shift); + E1000_WRITE_REG(&sc->hw, reg, val); + return (0); +} + static void em_add_int_delay_sysctl(struct e1000_softc *sc, const char *name, const char *description, struct em_int_delay_info *info,