From nobody Tue Jul 26 19:33:24 2022 X-Original-To: dev-commits-src-branches@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 4LsnBs6PPwz4WxYn; Tue, 26 Jul 2022 19:33:25 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LsnBr2Hqzz47YM; Tue, 26 Jul 2022 19:33:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658864004; 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=s/JLqJHKze9olhr86xRt3QWo3JQoURMUR0/+EyrifjI=; b=bW9/mV5AwpvtD+swOyZQArqtyXMxWMSbPP9oK8KJtex1wxyIAk6aayX+pBsIkPymnBm1Th cWLHg4ZERPcQ7H7i077Hc2bDxnyfc7zAXe700oMN5TSKQDI1e5sJafTgBR06VXYXa6XGmr oD+zvlolHKJG83QfLZNJkTjvXuxj9rN9jy4ec+q73CmtBVT1oAp5frh1aJ+Ln41x/q3s4V PRm57BO4g6N65DhBcgMMZREY+1s40CntIzKOicx/1l65hwKY8uE8tEm5Iy8ahoNet2qbsW W6qn2knnRHTLuMVJfH27rNDpRN6XW0cTJeL2HNmtRk1w4/UoKEavNCqT3wNS1g== 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 4LsnBr0rn3zplL; Tue, 26 Jul 2022 19:33:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26QJXOO0033803; Tue, 26 Jul 2022 19:33:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QJXO5o033802; Tue, 26 Jul 2022 19:33:24 GMT (envelope-from git) Date: Tue, 26 Jul 2022 19:33:24 GMT Message-Id: <202207261933.26QJXO5o033802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: fdeb262d1861 - stable/12 - ena: Store ticks of last Tx cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fdeb262d1861a918c8699021691163ebf856debe Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658864004; 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=s/JLqJHKze9olhr86xRt3QWo3JQoURMUR0/+EyrifjI=; b=DYiKvKUq23LD736HNLelbZp4E7bUW7LkqpbprlsBHZvssL8HehaYo6UEhSdp38pA7kueIZ EQ3kz6ZALJ+G2DQ67y6rE+dKvpUsWMRuEi/ID5XHDpWyfRBpMjwTZ1B2qTZHVYpmIffkFY fbLpMFXIgk2zk8q1wu/ik+e/jBxdLWEPoTldDkdfgwb4oEPruFsmgEHZyMNzYsXBT1e0Z/ wZr57wP0KpMGXp+pSUPHsWaxMxrbKduFqP+HIqdv1wKsXJSYFzJSXd0Xe61wt3OpEB8HSi vwb38Te+RQKl6OCwr1G6nEOPZ0XuhlaIdQTGLCe5VCqLvtxA5sqV90+734lZ/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658864004; a=rsa-sha256; cv=none; b=gjnUbuXq4fHAKlip+4+/GpG5gVjgJ4N5WlTJJacHD0XTrfQTaDuNR47DwDyq2I5RmmClUL 3biFjpQhpuwdn4I6IAVbywo1QNsy+kMAi2pcctl+W16OVa15YqEk9+TtBN3OSVYPp8Pz+p 8zByO7sQKu30N3m23v5w7CM1AwiEs3PZO1NZo+N8v+Zp2okUib1fDivEBLeHsGKJnuL/WU cxFgwFLWi01O55iVsHZv2v51sWvs9MhUlwvkY/fQk9QqFvlvQuc9JLPhwiLs82OLy0Ytxc cHqvpNWNm9gJZ3UFnC5/MY+h9lSg4kED/Tsfm29MZdjnQecP4Nlk9IPXm9+RGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=fdeb262d1861a918c8699021691163ebf856debe commit fdeb262d1861a918c8699021691163ebf856debe Author: Dawid Gorecki AuthorDate: 2022-06-10 09:18:09 +0000 Commit: Marcin Wojtas CommitDate: 2022-07-26 19:33:03 +0000 ena: Store ticks of last Tx cleanup Store timestamp of last cleanup in Tx ring structure. This does not change anything during normal operation of the driver but could be useful when the device fails for some reason. Obtained from: Semihalf MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit d8aba82b5ca75f1a5bff609af141844c4fc9de70) --- sys/dev/ena/ena.c | 17 ++++++++++++++--- sys/dev/ena/ena.h | 2 ++ sys/dev/ena/ena_datapath.c | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 64066896907e..74dcd37973b5 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -439,6 +439,7 @@ ena_init_io_rings_advanced(struct ena_adapter *adapter) /* Allocate Tx statistics. */ ena_alloc_counters((counter_u64_t *)&txr->tx_stats, sizeof(txr->tx_stats)); + txr->tx_last_cleanup_ticks = ticks; /* Allocate Rx statistics. */ ena_alloc_counters((counter_u64_t *)&rxr->rx_stats, @@ -3011,6 +3012,8 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, 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; @@ -3044,10 +3047,18 @@ check_missing_comp_in_tx_queue(struct ena_adapter *adapter, /* Check again if packet is still waiting */ if (unlikely(time_offset > adapter->missing_tx_timeout)) { - if (!tx_buf->print_once) + if (!tx_buf->print_once) { + time_since_last_cleanup = TICKS_2_USEC(ticks - + tx_ring->tx_last_cleanup_ticks); + missing_tx_comp_to = + sbttoms(adapter->missing_tx_timeout); ena_log(pdev, WARN, "Found a Tx that wasn't " - "completed on time, qid %d, index %d.\n", - tx_ring->qid, i); + "completed on time, qid %d, index %d." + "%d usecs have passed since last cleanup." + "Missing Tx timeout value %d msecs.\n", + tx_ring->qid, i, time_since_last_cleanup, + missing_tx_comp_to); + } tx_buf->print_once = true; missed_tx++; diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 43c31269bfd2..b100b091c89f 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -373,6 +373,8 @@ struct ena_ring { /* Used for LLQ */ uint8_t *push_buf_intermediate_buf; + int tx_last_cleanup_ticks; + #ifdef DEV_NETMAP bool initialized; #endif /* DEV_NETMAP */ diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index e3d30b32fceb..31de514d4b19 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -345,6 +345,8 @@ ena_tx_cleanup(struct ena_ring *tx_ring) ENA_RING_MTX_UNLOCK(tx_ring); } + tx_ring->tx_last_cleanup_ticks = ticks; + return (work_done); }