From nobody Thu Nov 21 02:25:11 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 4Xv2Bb2v1Dz5f4wF; Thu, 21 Nov 2024 02:25:11 +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 4Xv2Bb2K18z4VJ2; Thu, 21 Nov 2024 02:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732155911; 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=HXWtknvsa85JMxrOOxDlMuuUkq2+gh9A/1m5JyRw3pQ=; b=jtG6aafvwwMjaySNZru0Fx7p1ve0/F2n1fo0YDNin5XibKzduJwDj0pu1wRBoFzG7JzJuv hNruOAlmY3V8kWCryRvlysAhBsewBd28h3e2fBy/cneF+zY6bF+l1B3zMcTjCkscz6LQCl Bzdaq8bTuudZVpFzcBxjO33eibN7M6xXtHn+pqDisQ3gq9zK5UvonPEknzIeBHsDjoPQ3M ShJfRgY+J2iG9J1xbl3y27MIlAoPNFC871cUnCMD64L6q4eX3bNVkstjN2AeKonppMsTZp iAsDegOLChnwotv9jmUZ8hv/RTW0a5u2A8+mWfhrmB2W3pYQ9o+CJHxxKT+Urg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732155911; 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=HXWtknvsa85JMxrOOxDlMuuUkq2+gh9A/1m5JyRw3pQ=; b=xiz8v73QnSwsKByZ+mOeOZhUeza3ktKhi3SZ5AbX7Bmv6N2R3jllCT3v/tAHs8N6q8SMKh +8LS8AHjhLmRWxB9VvRJXUx0i1KmeJAxbDPlz6IhFEov8um5eNbdzJZ9q7DUnOFPFRZ7HT uF6NGkik+0QifHcgeXkd8Qng7hu4Hiu/Dx/jRn21Pn0l/LavYjdgnNOlTdpd280Q9Oy9Ge miED9iB4apQvbOwU6z5+rVHxogFbaCHjOA0pr2Rm3NxGMPZEnCGWFCj5Ed5c0M5WEo4FNV GGauOyYM9obAmd/hs0EtoaDljM+JEDDZ3/wRd8Pxi0rhZiSQ4V0LaOpKpeJdXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732155911; a=rsa-sha256; cv=none; b=v5E5aS5vubPeuvlNy1b/nMtHOn5J0MCC1MW5BVNHlAUgnIa2qkIL1pz/KgoGUSWszD0ktW 0+nSonqD8kp7OFLphm22dmv9GaiNQmiEzvM5rDCCFtwbCDERUb3Na6qR6kQqDminSUphcH U2jQaagvevUW4/PdQA58yFPblYiEivltFUVZcc2cfc/JJZ+R54alPKEzksee+N4NTvONpX iisBV+e5mRUyEvyvhpURr8W1GorHFXa+CQPmzHsvKqjyHsSdd/4sHgEvxgYpHsAsjtqWfX dt4phrb1gTAMIcef5LgG2sbZZNltgbeaeXwWXSFXusAs7AeC+N8z1+x9Ns4D2Q== 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 4Xv2Bb1pBQzL8Z; Thu, 21 Nov 2024 02:25:11 +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 4AL2PBxU048117; Thu, 21 Nov 2024 02:25:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AL2PBWm048114; Thu, 21 Nov 2024 02:25:11 GMT (envelope-from git) Date: Thu, 21 Nov 2024 02:25:11 GMT Message-Id: <202411210225.4AL2PBWm048114@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: 90853dfac851 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 90853dfac851afa9e8840f5a38383256d75458b6 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=90853dfac851afa9e8840f5a38383256d75458b6 commit 90853dfac851afa9e8840f5a38383256d75458b6 Author: Michael Tuexen AuthorDate: 2024-11-21 02:22:10 +0000 Commit: Kevin Bowling CommitDate: 2024-11-21 02:23:55 +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 MFC after: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44259 --- 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,