git: a9c39b031fe8 - main - ena: Extend debug prints for invalid req_id resets

From: Marcin Wojtas <mw_at_FreeBSD.org>
Date: Thu, 30 Jun 2022 16:15:32 UTC
The branch main has been updated by mw:

URL: https://cgit.FreeBSD.org/src/commit/?id=a9c39b031fe89a6414174e3db82da6548d7fff0f

commit a9c39b031fe89a6414174e3db82da6548d7fff0f
Author:     Dawid Gorecki <dgr@semihalf.com>
AuthorDate: 2022-06-10 09:18:07 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
CommitDate: 2022-06-30 15:31:29 +0000

    ena: Extend debug prints for invalid req_id resets
    
    Print information about qid if req_id is invalid. Add information about
    qid and req_id if mbuf is invalid.
    
    Obtained from: Semihalf
    MFC after: 2 weeks
    Sponsored by: Amazon, Inc.
---
 sys/dev/ena/ena_datapath.c | 7 +++++--
 sys/dev/ena/ena_netmap.c   | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c
index 8d4621947e03..6c18a4f5c1f9 100644
--- a/sys/dev/ena/ena_datapath.c
+++ b/sys/dev/ena/ena_datapath.c
@@ -212,7 +212,8 @@ ena_get_tx_req_id(struct ena_ring *tx_ring, struct ena_com_io_cq *io_cq,
 		return (EAGAIN);
 
 	if (unlikely(rc != 0)) {
-		ena_log(adapter->pdev, ERR, "Invalid req_id: %hu\n", *req_id);
+		ena_log(adapter->pdev, ERR, "Invalid req_id %hu in qid %hu\n",
+		    *req_id, tx_ring->qid);
 		counter_u64_add(tx_ring->tx_stats.bad_req_id, 1);
 		goto err;
 	}
@@ -220,7 +221,9 @@ ena_get_tx_req_id(struct ena_ring *tx_ring, struct ena_com_io_cq *io_cq,
 	if (tx_ring->tx_buffer_info[*req_id].mbuf != NULL)
 		return (0);
 
-	ena_log(adapter->pdev, ERR, "tx_info doesn't have valid mbuf\n");
+	ena_log(adapter->pdev, ERR,
+	    "tx_info doesn't have valid mbuf. qid %hu req_id %hu\n",
+	    tx_ring->qid, *req_id);
 err:
 	ena_trigger_reset(adapter, ENA_REGS_RESET_INV_TX_REQ_ID);
 
diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c
index 8ca6aad75abf..da9cb8fbccb2 100644
--- a/sys/dev/ena/ena_netmap.c
+++ b/sys/dev/ena/ena_netmap.c
@@ -882,7 +882,8 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id)
 	if (likely(req_id < tx_ring->ring_size))
 		return (0);
 
-	ena_log_nm(adapter->pdev, WARN, "Invalid req_id: %hu\n", req_id);
+	ena_log_nm(adapter->pdev, WARN, "Invalid req_id %hu in qid %hu\n",
+	    req_id, tx_ring->qid);
 	counter_u64_add(tx_ring->tx_stats.bad_req_id, 1);
 
 	ena_trigger_reset(adapter, ENA_REGS_RESET_INV_TX_REQ_ID);