From nobody Tue Oct 15 17:43:01 2024 X-Original-To: dev-commits-src-main@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 4XShJk1JXBz5YlWF; Tue, 15 Oct 2024 17:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XShJj74qQz4Ys5; Tue, 15 Oct 2024 17:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729014182; 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=iB/CBLn7IPKgSenGlTfsQoyhnKyEUGYBDmf6NVi1yFU=; b=n1kjNqDv5x9BLY3bGSz70Yd6UtPlNcPTJH0rZULaCRJIwBAsz75/wYMZTLvMu8lc/qAkGN KS0r0Tu4UBiuU1GuDGUOX+Ji189Hk8n7Sxc7CSexlyy3PxOoxloMkgllsatppl1MZin+R7 tQBxEJbwh39ecGUCOSGgjAUefnDhKZ4vL+V74KXsWxoOVNCKPbTqef4GHL2uEIlhzGIh41 4csWrpu69X3asCl2zN9Yv3igOLrHykuj6GreriMK2o2ccKX7PVl7FQ6I8drKu3ZcnCC3F+ jAVC97eClpDRo/RwFiHX50fxnXA+3+fT4xqClXu1GBlvrWcIx9/NLTgMABg+Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729014182; 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=iB/CBLn7IPKgSenGlTfsQoyhnKyEUGYBDmf6NVi1yFU=; b=caEq9BcYlFwlq44T4U+qvSqZYAuRcIjYUmgHsDUXqUUZTqgSI+/snioe7fIHMdeUpssH06 OSsVTD+MNWvdS8zrh6V+yDcJNSJY2N65ZD6f8cDJvsEazagfapkWKu9uJ/pxWpYp9iRova NRYYM4Opt6nRSsa4OcidRJtse6Hw4wSL8tWyXHmBhKfxyRb7TQBJFZNFqcpTNdCcOl2w3O P3WWbbuBbOeWUGUzrckJuVMrUy+uq9SM9E1WWgrlU1sjveFRQLZDjgMkY2PQ9h+klQwtiD wVD2duG1hdtPXGkZkGZ31cmHFu8WnHgdX3ATwuNoSZtLCspa+LXRRa2cxzEImg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729014182; a=rsa-sha256; cv=none; b=Z123SkPF7gkwEMZY7c+PzQ7z+xqG72ahRH/MUFvAYMkvbH/zddAdhsYWgENgAxVfmsNsli xS5JTh+k8ofuTTbyn1JHjzptxy82eVnKLM9So/6vqWIf82XvLl1uMz7OSHHbcnrQNmw8mF 8uAoZuBBdwJ5fWkcOZ6hqNQwUWRXR6IGcP7DWkC5PDUJ5HNuQoNqRLn1LC++WLZ4Y0MD2X YSj+rJVpmm59e2bHUVqyqUlnZm9ivRdte/BC/tMz1FV0y3CC9Ym2EI4iIlIkYp0JmpgR0l qA3viJa3SNadVRamvFKcc5cGzdlMiWu5qtRL6EkjGLek2Z/JW8GHzvAtJaRElw== 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 4XShJj6N4PzXQ8; Tue, 15 Oct 2024 17:43:01 +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 49FHh1Wb061892; Tue, 15 Oct 2024 17:43:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FHh1ZS061889; Tue, 15 Oct 2024 17:43:01 GMT (envelope-from git) Date: Tue, 15 Oct 2024 17:43:01 GMT Message-Id: <202410151743.49FHh1ZS061889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Osama Abboud Subject: git: 1f67704e2cd8 - main - ena: Count all currently missing TX completions in check List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 1f67704e2cd85a507776312b52dc63d8690b9260 Auto-Submitted: auto-generated The branch main has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=1f67704e2cd85a507776312b52dc63d8690b9260 commit 1f67704e2cd85a507776312b52dc63d8690b9260 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-15 17:38:31 +0000 ena: Count all currently missing TX completions in check Currently we count all of the newly added and already existing missing tx completions in each iteration of check_missing_comp_in_tx_queue() causing duplicate counts to missing_tx_comp stat. This commit adds a new counter new_missed_tx within the relevant function which only counts the newly added missing tx completions in each iteration of check_missing_comp_in_tx_queue(). This will allow us to update missing_tx_comp stat accurately without counting duplicates. Approved by: cperciva (mentor) MFC after: 2 weeks Sponsored by: Amazon, Inc. --- sys/dev/ena/ena.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 9d047cc89b30..6c1cbb6701de 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3058,13 +3058,13 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct ena_ring *tx_ring) { + uint32_t missed_tx = 0, new_missed_tx = 0; device_t pdev = adapter->pdev; struct bintime curtime, time; struct ena_tx_buffer *tx_buf; int time_since_last_cleanup; int missing_tx_comp_to; sbintime_t time_offset; - uint32_t missed_tx = 0; int i, rc = 0; getbinuptime(&curtime); @@ -3107,13 +3107,15 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, "%d msecs have passed since last cleanup. Missing Tx timeout value %d msecs.\n", tx_ring->qid, i, time_since_last_cleanup, missing_tx_comp_to); + /* Add new TX completions which are missed */ + new_missed_tx++; } tx_buf->print_once = false; missed_tx++; } } - + /* Checking if this TX ring missing TX completions have passed the threshold */ if (unlikely(missed_tx > adapter->missing_tx_threshold)) { ena_log(pdev, ERR, "The number of lost tx completion is above the threshold " @@ -3122,8 +3124,8 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, ena_trigger_reset(adapter, ENA_REGS_RESET_MISS_TX_CMPL); rc = EIO; } - - counter_u64_add(tx_ring->tx_stats.missing_tx_comp, missed_tx); + /* Add the newly discovered missing TX completions */ + counter_u64_add(tx_ring->tx_stats.missing_tx_comp, new_missed_tx); return (rc); }