> -----Original Message-----
> From: Ferruh Yigit <[email protected]>
> Sent: Wednesday, March 4, 2020 3:18 AM
> To: Hemant Agrawal <[email protected]>; Sachin Saxena
> <[email protected]>; Fiona Trahe <[email protected]>; John
> Griffin <[email protected]>; Deepak Kumar Jain
> <[email protected]>; John Daley (johndale) <[email protected]>;
> Hyong Youb Kim (hyonkim) <[email protected]>; Alfredo Cardigliano
> <[email protected]>; Matan Azrad <[email protected]>; Shahaf
> Shuler <[email protected]>; Viacheslav Ovsiienko
> <[email protected]>; Bernard Iremonger
> <[email protected]>
> Cc: [email protected]; Ferruh Yigit <[email protected]>; David Marchand
> <[email protected]>; Thomas Monjalon
> <[email protected]>; Stephen Hemminger
> <[email protected]>
> Subject: [PATCH v2] log: add API to check if a logtype can log in a given 
> level
> 
> This is a helper function in case components would like to do more work
> than just logging a message based on log level, like for example
> collecting some stats if the log type is DEBUG etc..
> 
> A few existing relevant usage converted to this new API.
> 
> Signed-off-by: Ferruh Yigit <[email protected]>
> ---
> Cc: David Marchand <[email protected]>
> Cc: Thomas Monjalon <[email protected]>
> Cc: Stephen Hemminger <[email protected]>
> 
> v2:
> * Convert API return type to 'bool'. Removed custom definitions from
>   'ionic' PMD for this.
> ---
>  drivers/bus/fslmc/fslmc_bus.c                |  7 +------
>  drivers/common/qat/qat_logs.c                |  7 ++-----
>  drivers/net/enic/enic_fm_flow.c              |  2 +-
>  drivers/net/ionic/ionic_osdep.h              |  6 ------
>  drivers/net/mlx5/mlx5_mr.c                   |  2 +-
>  lib/librte_eal/common/eal_common_log.c       | 18 ++++++++++++++++++
>  lib/librte_eal/common/include/rte_log.h      | 14 ++++++++++++++
>  lib/librte_eal/rte_eal_version.map           |  3 +++
>  lib/librte_flow_classify/rte_flow_classify.c |  7 ++-----
>  9 files changed, 42 insertions(+), 24 deletions(-)
> 
[...]
> diff --git a/drivers/net/enic/enic_fm_flow.c
> b/drivers/net/enic/enic_fm_flow.c
> index c0ddfe9ba..d815f369e 100644
> --- a/drivers/net/enic/enic_fm_flow.c
> +++ b/drivers/net/enic/enic_fm_flow.c
> @@ -1504,7 +1504,7 @@ enic_fm_dump_tcam_entry(const struct
> fm_tcam_match_entry *fm_match,
>                       const struct fm_action *fm_action,
>                       uint8_t ingress)
>  {
> -     if (rte_log_get_level(enic_pmd_logtype) < (int)RTE_LOG_DEBUG)
> +     if (!rte_log_can_log(enic_pmd_logtype, RTE_LOG_DEBUG))
>               return;
>       enic_fm_dump_tcam_match(fm_match, ingress);
>       enic_fm_dump_tcam_actions(fm_action);

For enic,

Acked-by: Hyong Youb Kim <[email protected]>

Thanks..
-Hyong

Reply via email to