[RFC,v4,0/3] librte_ethdev: error recovery support

Message ID 20200930123314.27669-1-kalesh-anakkur.purayil@broadcom.com (mailing list archive)


Kalesh A P Sept. 30, 2020, 12:33 p.m. UTC
  From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

The error recovery solution is a protocol implemented between firmware
and bnxt PMD to recover from the fatal errors without a system reboot.
There is an alarm thread which constantly monitors the health of the
firmware and initiates a recovery when needed.

There are two scenarios here:

1. Hardware or firmware encountered an error which firmware detected.
   Firmware is in operational status here. In this case, firmware can
   reset the chip and notify the driver about the reset.
2. Hardware or firmware encountered an error but firmware is dead/hung.
   Firmware is not in operational status. In this case, the only possible
   way to recover the adapter is through host driver(bnxt PMD).

In both cases, bnxt PMD reinitializes with the FW again after the reset.
During that recovery process, data path will be halted and any control path
operation would fail. So, the PMD has to notify the application about this
reset/error event to prevent any activities from the application while
the PMD is recovering from the error.

This patch set adds support for the reset and recovery event in
the rte_eth_event framework. FW error and FW reset conditions would be
managed by the PMD. Driver uses RTE_ETH_EVENT_RESET event to notify
the applications about the FW reset or error. In such cases,
PMD use the RTE_ETH_EVENT_RECOVERED event to notify application about
PMD has recovered from FW reset or FW error.

v4: Added doxygen comments about new events.
V3: Fixed a typo in commit log.
V2: Added a new event RTE_ETH_EVENT_RESET instead of using the
RTE_ETH_EVENT_INTR_RESET to notify applications about device reset.

Kalesh AP (3):
  ethdev: support device reset and recovery events
  net/bnxt: notify applications about device reset/recovery
  app/testpmd: handle device recovery event

 app/test-pmd/testpmd.c         |  6 +++++-
 drivers/net/bnxt/bnxt_cpr.c    |  3 +++
 drivers/net/bnxt/bnxt_ethdev.c |  9 +++++++++
 lib/librte_ethdev/rte_ethdev.h | 17 +++++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)