From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0048.outbound.protection.outlook.com [104.47.33.48]) by dpdk.org (Postfix) with ESMTP id D1C181B01C for ; Tue, 19 Dec 2017 13:25:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lzsxdHtWLLqTV6B3AKdYHLtps+8iTc37Wx8WW5Qh47A=; b=CKuOF0fytmi5agh8ksDqzDvegSzsA7l+CAXId4ig7LwGY6A0kw3RP9MF3zSih6o0e8YwE52/zF7Y5cqey+0hN4vHE1iJtwYolwrhH5Oax/8JKwyFTMdtuHtzszWE+hbywjuHfPDBepSjDe+p/oToCnihqqa8veaDdlGLY0+PxoQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3462.namprd07.prod.outlook.com (10.171.252.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 12:25:46 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, olivier.matz@6wind.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 19 Dec 2017 17:55:08 +0530 Message-Id: <20171219122510.15004-4-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171219122510.15004-1-pbhagavatula@caviumnetworks.com> References: <20171219122510.15004-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BN6PR14CA0017.namprd14.prod.outlook.com (10.173.157.155) To CY4PR07MB3462.namprd07.prod.outlook.com (10.171.252.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ecd0335f-fc65-4965-931b-08d546dba2c0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:CY4PR07MB3462; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 3:g+szWLfs6vbHxpmH54Mp9rFh0vyHOtd5UZcOQp7qndTePqpsgpMsNh8B/RuVkg797EcPZzNoN9dMRUsQJXROVXjox1dCsgJqp0L9fid+yPnakyRY/Ze5IjHF14b9sXEYD/naI+DNC3WefacFjJdusMkYfk942ANKYzPiw+RLnJktBnUEvu2lkRgsO+sw6zLHBT9px5hNSl1mWua8PXdo3Qql7rQqvP8Unvek7Hhcmgk8jwJ3qo6ZSvA+ZseGKBO6; 25:i4/mXC5QSk/wY3txJTV4LJHWllAsf+V++0w6ArmrF9UU1diQhB1DWeuPgs9OrGNhjYJbazSfHX+0iRV0IsV2YcQKrSU8LMcv0/Fhf7rKMOXCudNcZPXhuQ5EZ1i1W8dWp+kYggT6MSpHOMAWZos7srOVVhWEs8kRqAi/9+2Tp76sObqKjRwo0UasvK6Zw+Pf0F4SbfYRcWFci6VbUgHIeBiZCXDOwxWfyVYOSZsS6KwLTlxsq2iCk0UcK0qFDwZOewh66xrxdls7YxRFFobR9ZInEoUmemDtJU09N2dEy4Z1+QXNaBV/1VoxenHF/YemEmjRy2eSF0ZTCqrQy5LLag==; 31:GGuln1W0kwEE7KK8JL7SWHevG0YaVYKrG48rg7DTy5+ZwgC8bFAj06j4FBTqhRk9ZpwpjxoIQL1Ik1W0L1ur5zVTMnUK5cpH+Qcud1uHNxMWa+NTXKyDuxiDcE7WqTCFKHyE3P21r1n27XGPnYFgo0rURiDtwCqfg+WTB6AzM7x1T8QbkBvde+RYagLOsFXFtsej/F9QBnG1a9iJxgrwg0Ftvpq+VWe5oiM0z72sEbc= X-MS-TrafficTypeDiagnostic: CY4PR07MB3462: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 20:s9A28mUq4glzjJjCH9o96ueeV+3h0tm24LY/k7AWH3AQppC2RLCGYJ4L1Bw/it2qqZiKXA7jEXFjvTIQsbakjffVNgFMMzDeX82AnehO0oTNCau46wAzYyKsVxOONeORloeLbo3pxYhp+c6ki9Cf4T44CzZyo+O/VeYTc/2pe42NrYLhZMbRZse5BA8dUoN12XgMhZ38fqXKFOb26ODgoEUcNfBVmyAxUx+ybbJFJc630V4SbwLoNeRyrjYVNEiIAaYEKSII0DxXePeImZHqtfCEUwss3wZuitFrM02gmQD7vPEQWLVPtvNchQf8MAj0DisLHKCQgIHmuCZzJRPQjwMqXDELzOKe5H7r/tQ+3BDAHz3Hr3GjZYacMiVjgBj4OMlORF2ZyBp133ZqfWIz7Ui1y8s3JhhAfzis3qRHSBhP5R3Caxbzxiv7TZ/DUCuq4nKvav8biWzWhpF24qOLzgKaRilxufL7AgUpswoFlYXlfU0F9BTQZuH2QzkcfHoiPvGGChQ671dW1rU5pnLb6jhFjjcej6hydavxAEXIgaCjq/ypQMayMGLl7184t+FH83TEdH+j9nGdy3OGKdLEYKV3m/f8q+TrDUdRd9r4K3A=; 4:YAcVFaKka0rwXJ6QjkF2km7rG6OYoHLiSEoDAtMDQolGodymgf3dGXYPJTV30buK7O+Vu1K+Lbm0Mte810leILflqulNgdPh47fH4QbltWUhObDsy8QLUMej/MyXSdtxeqH9tLOcrOU1fdKabt/RQ3ew5QTF7/JI4RHjZ3FhGPP6UJUwRp03WcZiWKPo4c7KWHn/Jg6GIroMqphchFJGHcbPcf5Z+ZIfQElDy7LOhtdKOe8iCISgcBkE+vMAYVvHI7PZO76qTNa8kmt6OHbGsw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231023)(6041248)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123560025)(6072148)(201708071742011); SRVR:CY4PR07MB3462; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3462; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(346002)(396003)(376002)(199004)(189003)(68736007)(5009440100003)(53416004)(6506007)(386003)(59450400001)(106356001)(50466002)(36756003)(7736002)(8936002)(76176011)(2906002)(8676002)(66066001)(51416003)(316002)(81166006)(16586007)(72206003)(69596002)(50226002)(2950100002)(42882006)(6666003)(16526018)(53936002)(97736004)(81156014)(52116002)(4326008)(305945005)(6486002)(107886003)(1076002)(478600001)(3846002)(48376002)(6116002)(5660300001)(6512007)(105586002)(25786009)(575784001)(47776003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3462; H:Pavan-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3462; 23:phrYCSwvI0sj81C1JjSBUUeZd5HgdyOl114lbJYQ0?= =?us-ascii?Q?WR2LVE1CIB0qMzqjx/FSRiWyGhW5ftXToJsbplGK3Xkd1bVhxvX+aTVTZWWC?= =?us-ascii?Q?odumGQV9dCWFOcSsV3W6mV2uobnz1+WPsnDhVxpJhhrCjt3Va1BcANAyZ8lV?= =?us-ascii?Q?a3ryjntq8B4fWrL81V1gXQS1z2vWFhG+Ap6E9VVMl5W3CWR/h2ZpFfceTGHz?= =?us-ascii?Q?wGg2k2bER53hKA1lQJPHAGGYlfzCrdMlz5dWCZNDDNFJ7zlPbidh0cKQv5+3?= =?us-ascii?Q?iPS08JP1vbPnEZdLMsDHDJ47egjLGqZaKAUb0dHVixuS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AQ45HFE4TzUy83zBgq7kMEYccfWvzg1z6mT8yxhabLxnilw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 6:HUvfgKm41UZ2EodfORJXDdd+cBnN2C9gcB6cf107fLW6oLSwMKrT7jFYwubqJcdLsBbEoOQGut1btYxBDM40Y27LUYof9StPkkNE9YNk+3OnhnmIloXSnlk5CgC0xh0bEbR8mWb30npoyNubV/r9OBMUJO6TiUVg/2C4kCb+ezE2BLwIZH6maLijS//8upl56B9u+swgSAv7mV9csYZuMdaWlWXA6LlqZOjP8VaSZ4G8pBLyExUmBZMLpXUqxYHPEP6+oP5bl+QWHoX7wL9lujMdUJ+nrY1Hwv58sQaF3o3EsbhYRmKbbMp8IGNUTZUFVXhgUjGqDC3IX2Lgm7ShI2oxJiXiPzT58QCLXd5zpwM=; 5:jAm7anW29kGUpPmeSaAuhn8zHNX7CKUzUK/BcMwg1MNacMMppEwGueIwilt007zEqkYWOLRLpgAzi9w3QG2PpMcED1Z+IXpB3pbKirtOQ9NrekSainyjQBoz8RCMPrz1JgevfuC9n/x7psfkDrXWCfJDu2TOnItOxF24KQ+/juc=; 24:dglL4XPGBbpprG3kruYppyzyLfHHWhF3j4MWZCQUN3KHHlpxsJVnX1aF8gSv68Vn0DTtsw8sB//Gyfd1l3Oi6K+5oixnL57+WuWZTFJfsc4=; 7:JKtan8MNFZq79OA+axEyLHVVMGEEIiuCuv8cAKcdBdQMeJbGxOJRbEBoZHaSI+u3YCBgrOiWp9jR+kj8DRqlzPRQTtNSu681U6B2GCaa9Qo/BZvpp9a3S60RnhPTW+RHZ3JWrhhxb8Je+DqFc594Hf1a6ZIRwLNjVmzUdQ0MdL23HZ08otLdfk5SXANNlQY+NTTd0r3iTwY+ur289nvWpBha7nsjKiknRu/m1qF6a5ZwBQEAHt0TFBGIy8m8JLm3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 12:25:46.0886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ecd0335f-fc65-4965-931b-08d546dba2c0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3462 Subject: [dpdk-dev] [PATCH 3/5] mempool/octeontx: implement dynamic logging 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: , X-List-Received-Date: Tue, 19 Dec 2017 12:25:50 -0000 Signed-off-by: Pavan Nikhilesh --- config/common_base | 1 - drivers/mempool/octeontx/octeontx_fpavf.c | 16 +++++++++++ drivers/mempool/octeontx/octeontx_pool_logs.h | 41 +++++++++++---------------- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/config/common_base b/config/common_base index fc6b6d157..b616ac3d1 100644 --- a/config/common_base +++ b/config/common_base @@ -607,7 +607,6 @@ CONFIG_RTE_DRIVER_MEMPOOL_STACK=y # Compile PMD for octeontx fpa mempool device # CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL=y -CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL_DEBUG=n # # Compile librte_mbuf diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c index 3bc50f35d..ec9a957d6 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.c +++ b/drivers/mempool/octeontx/octeontx_fpavf.c @@ -133,6 +133,22 @@ struct octeontx_fpadev { static struct octeontx_fpadev fpadev; +int octeontx_logtype_fpavf; +int octeontx_logtype_fpavf_mbox; + +RTE_INIT(otx_pool_init_log); +static void +otx_pool_init_log(void) +{ + octeontx_logtype_fpavf = rte_log_register("pmd.otx.mempool"); + if (octeontx_logtype_fpavf >= 0) + rte_log_set_level(octeontx_logtype_fpavf, RTE_LOG_NOTICE); + + octeontx_logtype_fpavf_mbox = rte_log_register("pmd.otx.mempool.mbox"); + if (octeontx_logtype_fpavf_mbox >= 0) + rte_log_set_level(octeontx_logtype_fpavf_mbox, RTE_LOG_NOTICE); +} + /* lock is taken by caller */ static int octeontx_fpa_gpool_alloc(unsigned int object_size) diff --git a/drivers/mempool/octeontx/octeontx_pool_logs.h b/drivers/mempool/octeontx/octeontx_pool_logs.h index 58ccb0f0e..170c13691 100644 --- a/drivers/mempool/octeontx/octeontx_pool_logs.h +++ b/drivers/mempool/octeontx/octeontx_pool_logs.h @@ -35,34 +35,25 @@ #include -#ifdef RTE_LIBRTE_OCTEONTX_MEMPOOL_DEBUG -#define fpavf_log_info(fmt, args...) \ - RTE_LOG(INFO, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) -#define fpavf_log_dbg(fmt, args...) \ - RTE_LOG(DEBUG, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) +#define FPAVF_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, octeontx_logtype_fpavf,\ + "%s() line %u: " fmt "\n", __func__, __LINE__, ## args) -#define mbox_log_info(fmt, args...) \ - RTE_LOG(INFO, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) -#define mbox_log_dbg(fmt, args...) \ - RTE_LOG(DEBUG, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) -#else -#define fpavf_log_info(fmt, args...) -#define fpavf_log_dbg(fmt, args...) -#define mbox_log_info(fmt, args...) -#define mbox_log_dbg(fmt, args...) -#endif +#define MBOX_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, octeontx_logtype_fpavf_mbox,\ + "%s() line %u: " fmt "\n", __func__, __LINE__, ## args) +#define fpavf_log_info(fmt, ...) FPAVF_LOG(INFO, fmt, ##__VA_ARGS__) +#define fpavf_log_dbg(fmt, ...) FPAVF_LOG(DEBUG, fmt, ##__VA_ARGS__) +#define fpavf_log_err(fmt, ...) FPAVF_LOG(ERR, fmt, ##__VA_ARGS__) #define fpavf_func_trace fpavf_log_dbg -#define fpavf_log_err(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) + +#define mbox_log_info(fmt, ...) MBOX_LOG(INFO, fmt, ##__VA_ARGS__) +#define mbox_log_dbg(fmt, ...) MBOX_LOG(DEBUG, fmt, ##__VA_ARGS__) +#define mbox_log_err(fmt, ...) MBOX_LOG(ERR, fmt, ##__VA_ARGS__) #define mbox_func_trace mbox_log_dbg -#define mbox_log_err(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) + +extern int octeontx_logtype_fpavf; +extern int octeontx_logtype_fpavf_mbox; #endif /* __OCTEONTX_POOL_LOGS_H__*/ -- 2.14.1