From nobody Thu Oct 31 16:00:03 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 4XfTGW5xhZz5bwZ3; Thu, 31 Oct 2024 16:00:03 +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 4XfTGW3SvQz4Nvw; Thu, 31 Oct 2024 16:00:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390403; 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=BqJRVXk86QDemWptmP8yLXyq7EqxR643mPqENf0VKFs=; b=YFjblfjt7E5Tq7S6GX7vb6O7PPQHngdFUOcMSv7yD+TzFWJf+bPWThyI1BJkKbCIFe4zni G9zSazIo1DtRJSi7eOya21r8hdtBIxhc0R3m47jGBlNEcWhFpHltSo1Z+l/yHwrUiPp4U2 TwH18KsnT2cTXIr4BmuKfhQVSbicmtOM9MBuGzWOD3Luxuk2+WrKlgvhqhKaAWHX0KzIQy 4aQqqJI81jNc7vVtbYEFwHxRQ+jkderNJq2pIggPzAABJppRQwPa6NftW6tRB9uD0IpxA4 ms813VP7vhd5MZCmYv7XsSpvI7Hq3y+vonNj6AIG+K4u89UuO9Rotg7F5tOpOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390403; 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=BqJRVXk86QDemWptmP8yLXyq7EqxR643mPqENf0VKFs=; b=fYlEzeYDjuXB1zNSPCPqFyvFeEBWCKwMNfo+7CMbTqoNU6NZ3PnDtdA+0afAH2V7wD9gVt 7fpFBLprv1eI9qlpEPfkQiISddnRwSCTsSbEGly28Me4dJy3FlovqflfKDowslEriWNMYD qVckJSXe1dbKRcEfGQJPF2kpMHtHSAxibPy2Rz4fIbUBKx4/Q+1Cwwg5eRfsYQ19iWPk7z 8cRX7wwGuPQH09SBJlyK5iyasa1n9p5HxWQBZceHx+A597PzuZbjRoW0LWt7M0xRncw+iA uERFSW+vvxV4Q+mUAq8NzzbXfGmjg4ij8OKpRqsNV8PXKtcQLjU414abiqO2Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390403; a=rsa-sha256; cv=none; b=LV4Q1E54hWeFzWNP4pcwwAXpYc6GJPAPPPhAc1aXlPZ0RtUM9+a5Tne07lE3kgMqlDnUhE tnZ1jnnh+cUnGW6NkLzaLi10KBdtSmwltGiqyF2q44azizk4yAt3GYq8HxBYbua7JkCoK1 UrMAv2ICUuGTrLcr/3uvE2MXTkF9v9JLiHjhQsh1jMNr0kqCajNOKCc5t59xFRzm/S7tRH ewoBvTqrcoLZODoZ4EdKwJC5all6NIpATZFK8rtpmFPLp9GpENsArX1RiMoTNcT91jmj3f xwcqwq93QfeIYg4tjM3c7sTzRBefmYpZnlsld+NQUQQSgp3yLWWm3ADgOk/R/g== 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 4XfTGW32DfzjV5; Thu, 31 Oct 2024 16:00:03 +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 49VG03jb060088; Thu, 31 Oct 2024 16:00:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG03jo060081; Thu, 31 Oct 2024 16:00:03 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:03 GMT Message-Id: <202410311600.49VG03jo060081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Osama Abboud Subject: git: 298e32773ff2 - stable/13 - ena: Add reset reason for missing admin interrupt 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: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 298e32773ff2fd1652a668ae56f38df03c61a946 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=298e32773ff2fd1652a668ae56f38df03c61a946 commit 298e32773ff2fd1652a668ae56f38df03c61a946 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:20 +0000 ena: Add reset reason for missing admin interrupt There can be cases when we trigger reset if an admin interrupt is missing. In order to identify this use-case specifically, this commit adds a new reset reason. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 274319acb48424958242d55e1b0c7d4528da7f70) --- sys/dev/ena/ena.c | 13 +++++++++++-- sys/dev/ena/ena.h | 5 ++++- sys/dev/ena/ena_sysctl.c | 4 ++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 32c93de821a3..a895ede8226f 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3030,6 +3030,7 @@ static void check_for_missing_keep_alive(struct ena_adapter *adapter) { sbintime_t timestamp, time; + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_KEEP_ALIVE_TO; if (adapter->wd_active == 0) return; @@ -3041,7 +3042,10 @@ check_for_missing_keep_alive(struct ena_adapter *adapter) time = getsbinuptime() - timestamp; if (unlikely(time > adapter->keep_alive_timeout)) { ena_log(adapter->pdev, ERR, "Keep alive watchdog timeout.\n"); - ena_trigger_reset(adapter, ENA_REGS_RESET_KEEP_ALIVE_TO); + if (ena_com_aenq_has_keep_alive(adapter->ena_dev)) + reset_reason = ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT; + + ena_trigger_reset(adapter, reset_reason); } } @@ -3049,10 +3053,15 @@ check_for_missing_keep_alive(struct ena_adapter *adapter) static void check_for_admin_com_state(struct ena_adapter *adapter) { + enum ena_regs_reset_reason_types reset_reason = ENA_REGS_RESET_ADMIN_TO; if (unlikely(ena_com_get_admin_running_state(adapter->ena_dev) == false)) { ena_log(adapter->pdev, ERR, "ENA admin queue is not in running state!\n"); - ena_trigger_reset(adapter, ENA_REGS_RESET_ADMIN_TO); + counter_u64_add(adapter->dev_stats.admin_q_pause, 1); + if (ena_com_get_missing_admin_interrupt(adapter->ena_dev)) + reset_reason = ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT; + + ena_trigger_reset(adapter, reset_reason); } } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index b747736224d8..1a436a702ba1 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -391,6 +391,8 @@ struct ena_stats_dev { counter_u64_t missing_intr; counter_u64_t tx_desc_malformed; counter_u64_t rx_desc_malformed; + counter_u64_t missing_admin_interrupt; + counter_u64_t admin_to; }; struct ena_hw_stats { @@ -542,7 +544,7 @@ struct ena_reset_stats_offset { static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_RESET_LAST] = { ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_KEEP_ALIVE_TO, wd_expired), - ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_ADMIN_TO, admin_q_pause), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_ADMIN_TO, admin_to), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_OS_TRIGGER, os_trigger), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_TX_CMPL, missing_tx_cmpl), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_INV_RX_REQ_ID, bad_rx_req_id), @@ -552,6 +554,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed), ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED, rx_desc_malformed), + ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISSING_ADMIN_INTERRUPT, missing_admin_interrupt), }; int ena_up(struct ena_adapter *adapter); diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index e46e835572fe..c711ecf66d7a 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -298,6 +298,10 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->tx_desc_malformed, "TX descriptors malformed count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "rx_desc_malformed", CTLFLAG_RD, &dev_stats->rx_desc_malformed, "RX descriptors malformed count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "missing_admin_interrupt", CTLFLAG_RD, + &dev_stats->missing_admin_interrupt, "Missing admin interrupts count"); + SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "admin_to", CTLFLAG_RD, + &dev_stats->admin_to, "Admin queue timeouts count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count");