From nobody Thu Oct 31 15:59:56 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 4XfTGP11Wvz5bwWb; Thu, 31 Oct 2024 15:59:57 +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 4XfTGN6z8Bz4Ntq; Thu, 31 Oct 2024 15:59:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390397; 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=TCenop7uJ+EiMwlnSoy4OmzALvSXU1boiNK9rCImCM4=; b=IGpsGVQMVHXMGKCeXHwMZJE/FdzMgVzct3HFPhD9cfSCr9y88dUieelrsrrAZjH1INfeEW /7L6RkCiueziFaOHt/QGiDQHvhXeijXEetMoQEUEWy+dw6q4L/LbVztX+KBxgYIo1tCB/t 2ezc1ipaltnLPEv2HGnnBuJtMyPF1T1xFcWdaRTLNplkTgm3ub1Kc4icEfbrKR+IjM+HSg sKixcr7trf9F5A30AN969dAJj2DZGlzFT1belNZFo35UB9p38wh7i84coWOFaGckj1rLcS nTFyAWrwssuiilY5Zw1sufdDj78UtjZY8hDnKEYH300sX+8SWgOSLTZ2s10e4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730390397; 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=TCenop7uJ+EiMwlnSoy4OmzALvSXU1boiNK9rCImCM4=; b=cBSeioeZpmPMxytvb9G1eWB0k9dXcsphNBHkAn1W4WZUjSh2deU07GpT2fZb90m5iWI3Mh 6iPZOCiwkVMdRO8ptMlmBg95gULkIWDyGgGH01KdGJykyYsPWJBso1S94j5yde3hAZoBBV QztnwwxZPzSuUSz52AV0bH7M6D5R+oqQJC8aLJx92ZhodqQrKaQdwjQ4HBu4AJwm5Ssakz os7h23QRhmiIbLEA7rLwCd+fMKTT3nQPj9T4VC2zaT7ZXcMvdmcWkjrhqWujpAdy24i+CW 1SDFRPr45CwF+wyTMQ4PXiu30P/xea0wixdF2T0WTQw/Gx6VnWxzHgvqKGa3yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730390397; a=rsa-sha256; cv=none; b=tDLEESH7Tkfe1n7c1q4QtgW5/Dxkin3+3/JuTIkJ1lxikL0bmBdhyU+tL96ws6CTdYej5p opMttTdV0gQ+ls/WpVpYPhLH3Rc3HuOSJpGdL2/W2rbjydPOj7m38NoWeDnV0YU2f5iYWq rz6a/QnMsQNtoGGZbXUpIVJ1O9B3t3TteklvqUAwckeS/VlgbxJJdzvfqa8pGt13aJwB1S Ftmo7j6iBhs+0HBEbcLVz7C1bjS/xd4kqMIhqdxRDPnBF3SouKDypSA8Sm89bWTqP0w18r CSnnQBJ1kOhncQTxosPi9tdGhYw1Tt7zeXbMlBdT0yGv7EMcrwNH19BNNdb9ig== 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 4XfTGN5TPpzhdV; Thu, 31 Oct 2024 15:59:56 +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 49VFxu1o056506; Thu, 31 Oct 2024 15:59:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VFxu0U056503; Thu, 31 Oct 2024 15:59:56 GMT (envelope-from git) Date: Thu, 31 Oct 2024 15:59:56 GMT Message-Id: <202410311559.49VFxu0U056503@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: 374695be6523 - stable/13 - ena: Count all currently missing TX completions in check 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: 374695be65238bcf392576538f0fe99f09c5dbc8 Auto-Submitted: auto-generated The branch stable/13 has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=374695be65238bcf392576538f0fe99f09c5dbc8 commit 374695be65238bcf392576538f0fe99f09c5dbc8 Author: Osama Abboud AuthorDate: 2024-08-07 06:24:18 +0000 Commit: Osama Abboud CommitDate: 2024-10-31 14:55:19 +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) Sponsored by: Amazon, Inc. (cherry picked from commit 1f67704e2cd85a507776312b52dc63d8690b9260) --- 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 3da424a7c9dd..719dd4b58bae 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -3059,13 +3059,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); @@ -3108,13 +3108,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 " @@ -3123,8 +3125,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); }