From nobody Thu Oct 31 16:00:02 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 4XfTGV4t76z5bwWq; Thu, 31 Oct 2024 16:00:02 +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 4XfTGV2ZKJz4Ns1; Thu, 31 Oct 2024 16:00:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390402; 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=J2ETY6Jcr87HcS8GGOmCkVcfcvcms0SJC8md0nk+TU0=; b=dkhb6ZZ4W1TGA+k0TdrgspApRDT+c5CM23dkXRJZUByXDK6pjhfjkobWfnL3Caz/sueMDJ nm35OdRCGjJAa31wmIfVB4iOUZnAasF9Y6YlL14Tz7tnDRu9zAPr4HEC7PoxqJ3WHPQDIR KZDTvIv+rmJ97AXmnUsu+oczXJu5PSxSjZQjbnPPmymxDibbq4uU2P4IoSidkgBOBdDhkr Fsm4qQmBsecNRbx90nBwuQiik7XygEFSYAgwifgLTKqW4L8UakTEs/4lmPKy1nBlttR3Gl kaNriJCfNBjbk188pMqiYsc0Kj2jvBiXHPi047x33+5FXldT6pfupN5ZH8FUrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390402; 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=J2ETY6Jcr87HcS8GGOmCkVcfcvcms0SJC8md0nk+TU0=; b=As9VvkXpyN8Y9oE5jMT2dSGhMu25IkTC7Dw8Ij/vH41pMfn4RErhq3sZQRtlPkRmJ0oeSL iTQKOC9CiecMxgDgS7jXaszbqPvz9IYsOai5XkWacvrUyFyUmsXLHeiUR0cuiRnQcAgKpY 0CqQ9o21r9ACK11qBmEmRDz27jK3EqgLoZQZuqzAzBJLZMVxgh4YsMU33qnach4Nwxc7k0 oK6rhgiqP5cjz7cXIoL2HrkoW475fJSzW7zrTIdOLMgVvw2km8wVI0yZFxzI1jPx+PokwF o+4bgTGAXrCdgSjjT0xnNu3YOrkd3HLWSKD37aQKq4sCw83B3W1RKC2dDIc++w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390402; a=rsa-sha256; cv=none; b=VqsuRqV+0iQLwfecxMPoNHPql7CcIYr6f8vwFFHELvhR9S8zajsKRBksS2PFu3El8heozN +VcVfM8rZTf7day3UOsEGIog+xUbogukxMO0+Wsx8zIuiXnAL/DV6uO+q7qhGq5a4mOhss sNVJAOtW3uwCHbtLy+EULPe5hV+ST51DokLEWNLjeyA9bQCQWhTSI6JIM0a8rlaAleK2rQ WTz+yp9RC7mFZWEPCJjteYukskL138ylWlzm2d6y8Hg2eqMSXMWIz4+iO6jYS2n5UdkRdl RK++cPVEdqMEcay/6byX2lIoaoxldAhLjSW73bMozZEiVZ5CFsANWPYjtIzM9w== 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 4XfTGV28fjzj7T; Thu, 31 Oct 2024 16:00:02 +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 49VG027B059469; Thu, 31 Oct 2024 16:00:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VG02Su059462; Thu, 31 Oct 2024 16:00:02 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:00:02 GMT Message-Id: <202410311600.49VG02Su059462@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: cd8c576d69d0 - stable/13 - ena: Add reset reason for corrupted RX cdescs 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: cd8c576d69d023af394a459c293cd1e13465920e Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=cd8c576d69d023af394a459c293cd1e13465920e commit cd8c576d69d023af394a459c293cd1e13465920e Author: Osama Abboud AuthorDate: 2024-08-07 06:24:19 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +0000 ena: Add reset reason for corrupted RX cdescs RX completion descriptors may sometimes contain errors due to corruption. Upon identifying such a case, the driver will trigger a reset with an explicit reset reason ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 4af71159db3cd4a37055b2b3d982ec53703c5c3d) --- sys/dev/ena/ena.h | 2 ++ sys/dev/ena/ena_datapath.c | 2 ++ sys/dev/ena/ena_netmap.c | 2 ++ sys/dev/ena/ena_sysctl.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 22c42a9346f7..b747736224d8 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -390,6 +390,7 @@ struct ena_stats_dev { counter_u64_t invalid_state; counter_u64_t missing_intr; counter_u64_t tx_desc_malformed; + counter_u64_t rx_desc_malformed; }; struct ena_hw_stats { @@ -550,6 +551,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DRIVER_INVALID_STATE, invalid_state), 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), }; int ena_up(struct ena_adapter *adapter); diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index e85d29d7f278..831189006f15 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -599,6 +599,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring) counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1); reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + } else if (rc == ENA_COM_FAULT) { + reset_reason = ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED; } else { counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c index fb2c5cb21e6d..54c8269be3b2 100644 --- a/sys/dev/ena/ena_netmap.c +++ b/sys/dev/ena/ena_netmap.c @@ -938,6 +938,8 @@ ena_netmap_rx_frame(struct ena_netmap_ctx *ctx) if (rc == ENA_COM_NO_SPACE) { counter_u64_add(ctx->ring->rx_stats.bad_desc_num, 1); reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + } else if (rc == ENA_COM_FAULT) { + reset_reason = ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED; } else { counter_u64_add(ctx->ring->rx_stats.bad_req_id, 1); reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index 71c25dd5e443..e46e835572fe 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -296,6 +296,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &dev_stats->missing_intr, "Missing interrupt count"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "tx_desc_malformed", CTLFLAG_RD, &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, "total_resets", CTLFLAG_RD, &dev_stats->total_resets, "Total resets count");