From e3cecf70c321a4bf98a5d8355b62ce0865a58cdd Mon Sep 17 00:00:00 2001 From: Marcin Wojtas Date: Thu, 30 May 2019 13:14:58 +0000 Subject: [PATCH] Print ENA Tx error conditionally Information about Tx error should be only displayed, if packet preparation failed due to error other than out of memory. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. --- sys/dev/ena/ena.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 9481e5cb182f..05cdfbe0a3a0 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -2786,7 +2786,13 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf) /* Prepare the packet's descriptors and send them to device */ rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc != 0)) { - ena_trace(ENA_DBG | ENA_TXPTH, "failed to prepare tx bufs\n"); + if (likely(rc == ENA_COM_NO_MEM)) { + ena_trace(ENA_DBG | ENA_TXPTH, + "tx ring[%d] if out of space\n", tx_ring->que->id); + } else { + device_printf(adapter->pdev, + "failed to prepare tx bufs\n"); + } counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1); goto dma_error; }