Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Sep 2021 23:07:33 GMT
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 36130d2979d6 - main - ena: Trigger reset on ena_com_prepare_tx failure
Message-ID:  <202109012307.181N7Xk2020802@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mw:

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

commit 36130d2979d695dd439bc607feb00dcdb9a1937b
Author:     Artur Rojek <ar@semihalf.com>
AuthorDate: 2021-08-12 08:34:24 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
CommitDate: 2021-09-01 23:05:54 +0000

    ena: Trigger reset on ena_com_prepare_tx failure
    
    All ena_com_prepare_tx errors other than ENA_COM_NO_MEM are fatal and
    require device reset.
    
    Obtained from: Semihalf
    MFC after: 2 weeks
    Sponsored by: Amazon, Inc.
---
 sys/dev/ena/ena_datapath.c | 2 ++
 sys/dev/ena/ena_netmap.c   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c
index c0066b1209cc..1581bc2db87c 100644
--- a/sys/dev/ena/ena_datapath.c
+++ b/sys/dev/ena/ena_datapath.c
@@ -1000,6 +1000,8 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf)
 			    tx_ring->que->id);
 		} else {
 			ena_log(pdev, ERR, "failed to prepare tx bufs\n");
+			ena_trigger_reset(adapter,
+			    ENA_REGS_RESET_DRIVER_INVALID_STATE);
 		}
 		counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1);
 		goto dma_error;
diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c
index daed81986f13..7e07b0a8c555 100644
--- a/sys/dev/ena/ena_netmap.c
+++ b/sys/dev/ena/ena_netmap.c
@@ -444,6 +444,8 @@ ena_netmap_tx_frame(struct ena_netmap_ctx *ctx)
 		} else {
 			ena_log_nm(adapter->pdev, ERR,
 			    "Failed to prepare Tx bufs\n");
+			ena_trigger_reset(adapter,
+			    ENA_REGS_RESET_DRIVER_INVALID_STATE);
 		}
 		counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109012307.181N7Xk2020802>