From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0052.outbound.protection.outlook.com [104.47.36.52]) by dpdk.org (Postfix) with ESMTP id EB5C3D40E for ; Sat, 25 Mar 2017 07:27:03 +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=5PiNe1UUdTKJ63Mjj8anll6prtrClJp09OzOo9et3ZA=; b=FeHUbRC/l1GsiznOj8tbRdRk21LfwDBsOLmvZg8SPzr8iOTx38bnNIQe8nHJnfEw1d+EP5Y1coM3Go2m0It9b41PPiw6goUeJBl0kXAHSN6sEEKvIB7XJmW8jGSXfJPWB/3LqG99X1zkVHWoJAfmlR08GV5Mkkx0clBgTa8mWWI= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 06:26:57 +0000 From: Shijith Thotton To: Ferruh Yigit Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Sat, 25 Mar 2017 11:54:14 +0530 Message-Id: <1490423097-6797-4-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) X-MS-Office365-Filtering-Correlation-Id: 01db97e3-5601-4e87-5a6e-08d47347f1fd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:RtJ37+zRuJCuvBUo6zPUe9SmUbFhzRhfJR0C8C2WbEhRcFhMM8y3rVEyFPwpSPdl7ksYOFw1U8UOrw/56kltO7pEs6rGxriLOFuE9Pq3tgkTXp2rU2lmC6/ndo60bz9PU5OcxTiEPysXsSMVaSpe9kS3rxJycqJdU0jgCSgIgNrTOzXqoh3x0XziQN1dUwp0dupXe36qXOfZCOYcRnrpHVMbCRIJmgpKeXqGp5VwPbeoRmPUC6oxI92ilooJV5ufcjvkjeoeFWn2QNF6BiGP5g==; 25:kbipSGHYHKLYzwVMOv7OHl2zo+fIIYJs4XEfv27zInTlH7oDELK9pXquJfWZPcA7J2GYHFa8emSNfjRBbaez1T3Ytw4mqx19n6DKoutV1cNxIBSzWWPGHpAsErvh7nw4ZOKTLXdNnrOuZs37YohwRbLqIqiApURXN1zNBDBdHzlvfT+azu2RbkFXedXNolHnXQpnG9oab8gj89oj68dqN0HWlfDIN1YZlJk2pzBEJb/EBWGIU6hVAP3j9/ShWIiwLp4n5URhb1gXoiQmdngTRqJxq9+8U2yEAvgSTMdOLUlOa529iR9SMouCXV9cqrGa3NlDjW4eCjrYGbw5JCKQQAqM56oCdaexHBt5djvYSIH/EwutJzlfQLh7XJoY4n2b35bQFXammpVmFfl4pskDjumq21W2L5sV7UaZRSdl0MBH++7iuNi4WNr8EvbZ1FuZlckP5LEyJnnda02jQ7BwhQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:SPICVFH5z3qL4wUlAHvqzlPwkhpoMJoXULhqRCiOr09kZU7hEqNzXdBvdOqnflgywqp0r7qlwATXmIipcTdpO7yM4AyAO/TCvPodcEvCzDUeNdiysEGwdPTHkL5A7rmo47A7EYhDOwsRwV7HuYx1zBbgwJl9Mkpgk/sLIJlw7S3XX8FmHWY7wPALprgO0GJ6etR9TYpbe+Zih6D4FTCoPu876aCxRmgTTA/Ai01oq3o=; 20:LIyo1AXoqxtAle9YBgU/4OEUUb9RMfqkYglbQ4VjOxvcZ4MKXTuWch+eJbc5vqq2U7lm5MTS6FrA6lZ2djcbjPtO0xFe4+bRFEGzvRJgfLEw2HL/OEYHc0edOECdNgU7z6Pi04vGKzPs/03IfcYwTz3UbBHualMH7t9A4M5pP0iq0SPfFbBYEdzEb4TAuE2sMSxe8Whjk5wMDdPdletm56eIEOfnppx7ezizJE2Gbv5oyLtkvufKhsHHyDfH4pnDibY4CEgVdlBRwZcuTGIs0tp5wqhuFbkg8vV77V5x6h8PGYwq0/TdB+sjXd+1Kj6iTZdx0SVCIGaGSH91nuLo+2Y/wCFu3zOVgITC8Nro3ZvRKVR+Ohvg8h5N7C38f7HWo10Dq4Zgbnq1ngXooYM2zm0aegTKRqILVhVVdCykYSnRZbyrhNaWbeBCKC/3sIsWqjQYzWt5i9beXQxNkW2gmLU38JTO8Bhirrvf6sHqVS2pqVTruJyaai1llxeSNNCqBNgTGeZHaDSDKCoUNFvuIUr8AnCS/z+KsKZCPcEsYrPbdD/KMYKDO4eY4smcb8QWO2gaLKnyc4/q5r+Mk6rTFEHn0iKBRspvX0nGEFN094w= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR07MB2280; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 4:D4SnxB6VpSX90QXjxJ2t2171F99SHUsG+cydvKqTYF/RxRTYA32cJfov9oExZfjkuOr+hd9AX+EiEP3EvcqOTDZ7mbbp4CrfLPPuMOMKivvgVIYHz6tXxYR3wBIM6WNhnFEMhYV87yj0iTmXNw9orOGmgZNKYBIRtmHikcqyJGJa0e9y4o5MZBr6GEMMjbxoyKnncrJMagmFR3tmt9idFn7pOsJxXkO/2way/WZ0P+7k11Z+Xu/6PNI/tHZEpTuaEsMjtENZvjFxzw4TPT/e4Cheg1buI771jYO91Lw7wn5YfpjyVBBY98W+11HZtmoPd4QY3nJoNqsaDmJy8qm9KaOlCU01BTeRTNvWYTQw7kDVRNEDJG/+4jISaQVq0HVpR7dmxEzj4iW+l1JgWpUpUaieIbW2T/zo3hjgrB8bI7dVZrSCHCHYkiPa3OnUH1+rYN6Dz/jbuLx2d5AhhJnq4/P4iZW3FqiXVnMzwbwUE+I/xuxLDrAu2Ml2AxQrFTjDKKmwlWnLWLVnyFSjFjhLFeiykI2XvW2feFJQCuLyvXghljL/EU2msVFO3sc90KRGmiSYOOPm9SzvC2vKCf7tUKgTcvcq7jxpH5piH9hfEZg= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(6666003)(25786009)(305945005)(81166006)(7736002)(6116002)(3846002)(4326008)(8676002)(6506006)(189998001)(36756003)(50986999)(76176999)(33646002)(4720700003)(5660300001)(110136004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2280; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2280; 23:qoGgIEH4urkOcH3d7XV54l3uorgJPqyCcu1OY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CyiLOqywG5aRXZ6VMXKRPnSOmw/Wdf7xatsp?= =?us-ascii?Q?ho3x3WZ/gCwQyhtrPIlVpsn2piuULG+FC1rQlWVfgygvBxFZGbG4n7aFZUaB?= =?us-ascii?Q?69kVDUOMb31LSrh1l0ERxoMka8FZzPghX03XjbSZAleCfKpSrCbbQbPgvjan?= =?us-ascii?Q?CzDbpx3ZcuhXYNqV6I2HUh9fB0J?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:MzQmi7KwM0SF3eF6tTS73hy3Qbyw09GXTm5PnCTlq+v5jO3IEY9pmwXO+D+Kp43nIj8yCZzWLL37kqYtjSBbEfjB434y3L2YPqPM4sXUbo24UMnECyulJ5KoK/L1HD20GBVwMJEOmD8R13AgyR332bZ49xAGI5zI8WgTvGH3bjISmNK1a7SrKaqkGH83U4XyOxmZFVoiML71nLT/Lyy6kkLAl0dtKo3lVmOVYTHPEbiLBBUtO7AgiQqt4iqFZwhaFiorM832xwFs4juwgo0HCrgLBMD41gglSPnjYMFU/w5QwApHl56CtovU6zxv6nXsyunEzZuvSudsk5/o3v50omJDbAFoElvBW7vtapcHCRg2js/3h4aJxT7mY6Sx4MF2rEPDwwjD4ea3qnmqaewxUg==; 5:TW6N2WeFGHh10FYlm6fs9XW6TjdJUSDa/JyGJ+nWIJhIdKoRyilUVDWRnx8s8tRT+ks7/Z36u9n24bJSgaEv+QCrz+1GwQYD+GN1ZWKu6vLD3BgCR9y4tKlplx65sTUITwsoxPekuJSPyGxedJBMxw==; 24:vu5SzPFolVZmcR+j0E+W4GylGOwTdrSwiu6hkE6uvMrzI5Mrh7xJoGbRrc9EHYgdhjVfiL/pA+bvuATT1fuN3wfpVrbwmch5a/Q/g0VQuNY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:ooKnqFS7cqnuSzTD0gZKahH/ibRCuNW+H7tfcEtENW+UBrU7jBQEpf3GA//i+PRJYQ/yj0rRAWaR1kuIpkCDQWBkK3l63wCSeBhkY18s1rVejMHQ3xrptkfayABf8p0p+YOIsjEyDlSb8Q5Ki1ue5Y//HmW9Cqtn0dQ6CQDsddoHzgfH5WIosN7kgeOMMnIpgyUSu3XMWQN8UF9c7bfmLv0A51IZ9dWte02O1eV3mwG17nUSyM9B+IXtjPMw7SVRpyu1XxLtxwxwv7iXjHduYs2h3j1J/zBvNwiC08SBeMjAb2pDBEwbxxth7Ms1Q7EkqkcATJ/PdCaz7wNT4B/ZQA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:26:57.4432 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 03/46] net/liquidio: definitions for log 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: Sat, 25 Mar 2017 06:27:04 -0000 Add debug options to config file. Define macros used for log and make use of config file options to enable them. Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Srisivasubramanian S Signed-off-by: Mallesham Jatharakonda --- config/common_base | 6 +++ drivers/net/liquidio/lio_logs.h | 91 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 drivers/net/liquidio/lio_logs.h diff --git a/config/common_base b/config/common_base index a5463a3..44353e4 100644 --- a/config/common_base +++ b/config/common_base @@ -295,6 +295,12 @@ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=n # Compile burst-oriented Cavium LiquidIO PMD driver # CONFIG_RTE_LIBRTE_LIO_PMD=y +CONFIG_RTE_LIBRTE_LIO_DEBUG_DRIVER=n +CONFIG_RTE_LIBRTE_LIO_DEBUG_INIT=n +CONFIG_RTE_LIBRTE_LIO_DEBUG_RX=n +CONFIG_RTE_LIBRTE_LIO_DEBUG_TX=n +CONFIG_RTE_LIBRTE_LIO_DEBUG_MBOX=n +CONFIG_RTE_LIBRTE_LIO_DEBUG_REGS=n # # Compile Support Libraries for NXP DPAA2 diff --git a/drivers/net/liquidio/lio_logs.h b/drivers/net/liquidio/lio_logs.h new file mode 100644 index 0000000..a4c9ca4 --- /dev/null +++ b/drivers/net/liquidio/lio_logs.h @@ -0,0 +1,91 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Cavium, Inc.. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _LIO_LOGS_H_ +#define _LIO_LOGS_H_ + +#define lio_dev_printf(lio_dev, level, fmt, args...) \ + RTE_LOG(level, PMD, "%s" fmt, (lio_dev)->dev_string, ##args) + +#define lio_dev_info(lio_dev, fmt, args...) \ + lio_dev_printf(lio_dev, INFO, "INFO: " fmt, ##args) + +#define lio_dev_err(lio_dev, fmt, args...) \ + lio_dev_printf(lio_dev, ERR, "ERROR: %s() " fmt, __func__, ##args) + +#define PMD_INIT_LOG(level, fmt, args...) RTE_LOG(level, PMD, fmt, ## args) + +/* Enable these through config options */ + +#ifdef RTE_LIBRTE_LIO_DEBUG_INIT +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, "%s() >>\n", __func__) +#else /* !RTE_LIBRTE_LIO_DEBUG_INIT */ +#define PMD_INIT_FUNC_TRACE() do { } while (0) +#endif /* RTE_LIBRTE_LIO_DEBUG_INIT */ + +#ifdef RTE_LIBRTE_LIO_DEBUG_DRIVER +#define lio_dev_dbg(lio_dev, fmt, args...) \ + lio_dev_printf(lio_dev, DEBUG, "DEBUG: %s() " fmt, __func__, ##args) +#else /* !RTE_LIBRTE_LIO_DEBUG_DRIVER */ +#define lio_dev_dbg(lio_dev, fmt, args...) do { } while (0) +#endif /* RTE_LIBRTE_LIO_DEBUG_DRIVER */ + +#ifdef RTE_LIBRTE_LIO_DEBUG_RX +#define PMD_RX_LOG(lio_dev, level, fmt, args...) \ + lio_dev_printf(lio_dev, level, "RX: %s() " fmt, __func__, ##args) +#else /* !RTE_LIBRTE_LIO_DEBUG_RX */ +#define PMD_RX_LOG(lio_dev, level, fmt, args...) do { } while (0) +#endif /* RTE_LIBRTE_LIO_DEBUG_RX */ + +#ifdef RTE_LIBRTE_LIO_DEBUG_TX +#define PMD_TX_LOG(lio_dev, level, fmt, args...) \ + lio_dev_printf(lio_dev, level, "TX: %s() " fmt, __func__, ##args) +#else /* !RTE_LIBRTE_LIO_DEBUG_TX */ +#define PMD_TX_LOG(lio_dev, level, fmt, args...) do { } while (0) +#endif /* RTE_LIBRTE_LIO_DEBUG_TX */ + +#ifdef RTE_LIBRTE_LIO_DEBUG_MBOX +#define PMD_MBOX_LOG(lio_dev, level, fmt, args...) \ + lio_dev_printf(lio_dev, level, "MBOX: %s() " fmt, __func__, ##args) +#else /* !RTE_LIBRTE_LIO_DEBUG_MBOX */ +#define PMD_MBOX_LOG(level, fmt, args...) do { } while (0) +#endif /* RTE_LIBRTE_LIO_DEBUG_MBOX */ + +#ifdef RTE_LIBRTE_LIO_DEBUG_REGS +#define PMD_REGS_LOG(lio_dev, fmt, args...) \ + lio_dev_printf(lio_dev, DEBUG, "REGS: " fmt, ##args) +#else /* !RTE_LIBRTE_LIO_DEBUG_REGS */ +#define PMD_REGS_LOG(level, fmt, args...) do { } while (0) +#endif /* RTE_LIBRTE_LIO_DEBUG_REGS */ + +#endif /* _LIO_LOGS_H_ */ -- 1.8.3.1