From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0050.outbound.protection.outlook.com [104.47.33.50]) by dpdk.org (Postfix) with ESMTP id 179AC1B01B for ; Tue, 19 Dec 2017 13:25:47 +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=+uk7cdj9OxdUgcagkQSuBig4m5qdh/snYP1r9xu+xSM=; b=nd6xalBxkbBSlb5qT+/e+rLxUUyIrPB7vo5+b6RIG0hVjjZFEK4wNKaV60Q+MtQgzfzijiKpzOZEbmxNvY5LpSL1CJNSUjq3bHVKt2MtjYxLOdyfuyX/tEJ5385CZU+KY1Qwl/UqTYktSqpv/dq7CI/SKqI6+gLLLwWQB5pncjg= 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:42 +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:07 +0530 Message-Id: <20171219122510.15004-3-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: b53781af-3d5d-439a-bbec-08d546dba0e3 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:9MBbwmYCzuCAJxdJuuRMwFCmm5UQamUztqohzynJeUEBrtAsR/MK+NC9CPRb09fWd1t7/CoPYympEfarW8fBHWUYCVHp7OsqoggsfXGbAiIe2nvuIVaQ3ljhxDiF1mWdUWSmqVPbgJAE6hsk36LhwPwSpp1MU59/ozK2P4JKzyl78Xn2Mh2dNH50pw2qAsPF7uv8FG3jTsLuFD/EKbnskLM7GbixVZX3F8Qk7ReW5tMzvDkq670yIFJdiR3gpMJk; 25:VAAaJ4ePLN2Tu88JVmrNg4cIOK4TbRRqnrNiObzBfJbaPQ0EkR5eVMTSTATqb8HohBIUFhhanhnrCrZM6dJIS/M+sTmFB2wYOXNeA6gFkJiF9hfgFfLghriT96UE4HgktZzpK2o+ghK5eyAHXlMIAboCkumHJw8vpQO/mrPheyWYi993q7M0agLsOWn5rLpCy1SqxdyCzEbcIFSX3KuPv9y3u9w3pGE/ziS6Nri3oP19eOslUmzg7U1DVXrMhtfZHWPWLSA/mEJkD14Vabha95ZvvKBQxZwPdUKPmCEILNueiPO5LievITi4eMkNlHgzHqsztnc7TkxhBjrc5Dx+aA==; 31:yI7PetfhgAydz0da1jgaFtdwgRzNx6/LQNDy+UlHkk9e1MgksbFh4FJQdk4mCNxQuy2b2KNKD3Nhm02F2546TNkV6cuy75GmTbbwL8p0MsBKMcIqYQ7qbxuBYhrTr/ZC/o4MSFI4m1LXRHLJ6PgfQw4ft6yDEEY8JoZMswxMq5T0eVASf1j5g3KeZwxc5I9xx5o3kB5IrV3VlAdOKY1dJl6XudhFgrmVU8vL4LKhTXY= X-MS-TrafficTypeDiagnostic: CY4PR07MB3462: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 20:26KtArggs+tb0mSvIfqVXxt9rXhymXJRSD7PkuG8823c4Klvoi7hyaQKPBsukYdfe4xIkAnJKjRYaeheeUNaMO4Q6QwtvA9Zst5CuwDsYpCpW/TVJPmNcvrAdPg1uZs0VAeddFknL27y6C6QqduDWBlLquM9vQFCl3YK3Pi5iJnffmVc+P0Mx5ZVJ02YUm0jr8jo44iaIGjO2w0SFmAskRdl+Yf0xOK2kOa903Pq2yNid/MEC12kbLzAMGcmDehJoRFTFNw/wpaRv9Lhua5ltsOkGuta7gRDRX4343PwwTeHcvBM5Wv3bAJOQ1UHwlKtYGWsIN5nru/sNZft/CwIcvNaVF47Wv++A4984frqTiGYsIcq1EHgkjOZvcBrrUC28bmEa76etUGS5+RF+RIdWf7rRXt0v2eUls5+FNdB6uCE/dRt5TzscJeeR6yLC1yf7biBqGo0HnxvwZk5hcyxfLrKNd8GiyQHbcejoOXPBEErbhOY2hArMZF7RbNcpSVJWjW/usYbh9Hj/2Lb2OaiyFxILs0UPAbMs2IkWJOmaiJT91QMcGCdlPcx/jJkTPx/j8uLjCloonYpeTrqoeW4DcckY8lke5MX2zJV0xdJDy4=; 4:eeJzcVCexitHJoM75ZoJVfn1j3QseiGCUtFmpFi+zCaa3UmKV6rQRq2XMyO2bdbdukzjP3JRWnFN9KgmyQp/dw/3Vt2EuLKD2iNJntYl1tMbTTDuSoRxhbsbDga5Matp9PpJ3Mkms289CzQg+bpOG+v5sRoF9Vv38xfFENRAfybU6AaHMtxAsTAlSEb9mXIxNUvTqJhhXlrDHcFFfQ06779W5ZPM1Lt6IL4DYUerwbHpOQETQPj9hIbI8VWhTyo75cvy/B0XH3Mi9FFgHD+/+Q== 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)(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:brXFO9wZDVrZ8AQdvX8klOpzQAppTjKJB+L8YEubH?= =?us-ascii?Q?uErQuOqRrEERWlGCuVh8TLI8w7QbI1r3plPzEfbrierAYOc0Lns4NtEzt0zj?= =?us-ascii?Q?1v+Hv/25bEknSxlbYeutQzds6na18BwDe1frPKvTI6NAWgmaGzv3iYqCxt++?= =?us-ascii?Q?ZcxUmabR7J/r9jblWxXTFj7rFALTlZjRgYwcsY6b0hVL+60rnaHYUa78f7hm?= =?us-ascii?Q?EUYo/KhwhQ9HTpCWol32wGRGeo0HBdCPAdDnblGtnnY0esbTnbP+uO0oTaFj?= =?us-ascii?Q?aMFW+LRBxaeSaQeX4vfmFMgaS4E+SDw9Ma1uWTyCV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t/6hGHfXSXp9E9VBDzAM4U2yzFmf+?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 6:wr8rU1kRcN12ay8JjNsT4E/MV8vf7z4p9LG1mbGd+OgdJKFQiHFzKMqTleMRAarUPWAABDFeNHXMb/Iu3FvztPjUrxzP1qD1HS7xX1EtvBPzJyaUTRsJObUJAWlZLidsB5SQjts2gNHAYV3rXra18EBIT511iFlDyIqz/IGV/eyFF+/QIjOs3C+RX4knLSwqWC355UW40FzU4OS9iyr1L7tWIrJdhD7DM4BW9FW5BzpZM4kbR6z5gLHUJ7HyWj6Lo1PVaiURYPufX3O8cf3LkXj/A2f21h7Hk1k49DWlyY1cxWQ87bI3vjaK40uSwlo5trdmD53irZDCl4oJWonLCTmITiIl5MV8KS+oOeZ6ctQ=; 5:gKbm0IzvHc4QFnIFTPour0aqF7QRaQgDaxlHigI6uqO8Ch9uXRHKmFtejtz2/lVfLFiWjpZGGkT4w7iu42E7AMAbJQA7cg8WqnM5WtEujfRSKdBCDhEhwiorzO4xdd0V3bpbvr7JA71/tf8g0sndIpFNwlEvrJNHLjevUZVB4ig=; 24:PY8XAV1vb9eeb5YTEbkYyWvcmKcZjtcR6bfMmotnCQ2B94FNVrIQGU5OOlxlGH34FKJ/P9DpovqtdO4UPEO18j/FFpMK7fSqIYoan43KLGM=; 7:a5GXiBxq16+cU9PyK/Ruzp2z2zD6vl7v5/LRcyUNpCV2MlNkwI0vHptQWJ6b9JjWBXiY/fC6jSNg5gY9C1AbSq4GtA5ybpY/WClYgO8QpoHQ1fKOfTiJgobunzCIlzn4r4708GOe7eMc6RAKf7gGVcjJdmrUBv6jf91rOvFvBWz4R8PZfdHiYTfSAsoq1Wi8vposR92hbuw0HkeFdiLpkhREeTK0PibzTlxG6KC4KPL4BG5vDe899DSWWFUvT/tc SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 12:25:42.9479 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b53781af-3d5d-439a-bbec-08d546dba0e3 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 2/5] net/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:47 -0000 Signed-off-by: Pavan Nikhilesh --- config/common_base | 5 ---- drivers/net/octeontx/octeontx_ethdev.c | 21 +++++++++++++++++ drivers/net/octeontx/octeontx_logs.h | 42 +++++++++++----------------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/config/common_base b/config/common_base index 65d51d6da..fc6b6d157 100644 --- a/config/common_base +++ b/config/common_base @@ -333,11 +333,6 @@ CONFIG_RTE_LIBRTE_DPAA_PMD=n # Compile burst-oriented Cavium OCTEONTX network PMD driver # CONFIG_RTE_LIBRTE_OCTEONTX_PMD=y -CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_INIT=n -CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_RX=n -CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_TX=n -CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_DRIVER=n -CONFIG_RTE_LIBRTE_OCTEONTX_DEBUG_MBOX=n # # Compile NXP DPAA2 FSL-MC Bus diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index bd24ec330..a5f8451ab 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -65,6 +65,27 @@ enum octeontx_link_speed { OCTEONTX_LINK_SPEED_RESERVE2 }; +int otx_net_logtype_mbox; +int otx_net_logtype_init; +int otx_net_logtype_driver; + +RTE_INIT(otx_net_init_log); +static void +otx_net_init_log(void) +{ + otx_net_logtype_mbox = rte_log_register("pmd.otx.ethdev.mbox"); + if (otx_net_logtype_mbox >= 0) + rte_log_set_level(otx_net_logtype_mbox, RTE_LOG_NOTICE); + + otx_net_logtype_init = rte_log_register("pmd.otx.ethdev.init"); + if (otx_net_logtype_init >= 0) + rte_log_set_level(otx_net_logtype_init, RTE_LOG_NOTICE); + + otx_net_logtype_driver = rte_log_register("pmd.otx.ethdev.driver"); + if (otx_net_logtype_driver >= 0) + rte_log_set_level(otx_net_logtype_driver, RTE_LOG_NOTICE); +} + /* Parse integer from integer argument */ static int parse_integer_arg(const char *key __rte_unused, diff --git a/drivers/net/octeontx/octeontx_logs.h b/drivers/net/octeontx/octeontx_logs.h index d5da73311..533746d69 100644 --- a/drivers/net/octeontx/octeontx_logs.h +++ b/drivers/net/octeontx/octeontx_logs.h @@ -33,44 +33,28 @@ #define __OCTEONTX_LOGS_H__ #define PMD_INIT_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, otx_net_logtype_init, \ + "%s(): " fmt "\n", __func__, ## args) -#ifdef RTE_LIBRTE_OCTEONTX_DEBUG_INIT #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, ">>") -#else -#define PMD_INIT_FUNC_TRACE() do { } while (0) -#endif -#ifdef RTE_LIBRTE_OCTEONTX_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) -#else -#define PMD_RX_LOG(level, fmt, args...) do { } while (0) -#endif - -#ifdef RTE_LIBRTE_OCTEONTX_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) -#else -#define PMD_TX_LOG(level, fmt, args...) do { } while (0) -#endif - -#ifdef RTE_LIBRTE_OCTEONTX_DEBUG_DRIVER #define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) -#else -#define PMD_DRV_LOG(level, fmt, args...) do { } while (0) -#endif + rte_log(RTE_LOG_ ## level, otx_net_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args) -#ifdef RTE_LIBRTE_OCTEONTX_DEBUG_MBOX #define PMD_MBOX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) -#else -#define PMD_MBOX_LOG(level, fmt, args...) do { } while (0) -#endif + rte_log(RTE_LOG_ ## level, otx_net_logtype_mbox, \ + "%s(): " fmt "\n", __func__, ## args) #define octeontx_log_err(s, ...) PMD_INIT_LOG(ERR, s, ##__VA_ARGS__) #define octeontx_log_dbg(s, ...) PMD_DRV_LOG(DEBUG, s, ##__VA_ARGS__) #define octeontx_mbox_log(s, ...) PMD_MBOX_LOG(DEBUG, s, ##__VA_ARGS__) +#define PMD_RX_LOG PMD_DRV_LOG +#define PMD_TX_LOG PMD_DRV_LOG + +extern int otx_net_logtype_init; +extern int otx_net_logtype_driver; +extern int otx_net_logtype_mbox; + #endif /* __OCTEONTX_LOGS_H__*/ -- 2.14.1