From nobody Tue Nov 23 23:12:45 2021 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 B3F4318A1369; Tue, 23 Nov 2021 23:12:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzKg20HVGz3vd8; Tue, 23 Nov 2021 23:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 598C11F59A; Tue, 23 Nov 2021 23:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ANNCjtX037489; Tue, 23 Nov 2021 23:12:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ANNCj2l037488; Tue, 23 Nov 2021 23:12:45 GMT (envelope-from git) Date: Tue, 23 Nov 2021 23:12:45 GMT Message-Id: <202111232312.1ANNCj2l037488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ff590791ff6d - stable/13 - cxgbe: Only run ktls_tick when NIC TLS is enabled. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ff590791ff6d69c65118cf396c431f2f07b50a75 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637709166; 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=n0xfiBkRl5YkZAlyq+IR9in/xNdk1Pa0wG4/C/k7KD4=; b=e7a5P44PzIkCIMcn2Sa1M4NP6YON5cJFcXlFuqYbM17d4ycW1akyHluT3b8GPKdbkDXX12 lCsqIvgJm2t1P8FU7A7epuhKLI4TciRJRr8ifdeLBbWHddr+nfJ+4eXYpW0BQurUv0KX4L 4iArN/j8h3rz918wqN8FmLCS/JDOlS7zrF0r8HYZijN8QdzYCCfcIJ1Ma1R7xP2EOGeoM+ 2HWDGgVnUcfCWm6YfDdA1pE5OffjC/aXOkIIJhnRA8pyiyv2jdTrn1G0nTO7iGIVh08k6S KhC0hAtpV21hAvHa+93ydhwU2++kAE+mzO+KWVyEvhQMO4nFOwMMBTb2stmc6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637709166; a=rsa-sha256; cv=none; b=J/AcR/WUvcUfOOdQygROVyJkleUn1GDx2NDdlvxp7/1Scrfzx1jCfUk5eU6lSFgC0cqe1M HtrH7UueUClOYl4xpIB7rtYFqBV3vocM1bFon/BgcxiKmFTIyIurxchjlxdxDgQPSxBIsd o46ZMYo6iYKgjzQSVRRWDmRerqxx5JemjpHkZGO239kkzBWkKzSEIbbKOAnaz2tTgYNHZW VNjaSos/Ro1y31Tk3UJ1qnaWMqz5/gox/eubx9V/O/mUg1csTwL8yaQGyBnfu4O+ahMx/d 5FBFxnBa05CJvsrTJI3bw+t3SQJ+zk+sLnZX2kj98iFViB53hEojKW1Q4ks6BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ff590791ff6d69c65118cf396c431f2f07b50a75 commit ff590791ff6d69c65118cf396c431f2f07b50a75 Author: John Baldwin AuthorDate: 2021-10-14 17:59:16 +0000 Commit: John Baldwin CommitDate: 2021-11-23 23:11:43 +0000 cxgbe: Only run ktls_tick when NIC TLS is enabled. Previously the body of ktls_tick was a nop when NIC TLS was disabled, but the callout was still scheduled consuming power on otherwise-idle systems with Chelsio T6 adapters. Now the callout only runs while NIC TLS is enabled on at least one interface of an adapter. Reported by: mav Reviewed by: np, mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32491 (cherry picked from commit ef3f98ae4778a8d4463166c5ff3c7831099c6048) --- sys/dev/cxgbe/t4_main.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 71877a571982..1522b500c496 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5452,11 +5452,9 @@ ktls_tick(void *arg) uint32_t tstamp; sc = arg; - if (sc->flags & KERN_TLS_ON) { - tstamp = tcp_ts_getticks(); - t4_write_reg(sc, A_TP_SYNC_TIME_HI, tstamp >> 1); - t4_write_reg(sc, A_TP_SYNC_TIME_LO, tstamp << 31); - } + tstamp = tcp_ts_getticks(); + t4_write_reg(sc, A_TP_SYNC_TIME_HI, tstamp >> 1); + t4_write_reg(sc, A_TP_SYNC_TIME_LO, tstamp << 31); callout_schedule_sbt(&sc->ktls_tick, SBT_1MS, 0, C_HARDCLOCK); } @@ -5476,10 +5474,14 @@ t4_config_kern_tls(struct adapter *sc, bool enable) return (rc); } - if (enable) + if (enable) { sc->flags |= KERN_TLS_ON; - else + callout_reset_sbt(&sc->ktls_tick, SBT_1MS, 0, ktls_tick, sc, + C_HARDCLOCK); + } else { sc->flags &= ~KERN_TLS_ON; + callout_stop(&sc->ktls_tick); + } return (rc); } @@ -6527,11 +6529,6 @@ adapter_full_init(struct adapter *sc) write_global_rss_key(sc); t4_intr_enable(sc); } -#ifdef KERN_TLS - if (is_ktls(sc)) - callout_reset_sbt(&sc->ktls_tick, SBT_1MS, 0, ktls_tick, sc, - C_HARDCLOCK); -#endif return (0); }