numam-dpdk/drivers/net/ena/ena_logs.h
Michal Krawczyk 0a001d69bc 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>
2021-07-23 17:42:33 +02:00

38 lines
1019 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates.
* All rights reserved.
*/
#ifndef _ENA_LOGS_H_
#define _ENA_LOGS_H_
extern int ena_logtype_init;
#define PMD_INIT_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, ena_logtype_init, \
"%s(): " fmt, __func__, ## args)
#ifdef RTE_ETHDEV_DEBUG_RX
extern int ena_logtype_rx;
#define PMD_RX_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, ena_logtype_rx, \
"%s(): " fmt, __func__, ## args)
#else
#define PMD_RX_LOG(level, fmt, args...) do { } while (0)
#endif
#ifdef RTE_ETHDEV_DEBUG_TX
extern int ena_logtype_tx;
#define PMD_TX_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, ena_logtype_tx, \
"%s(): " fmt, __func__, ## args)
#else
#define PMD_TX_LOG(level, fmt, args...) do { } while (0)
#endif
extern int ena_logtype_driver;
#define PMD_DRV_LOG(level, fmt, args...) \
rte_log(RTE_LOG_ ## level, ena_logtype_driver, \
"%s(): " fmt, __func__, ## args)
#endif /* _ENA_LOGS_H_ */