> -----Original Message----- > From: Ferruh Yigit <ferruh.yi...@intel.com> > Sent: Wednesday, March 4, 2020 3:18 AM > To: Hemant Agrawal <hemant.agra...@nxp.com>; Sachin Saxena > <sachin.sax...@nxp.com>; Fiona Trahe <fiona.tr...@intel.com>; John > Griffin <john.grif...@intel.com>; Deepak Kumar Jain > <deepak.k.j...@intel.com>; John Daley (johndale) <johnd...@cisco.com>; > Hyong Youb Kim (hyonkim) <hyon...@cisco.com>; Alfredo Cardigliano > <cardigli...@ntop.org>; Matan Azrad <ma...@mellanox.com>; Shahaf > Shuler <shah...@mellanox.com>; Viacheslav Ovsiienko > <viachesl...@mellanox.com>; Bernard Iremonger > <bernard.iremon...@intel.com> > Cc: dev@dpdk.org; Ferruh Yigit <ferruh.yi...@intel.com>; David Marchand > <david.march...@redhat.com>; Thomas Monjalon > <tho...@monjalon.net>; Stephen Hemminger > <step...@networkplumber.org> > 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 <ferruh.yi...@intel.com> > --- > Cc: David Marchand <david.march...@redhat.com> > Cc: Thomas Monjalon <tho...@monjalon.net> > Cc: Stephen Hemminger <step...@networkplumber.org> > > 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 <hyon...@cisco.com> Thanks.. -Hyong