From nobody Tue Jul 26 19:30:52 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 4Lsn7x37Zdz4WwsH; Tue, 26 Jul 2022 19:30:53 +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 4Lsn7x1fKCz42bL; Tue, 26 Jul 2022 19:30:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658863853; 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=lRct/p2DjiMP/K6DUZPAsz/GKzjd8PpqAmRbVFSFOpQ=; b=qkVnFuRfVabUGM+UjWOIsSgHEuYOlSlYCAjZVAxhs8Ty26kbhMaOCUNlgkkIQCDOiF0jty 3ZFbO1y3Itx2++MOgaeb2RVBNtvxCr67twVzCKNcEfQuhw1ac0O6+XNZW3+REd9MWI1qA+ hVMU8BLJbkCqmiErsIIC+n/UPu33Jq6V/PJF/+3z8L9IwM2ngEqTL9+Gz24Vf8uHYPwvFr 8PDg0cYVtSh2+PsLp/PqavxoUlsK1nzAjzrjfrDseCu736oP9vcZ9/2GlMmQYqPXONRyIt /h8Hv+oWD8YngVErAZnt1SebkfBMbCDJnLYF4JgF06p8rPzJdL/p8lTtAP/lBA== 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 4Lsn7x0dlyzp5l; Tue, 26 Jul 2022 19:30:53 +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 26QJUqsb029638; Tue, 26 Jul 2022 19:30:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QJUqMQ029637; Tue, 26 Jul 2022 19:30:52 GMT (envelope-from git) Date: Tue, 26 Jul 2022 19:30:52 GMT Message-Id: <202207261930.26QJUqMQ029637@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: c41b1259ceb1 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: c41b1259ceb110b9ca0b0f57e7c153d0194d7084 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658863853; 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=lRct/p2DjiMP/K6DUZPAsz/GKzjd8PpqAmRbVFSFOpQ=; b=OzXG7grPsx5UrSE37ujAKz5Ej9mUjDtkdxhuAlW8g+rAGwRMsPsrsfNNcgjSR1Sl1daHSa rFq2qJJJ9i3oPtYYpXCVoJybQMhjaUNaxdcpHbYKt/kySK3mrSyTwDBU0v27WQZEMWilZ/ C5MofnxxEhSZTWbeOEnB9lw9O3qvWThWq0CZB3fD8becU0jvm58b/PC7RkCM3Uyv8LbQ/B TQ1y7szbe+SZrzh5A7qM30XsCNiw46Sc+hOgz6EhFyQqrwQfLKsGjVyWYfFRDi8GpVT/uX peJkP6L6Ws5YXqQwwbEvQ/PV4sDj3NsgxjAAy+sunZSw4riiKN+sKWU9eD9h3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658863853; a=rsa-sha256; cv=none; b=xQ4En7OQCGknxD+DfF+dMkUpsyb/q2uQAmntRG4PWwjffJA4UFtRN9iAuzmtivC2JEE0ul 4BsJjHI8ugsz4O2/gXh5R5nqDzDm2gbvnKb1bUwcpNzvQi3xH54ZTIyDIGroOlI5SaR+m4 Fg76LtxIwauKkrnqsWRveiMX45DNYqimWRr9oU31UxmQvgRKi9M5m6+knZVE9n7TFNlNhl +c5G279G2dXufviO7PsDMsQeFkjXFLkDBaSYHQNFRNixOMNcyiAU95ujfOj9HV9UdAxvZX 9ujPr6vi8LkDH6SkcVg1uPOElcHtW3bpOfpKwns6X+ZOYb6H0BvrqACq2rewDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=c41b1259ceb110b9ca0b0f57e7c153d0194d7084 commit c41b1259ceb110b9ca0b0f57e7c153d0194d7084 Author: Dawid Gorecki AuthorDate: 2022-06-10 09:18:09 +0000 Commit: Marcin Wojtas CommitDate: 2022-07-26 19:30:15 +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 d127f87ac8c6..044a8327972e 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, @@ -3007,6 +3008,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; @@ -3040,10 +3043,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 85f353e7ab54..56e14bd800ff 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -374,6 +374,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 6c18a4f5c1f9..85e9274eef14 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -344,6 +344,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); }