From nobody Sun Nov 24 03:21: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 4XwvJf2J3yz5dL85; Sun, 24 Nov 2024 03:21: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XwvJf1nndz4HZK; Sun, 24 Nov 2024 03:21:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732418514; 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=kZmJJ7sWp8xlcmStJiWXtTX9yUQp+vV6RZNuzogD1/0=; b=hhx1fBAoWRnMBy6/DYnc6PRcUjo4/wtUuIbGpcNhTJaWSojWqAF2BtxjhTUtHYVNxchIeF AHqeqTVlFtWCbQvSbOk80RvNiGaE0zgve4XH/8BmVXltJOxEzLNyLRa283RwPMBbzk46Di 3l+oRRH0lS4lAxWUiF34iEBrg3rRkXSsUc26i6uAuIu8knKf0eiqvLNdbj6MeZCgvu3I0J 3iZBeyBZ3u1eizLkKZqAoh3QCQ6pECGMr3FaDvzgxVQzyn1LGsiG/5P/Mp028BTrmIMygb 8UdAhcm2yhgUWtaZSoxOi0NF9uuiPQB3EtupdqxKn4osAeHOPIZmFK8pMWGviQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732418514; 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=kZmJJ7sWp8xlcmStJiWXtTX9yUQp+vV6RZNuzogD1/0=; b=HqDt3KU5//vzkXUyNu+TRmUiyyln5h0ujpnDGX/rBg5PRRmVVhUgvPd5WMgYDE/X5RdIXV qOOa5qtFrifopsDs69w44C4R0/N8iRY01YK3VS1P9mhsAr+5ETDgknqpn/jS7nVtd+0xHf /wNeS1eCj8jMB6jbJhFUtmWw/E7F1eymBV4AnLi/Z0+iGwiJKlxKIElRzJMroz2ts5tJjq ZXlhSobSpWuD0Ve7MvRqjRJ9BP5ekuZtAAJeKJrUKLx2IgZZ61rBzFc3CQICdPOMOxWAjy CtVs/YGlAtJpbmP3Z0e3zGSl4pxZgYWqKJUgONE9yEF1wZEkgPMRbVc2A6NLGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732418514; a=rsa-sha256; cv=none; b=tIwvx3qv7VzmLKUPYY/6XKtBja6MvLgqWmPalUZZ2vYYwZ1j6SOApTfY93YVbdKiPNYUrm yRfGqrl7InThuRBKs0DWNssKNP/yH/C/xr/OtnK54IlaSlfcV0hCm9wmuE0Blw0nX8hgVZ /l1r3bL6aW4ztHT8eU5WO0SURwF916KdlQtJ8toT9fZjqtgyA9sM8+3RxsSvIY3n/CWXxG +cahZJi7EP8uT+3ccv8jxjLIs/uZw/ECB4QKl4gchiEtPXqeGmDgKOsASQmB5izcmkUzbS GfGYEzInt4gxXnkwosarLOmh8gCjbQSmWslmZovqTgYQYVCK+FdbcIW+L5Y+Tg== 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 4XwvJf1PPMzcdg; Sun, 24 Nov 2024 03:21: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 4AO3Ls5o040804; Sun, 24 Nov 2024 03:21:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AO3Lsae040800; Sun, 24 Nov 2024 03:21:54 GMT (envelope-from git) Date: Sun, 24 Nov 2024 03:21:54 GMT Message-Id: <202411240321.4AO3Lsae040800@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: 52ff9ccb5b25 - stable/14 - ixgbe: 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: 52ff9ccb5b2553719d050f8fd041c8e17578250b Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=52ff9ccb5b2553719d050f8fd041c8e17578250b commit 52ff9ccb5b2553719d050f8fd041c8e17578250b Author: Michael Tuexen AuthorDate: 2024-11-21 01:18:17 +0000 Commit: Kevin Bowling CommitDate: 2024-11-24 03:21:03 +0000 ixgbe: 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 fix the masks appropriate for classical ECN and to configure appropriate masks for accurate ECN. Michael notes emperically 82599 has an unexpected middle mask: Chip First Middle Last 82599 0xFF6 0xFF6 0xF7F which should be fixed up to 0xF76 (RFC 3168) in a future commit. Reviewed by: rrs, rscheff Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44258 (cherry picked from commit eea2e089f8dadf850a30ed837edd7a386427a9ed) --- sys/dev/ixgbe/if_ix.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index f8a620295aa4..ad690fdccef4 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -204,6 +204,7 @@ static int ixgbe_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_state(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_tso_tcp_flags_mask(SYSCTL_HANDLER_ARGS); /* Deferred interrupt tasklets */ static void ixgbe_handle_msf(void *); @@ -2756,6 +2757,24 @@ ixgbe_add_device_sysctls(if_ctx_t ctx) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, ixgbe_sysctl_print_fw_version, "A", "Prints FW/NVM Versions"); + SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, + "tso_tcp_flags_mask_first_segment", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 0, ixgbe_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, ixgbe_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, ixgbe_sysctl_tso_tcp_flags_mask, "IU", + "TSO TCP flags mask for last segment"); + #ifdef IXGBE_DEBUG /* testing sysctls (for all devices) */ SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "power_state", @@ -4742,6 +4761,43 @@ ixgbe_sysctl_eee_state(SYSCTL_HANDLER_ARGS) return (error); } /* ixgbe_sysctl_eee_state */ +static int +ixgbe_sysctl_tso_tcp_flags_mask(SYSCTL_HANDLER_ARGS) +{ + struct ixgbe_softc *sc; + u32 reg, val, shift; + int error, mask; + + sc = oidp->oid_arg1; + switch (oidp->oid_arg2) { + case 0: + reg = IXGBE_DTXTCPFLGL; + shift = 0; + break; + case 1: + reg = IXGBE_DTXTCPFLGL; + shift = 16; + break; + case 2: + reg = IXGBE_DTXTCPFLGH; + shift = 0; + break; + default: + return (EINVAL); + break; + } + val = IXGBE_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); + IXGBE_WRITE_REG(&sc->hw, reg, val); + return (0); +} + /************************************************************************ * ixgbe_init_device_features ************************************************************************/