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.
This commit is contained in:
Artur Rojek 2021-08-12 10:34:24 +02:00 committed by Marcin Wojtas
parent c81f8c2611
commit 36130d2979
2 changed files with 4 additions and 0 deletions

View file

@ -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;

View file

@ -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);