From nobody Sun Nov 24 03:22:48 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 4XwvKh73jfz5dL11; Sun, 24 Nov 2024 03:22:48 +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 4XwvKh6ZYhz4JL4; Sun, 24 Nov 2024 03:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732418568; 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=uH7Cb6QAfuZQRnXoJFrVnoUcu/7aDTud8VfahLxQ4Zg=; b=VS15w2a5Ac9OE93wvbQuanTBtaqsT/2Dz/LnMcZKAf/CYyYMBGSrKn82nNHohZn9zXD8EO 6fc/r3OcWgaPH4ejiyXz7Zs9g0yxJldI1FZoIzr/AS3DqKS2CVWsaNXlJAFxpVZ/YHn+6X quajsoZLFc3M9shpszvUoBlGQxHv9FlMtBRRRkJPlN2V+iihUbHZbzEg5UyZxbe44QzcFD vWSHJUbqOWXx208mbO15hpR6uHbYNe2dP2b3FBUc711IQ4aZcXmukJd4cWxiwL59/W+wPI egV/H1xjVhTn4M5bmHMHC9ESITDRPBHY+2LOqr/vsaLFo5KrmaSeRaSo+5dZ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732418568; 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=uH7Cb6QAfuZQRnXoJFrVnoUcu/7aDTud8VfahLxQ4Zg=; b=fJGZx0HXkRQ4pblVYvOj9q84Sb9yf9V/IVj+yYSbu1B4W28U3Re2aVQbnGw5x0TLTZHpI3 vDDRcOu/0ZaxCNpOmlznwWv0pKBdBGvaBBhKk9B+TuwezQmp/FCcEZAZdZhT/Tz639n+9k s2o1z5tSih42RGOTonQnleE+PJRXD5wDPQrWpZbgdDiFlcClYP+14Dy9R8UXBC1NblMTl0 WM0X7CtNb33FmApTVtERW9lwca8Ot4WFa3rSTGPv/W7aQHMDE5V46qo7I2n2iaKvAZgpSW BOSzml3ql624ErzkePAoTHujbn5JFdyWjk8hNUyVmqvKBxyJCVnupSP+VAQZNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732418568; a=rsa-sha256; cv=none; b=fQGzxUYi7Hqd+znXu0Z705qBJ0oxceNo9Xb53XAXhs5YKo196uSVGJ3tDV6vxE1asJD8t0 DZhcEUyniGE8f5DWLXDi8fgliGXUUBntsjlDrmzvVhEALzqnCaRSRO/bgUsa6ioRKpNfks 15FC6UoYonK9BOKVSx82UuUyVH9oKN75pZ5OpkXV3LmwBshnSa2UVquo/1RGlTrD26j3Vj h3qj4aTrYmVBNyz2tpBcAofKiBUFhxY/3JbR/ub7kaMBorLyvQHZ9mzz4HeWzi3gZv80rJ 081C8XutXGMxxy+A56mIObVIPQY41g3VWoW1ysDbQqxd1f3sJFsnJkQSpbp24g== 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 4XwvKh69cpzd6T; Sun, 24 Nov 2024 03:22:48 +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 4AO3MmJl041355; Sun, 24 Nov 2024 03:22:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AO3MmFh041352; Sun, 24 Nov 2024 03:22:48 GMT (envelope-from git) Date: Sun, 24 Nov 2024 03:22:48 GMT Message-Id: <202411240322.4AO3MmFh041352@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: e5149ac66c2c - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: e5149ac66c2cb809b6ed5fc3ccf09002e481fd6a Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e5149ac66c2cb809b6ed5fc3ccf09002e481fd6a commit e5149ac66c2cb809b6ed5fc3ccf09002e481fd6a Author: Michael Tuexen AuthorDate: 2024-11-21 01:18:17 +0000 Commit: Kevin Bowling CommitDate: 2024-11-24 03:22:16 +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 8ddb0315f254..993aa48d51ef 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 *); @@ -2743,6 +2744,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", @@ -4729,6 +4748,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 ************************************************************************/