From owner-svn-src-all@freebsd.org Wed Oct 16 17:13:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 831B414B8D4; Wed, 16 Oct 2019 17:13:47 +0000 (UTC) (envelope-from erj@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46tf5l2t5Hz42tX; Wed, 16 Oct 2019 17:13:47 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4636AA414; Wed, 16 Oct 2019 17:13:47 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9GHDl9Z068178; Wed, 16 Oct 2019 17:13:47 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9GHDlMG068177; Wed, 16 Oct 2019 17:13:47 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201910161713.x9GHDlMG068177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 16 Oct 2019 17:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353656 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 353656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2019 17:13:47 -0000 Author: erj Date: Wed Oct 16 17:13:46 2019 New Revision: 353656 URL: https://svnweb.freebsd.org/changeset/base/353656 Log: e1000: correctly set isc_pause_frames only when XOFF increases From Jake: The e1000 driver sets the iflib shared context isc_pause_frames value to the number of received xoff frames. This is done so that the iflib watchdog timer won't trigger a Tx Hang due to pause frames. Unfortunately, the function simply sets it to the value of the xoffrxc counter. Once the device has received a single XOFF packet, the driver always reports that we received pause frames. This will prevent the Tx hang detection entirely from that point on. Fix this by assigning isc_pause_frames to a non-zero value if we received any XOFF packets in the last timer interval. We could attempt to calculate the total number of received packets by doing a subtraction, but the iflib stack only seems to check if isc_pause_frames is non-zero. Signed-off-by: Jacob Keller Submitted by: Jacob Keller Reviewed by: gallatin@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21868 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Oct 16 17:11:18 2019 (r353655) +++ head/sys/dev/e1000/if_em.c Wed Oct 16 17:13:46 2019 (r353656) @@ -3903,6 +3903,7 @@ em_disable_aspm(struct adapter *adapter) static void em_update_stats_counters(struct adapter *adapter) { + u64 prev_xoffrxc = adapter->stats.xoffrxc; if(adapter->hw.phy.media_type == e1000_media_type_copper || (E1000_READ_REG(&adapter->hw, E1000_STATUS) & E1000_STATUS_LU)) { @@ -3926,7 +3927,8 @@ em_update_stats_counters(struct adapter *adapter) ** For watchdog management we need to know if we have been ** paused during the last interval, so capture that here. */ - adapter->shared->isc_pause_frames = adapter->stats.xoffrxc; + if (adapter->stats.xoffrxc != prev_xoffrxc) + adapter->shared->isc_pause_frames = 1; adapter->stats.xofftxc += E1000_READ_REG(&adapter->hw, E1000_XOFFTXC); adapter->stats.fcruc += E1000_READ_REG(&adapter->hw, E1000_FCRUC); adapter->stats.prc64 += E1000_READ_REG(&adapter->hw, E1000_PRC64);