From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F2FEA056B; Wed, 4 Mar 2020 08:50:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57FB62C4F; Wed, 4 Mar 2020 08:50:36 +0100 (CET) Received: from rcdn-iport-5.cisco.com (rcdn-iport-5.cisco.com [173.37.86.76]) by dpdk.org (Postfix) with ESMTP id 1891B2BB8 for ; Wed, 4 Mar 2020 08:50:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2862; q=dns/txt; s=iport; t=1583308234; x=1584517834; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=XEQVf9b4E+mhfLG0q1nNaKhlflpXCjQafpDdhNKRr3w=; b=AnxhlYCbqQFVG5fR7mzzaRQs0U1sAKxNPmGv6ni843EPWN2Bhk8g2spt YIhYY6fRZUntkUOFh0Cob7DolUtpjZEwMdHbd9HW0IdIxyYxNqsHqTIlR HXCOEzfitb976+dztIS7Ij9rfUqLeEGsTMtfw2y9jRIMOqlLGz3CyrZ7e s=; IronPort-PHdr: =?us-ascii?q?9a23=3AzS5Snxb4LAG3uh5Rep5gpnn/LSx94ef9IxIV55?= =?us-ascii?q?w7irlHbqWk+dH4MVfC4el20gebRp3VvvRDjeee87vtX2AN+96giDgDa9QNMn?= =?us-ascii?q?1NksAKh0olCc+BB1f8Kavqfis8H8VHfFRk5Hq8d0NSHZW2ag=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CUBQBwXV9e/4wNJK1lHAEBAQEBBwE?= =?us-ascii?q?BEQEEBAEBgXuBVFAFgUQgBAsqh1oDimmCX5gVgUKBEANUCQEBAQwBAS0CBAE?= =?us-ascii?q?BhEACgX0kOBMCAwEBCwEBBQEBAQIBBQRthVYMhWMBAQEBAxIoBgEBNwELBAI?= =?us-ascii?q?BCBEEAQEfEDIdCAIEAQ0FCBqFTwMuAaFaAoE5iGKCJ4J/AQEFhRsYggwJgTi?= =?us-ascii?q?MJxqBQT+BWIJNPoQxHINBgiyvKnYKgjyXApsxjnKbSwIEAgQFAg4BAQWBaSK?= =?us-ascii?q?BWHAVgydQGA2OHYNzihwBOHQCgSeNHwEB?= X-IronPort-AV: E=Sophos;i="5.70,513,1574121600"; d="scan'208";a="487465401" Received: from alln-core-7.cisco.com ([173.36.13.140]) by rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 04 Mar 2020 07:50:26 +0000 Received: from XCH-ALN-002.cisco.com (xch-aln-002.cisco.com [173.36.7.12]) by alln-core-7.cisco.com (8.15.2/8.15.2) with ESMTPS id 0247oQE9012441 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 4 Mar 2020 07:50:26 GMT Received: from xhs-aln-001.cisco.com (173.37.135.118) by XCH-ALN-002.cisco.com (173.36.7.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 4 Mar 2020 01:50:26 -0600 Received: from xhs-rtp-001.cisco.com (64.101.210.228) by xhs-aln-001.cisco.com (173.37.135.118) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 4 Mar 2020 01:50:26 -0600 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (64.101.32.56) by xhs-rtp-001.cisco.com (64.101.210.228) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 4 Mar 2020 02:50:25 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bkOix08qKMrgIF4sejZJfeYhmzMhFCEFuLWiowPwIQHrbbFdd+fHhtM20D1V6E8dso+rahQXi4AWiTrZjN4hQAlSBQeyYHK63I4KOnhGgS0H4hhn5oi1U1JcLz8tt7ZrpM9nKyHpC6l75zxEljU6eKIusUtLgMd2yIBgFAbYjDTja9zS6Z7w9I7s8cTJoZ82AE6sL5n+YlFXAC1hASsFmYC8BOM7qMM3kd9Jp2tkOLGSfPn5bGaF6JnaA57GoZGrPDV2SKmHPD9Tzsuup55QfalSNK0LopgkBrMMkN9epwld9WNgfc+fVeKumzzdu04PfOacriJQOOzhAvuZA/15Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MA+4OoBLC8FvnhOTheYM1qEth64+Y444I3OJZcckx98=; b=Vo3L88Aic7rnr7lfHBS1nOIv8TIKq4wGhcd8yWOQHWggz2S2HKK2CYOrNwQvfSMzsdrTNOl+4HPASj7rd7VlKHYlOxBFHyDUuy2l2rqNi8FeLa6FQlVpmYnVgdikmDyjEfQy0q3UDKaWQgshkOH3dte2tzKtPrzAMxZEo5SGbgMaU9tM7vufrxLRnJKXsDNexSGVrAr7XP3r1Ezlq1eU2Fl9PdU7UhiS5z50Pf+kipHjGXOuLZSuMgp30sSM/S11EPG1ThqW05/fj11YcabNy7ErngLSVvfcoQhHO4nFZbeSs1gNXNaJb4PveDBIRVM3C5ASatLqQJACwFlCzzXcbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MA+4OoBLC8FvnhOTheYM1qEth64+Y444I3OJZcckx98=; b=hfNID3YsMHXaMHH2P8LcMfxHFInOGzpebBwkGxO0AquB1wmPV9tP5w9Ftkv4pI6DyXbHs898lPbhdA6Hi2B78Eh9LbUHong4njlk2aJVscN7US2hQ7jHMxWUpA89YCfiE0uaVhwBzxWQBuWRYqt6Ms78AzUdhnyJeXay6ZQGdSY= Received: from DM6PR11MB2745.namprd11.prod.outlook.com (2603:10b6:5:c7::31) by DM6PR11MB4169.namprd11.prod.outlook.com (2603:10b6:5:19b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Wed, 4 Mar 2020 07:50:25 +0000 Received: from DM6PR11MB2745.namprd11.prod.outlook.com ([fe80::f5b6:e323:43f2:12ec]) by DM6PR11MB2745.namprd11.prod.outlook.com ([fe80::f5b6:e323:43f2:12ec%6]) with mapi id 15.20.2772.019; Wed, 4 Mar 2020 07:50:25 +0000 From: "Hyong Youb Kim (hyonkim)" To: Ferruh Yigit , Hemant Agrawal , Sachin Saxena , Fiona Trahe , John Griffin , "Deepak Kumar Jain" , "John Daley (johndale)" , Alfredo Cardigliano , Matan Azrad , Shahaf Shuler , "Viacheslav Ovsiienko" , Bernard Iremonger CC: "dev@dpdk.org" , David Marchand , Thomas Monjalon , Stephen Hemminger Thread-Topic: [PATCH v2] log: add API to check if a logtype can log in a given level Thread-Index: AQHV8YgxG5Vih9+RdkGiI48kjgAAaKg4DkrA Date: Wed, 4 Mar 2020 07:50:24 +0000 Message-ID: References: <20200303132512.4138303-1-ferruh.yigit@intel.com> <20200303181817.3448334-1-ferruh.yigit@intel.com> In-Reply-To: <20200303181817.3448334-1-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=hyonkim@cisco.com; x-originating-ip: [2001:420:c0dc:1002::d2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4472a954-b51c-4985-1395-08d7c010b2f7 x-ms-traffictypediagnostic: DM6PR11MB4169: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 0332AACBC3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(346002)(136003)(376002)(366004)(396003)(199004)(189003)(55016002)(7696005)(8676002)(8936002)(5660300002)(9686003)(7416002)(64756008)(76116006)(81156014)(81166006)(66946007)(52536014)(66556008)(66476007)(66446008)(33656002)(86362001)(71200400001)(478600001)(54906003)(4326008)(2906002)(316002)(110136005)(6506007)(186003)(53546011)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR11MB4169; H:DM6PR11MB2745.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Q/kT9XeRJ/9J22BZ/QBml7h5rh5zwkuXZ10rn6uH9zeIHn9XK4lQn5C4kwQRRCs+6R9aMiVH8byY64xgmlFMkizvoDlrnyI6/4Y2Tg4zUQvVRnOfoIiHa2L+SFlqljzPj1mJCjWni4o7B82JRA8slOsNrOp8lLEW52F8oap3eumK02fD872KPpsuSN2bckRcTlU3PXdXBruCuDm7O4+rUvtAta3tIAzg+B0MVur+bGSwwwj7TG8EYS09AX/otik+Mo4RgCKLmkrg77c9l4AGimukt3Jm1bud70wiffW4QFyyMyMQOzydMxmywaYf9aS1bUFQGr0MaJLzyXseQg12YzAZh6lQEAducHT3u2wuKahFwdsMVPcyjCX8Aq0/yquWgQohJgiJCRE0gCSeRwBxQf3p5rwDc6Rv0po4jIGyB8phhsAO46QcyIbeWOjkyFUo+RpEnjApriXmXrE2xLhC7kCM/JMGgR42zRV0OhxHurogQSOMTVshI4dozcz93tUP x-ms-exchange-antispam-messagedata: TRfH2sSLe+yDMXtpPXBMPTgtM9o4fKazbS1+rUmp2EE2aMZRSW3LIBiZ/9CA/NnotfIZfpH1f0J6AjoMRqi2qPiJ6KA15ybhIxrLAtB8YR4PvDFgUPa4xARbhFc/5gtMhyKIy8C1PfpO226iT9e7KrqrjY60t5CiMn8W3j1LhR8= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 4472a954-b51c-4985-1395-08d7c010b2f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2020 07:50:24.9441 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CKbflI1FzOsqlFLIv5Lm5gVU+7bW++xvMEmsAtJLggf9Q+5DYzCiHMhEUe9ZAWhexQJNzm2CwZDf4rSKKWNAhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4169 X-OriginatorOrg: cisco.com X-Outbound-SMTP-Client: 173.36.7.12, xch-aln-002.cisco.com X-Outbound-Node: alln-core-7.cisco.com Subject: Re: [dpdk-dev] [PATCH v2] log: add API to check if a logtype can log in a given level X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Ferruh Yigit > Sent: Wednesday, March 4, 2020 3:18 AM > To: Hemant Agrawal ; Sachin Saxena > ; Fiona Trahe ; John > Griffin ; Deepak Kumar Jain > ; John Daley (johndale) ; > Hyong Youb Kim (hyonkim) ; Alfredo Cardigliano > ; Matan Azrad ; Shahaf > Shuler ; Viacheslav Ovsiienko > ; Bernard Iremonger > > Cc: dev@dpdk.org; Ferruh Yigit ; David Marchand > ; Thomas Monjalon > ; Stephen Hemminger > > Subject: [PATCH v2] log: add API to check if a logtype can log in a given= level >=20 > 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.. >=20 > A few existing relevant usage converted to this new API. >=20 > Signed-off-by: Ferruh Yigit > --- > Cc: David Marchand > Cc: Thomas Monjalon > Cc: Stephen Hemminger >=20 > 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(-) >=20 [...] > 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 Thanks.. -Hyong