ena-com: restructure the ENA logging system
authorMarcin Wojtas <mw@FreeBSD.org>
Thu, 24 Jun 2021 13:48:26 +0000 (15:48 +0200)
committerMarcin Wojtas <mw@FreeBSD.org>
Thu, 24 Jun 2021 13:48:26 +0000 (15:48 +0200)
commit1f4f67f52424ac53d07ff524af9762fdf2e2b210
tree89964545fb49dc9f8d97c45bb8c972c4a0ded179
parente0f5dd7cdd3d85acef2ecde7b74a952521e2e947
ena-com: restructure the ENA logging system

Introduce a new logging system, which replaces the old logging method.

All logs are now displayed in `device_printf` format, requiring
`adapter->pdev` to be passed down to `ena_log`. Whenever that's
impossible, a `printf` wrapped `ena_log_raw` is provided.

For netmap logs, `ena_log_nm` is available, prepending "[nm] " to
an `ena_log` formatted message.

Tx/Rx data path logs are now printed via `ena_log_io`. This allows them
to be conditionally compiled out, depending on the presence of
ENA_LOG_IO_ENABLE compilation flag. By default this flag is disabled.

All `ena_trc_*` ena_com level messages are now also wrapped around
`ena_log` and require `ena_dev->dmadev` to be present.

There are four log levels:
* 0 - ENA_ERR  - enable driver error messages and ena_com error logs,
* 1 - ENA_WARN - enable logs for non-critical errors,
* 2 - ENA_INFO - make the driver more verbose about its actions,
* 3 - ENA_DBG  - enable debug logs

Please see `ena_fbsd_log.h` for implementation details.

Submitted by: Artur Rojek <ar@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
ena_fbsd_log.h [new file with mode: 0644]
ena_plat.h