From nobody Thu Nov 21 01:26:01 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 4Xv0tL0JNJz5f1cr; Thu, 21 Nov 2024 01:26:02 +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 4Xv0tK6rNsz4PkG; Thu, 21 Nov 2024 01:26:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732152362; 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=o1ikpDbZi/evTfcPbYV+OawvkcUVJKURVuRCEdCgNB4=; b=TTyVlpFMQc/Bp5/U8qaefcvG00tFMulrUNfGgTl+wWJveVhTUciCOGhwb5paXDksHE61t6 gAQMwiO21jh4clynxLmuYGPQl0jL4Xf6WgSTdrZoQvz7K6+uSdyCsHwEaudnHIebuNzJmX yQ+EDF2O7wrqt0Kve+F+c5CAk1tgJ8CV8m7sTfWiYFPipwx3YRY2U1mpc9qfQUSK/+qfJX LEvWZLUhCr648qG01HzZpTIbgvMZjuZ8UxQtmziGOZLVjXGHPUpyQeHvVDSToy/sOtWO/J 7QAlaVbZf8F0kZAxW5P4SBYchf6OXDK9hapbDBoqUWypfrh8LrTTlcyjP0uJLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732152362; 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=o1ikpDbZi/evTfcPbYV+OawvkcUVJKURVuRCEdCgNB4=; b=eHGrV8ZsTXXgAtuHt/QC8Zrv1g5kyff5StDxud5Fm1msRjlnkjbeO29OhPVEnCJ6Dwa8yZ 9Bjv/lsfQCEwqN3TEFRwo4/Df27f4f94TKVq5TZe5EuCWny9odGli+fut4GnrlxcSdnWQ9 iY0OeNPKh9dq+0jq5EL1btw2hraCkArGczjoXHgYE9R4ZbQjJnUYtE+pSQRf3uKPiHmmYh OD3X6FIrtO6nvEHqdHrB9/cMJc98E3X7O36vSbhQJMRpeTsr38wQHFxPhZVzWU3rsqly3N fLajaK67VN3/viZPeiHEw92LhzN7U3ozws6NUNcNkAoUMST3i5VAW01t3KdPlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732152362; a=rsa-sha256; cv=none; b=cqGublVOXcR3gmioMpBNH2DEwVLa0ywv2IoSjRzhkXN9G3HZpSA6GkPIUKUik8q1u7x7fP HfNgdzL0JhPvdwsE1r7sq/N/4Sje/xl+pJNJ/zwIYDGyvtru67viqSXbSTkJ5U5FNlE/iF fowEfne+59NbTUf6jl9RvEfcAQ92OI9siF1hIcBxNOxkhzAeboBm1AwbM+nFCf6EdGHjYu XsjFhFp7HIhG8tGOIsH6dDkRa/79kXA8OZWk2gJMwd+y5zPE6+umXvX/8ZWw92ZHRUI0+V HBwZ4qDWBE2udJQ4xDU/KvNlHiERimE5PNQ1CJq4SOg9Y6SaO9WV1XouAQybJQ== 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 4Xv0tK6KSGzHvt; Thu, 21 Nov 2024 01:26:01 +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 4AL1Q1dT037118; Thu, 21 Nov 2024 01:26:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AL1Q1BS037115; Thu, 21 Nov 2024 01:26:01 GMT (envelope-from git) Date: Thu, 21 Nov 2024 01:26:01 GMT Message-Id: <202411210126.4AL1Q1BS037115@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: eea2e089f8da - main - 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/main X-Git-Reftype: branch X-Git-Commit: eea2e089f8dadf850a30ed837edd7a386427a9ed Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=eea2e089f8dadf850a30ed837edd7a386427a9ed commit eea2e089f8dadf850a30ed837edd7a386427a9ed Author: Michael Tuexen AuthorDate: 2024-11-21 01:18:17 +0000 Commit: Kevin Bowling CommitDate: 2024-11-21 01:25:06 +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 MFC after: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44258 --- 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 ************************************************************************/