net/ena: use common debug options
authorMichal Krawczyk <mk@semihalf.com>
Fri, 23 Jul 2021 10:24:50 +0000 (12:24 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 23 Jul 2021 15:42:33 +0000 (17:42 +0200)
commit0a001d69bca086c5a6e62b10552192380efee1f0
tree07c09a74c193fd05fc261e552e1dcb151db75046
parent617898d12a7232fa3fd5c16a04efc780c1a6f493
net/ena: use common debug options

ENA defined its own logger flags for Tx and Rx, but they weren't
technically used anywhere. Those data path loggers weren't used anywhere
after the definition.

This commit uses the generic RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX
flags to define PMD_TX_LOG and PMD_RX_LOG which are now being used on
the data path. The PMD_TX_FREE_LOG was removed, as it has no usage in
the current version of the driver.

RTE_ETH_DEBUG_[TR]X now wraps extra checks for the driver state in the
IO path - this saves extra conditionals on the hot path.

ena_com logger is no longer optional (previously it had to be explicitly
enabled by defining this flag: RTE_LIBRTE_ENA_COM_DEBUG). Having this
logger optional makes tracing of ena_com errors much harder.
Due to ena_com design, it's impossible to separate IO path logs
from the management path logs, so for now they will be always enabled.

Default levels for the affected loggers were modified. Hot path loggers
are initialized with the default level of DEBUG instead of NOTICE, as
they have to be explicitly enabled. ena_com logging level was reduced
from NOTICE to WARNING - as it's no longer optional, the driver should
report just a warnings in the ena_com layer.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
drivers/net/ena/base/ena_plat_dpdk.h
drivers/net/ena/ena_ethdev.c
drivers/net/ena/ena_logs.h