From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0083.outbound.protection.outlook.com [104.47.32.83]) by dpdk.org (Postfix) with ESMTP id 06CA1AB08 for ; Tue, 21 Feb 2017 10:28:17 +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=ZSRl7UKzUZhNb3IlN5aHPxI8m1zLD/8cyy90qfYD0CY=; b=nLWkWmrCulx4eMs2WmmEFMrPuxAkVZDWJOEo9DjR3gdOPerS6boSKIY56ht/ZvPfMfwp3WP2G1I4jFYQal+0h4iMEsXSV5otdRvstFcmeRy+EKZQIc27/6sfdBrGUM1Cf8GTdnx3B8ECbOx3L1uiT+sjdjKO240DTEifo2K//VQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shijith.Thotton@cavium.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Tue, 21 Feb 2017 09:28:13 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:19 +0530 Message-Id: <1487669225-30091-5-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-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: MA1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (10.174.56.29) To SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) X-MS-Office365-Filtering-Correlation-Id: bcb88a6e-a16e-4038-3850-08d45a3bf72d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:Tt8kF057BfDL/3AQjYKfwK/HTWEN2MyfBjc1yBWwxyclkvC3QjPQHaizPJXdcBH3bewEWcUAvURHnmcKRH9HVtTho+FdZGq/cVuompv52tZ7bfYleCoGDN6cVhtyjH9NQJtcoGXs7BsHCJlfOYL673hZLfuUrR+zseuw62Oin4ZuEtV1ggA0VQWlL+Ho7MI6GNsnBgrt6RNZHZXKaiDXcx0opWfir06WgDuAJoADqgsiRQGlnocolhkDeWlM3iBsB+zakxXwbF4DRE2tNMOkSQ==; 25:799SUWv1CT4Cx8NxyJD5MRz0P33fYHpCCKi/imk7QZDWlRnAJghioxvLjuFuNJg2C1D6X2oBIpPcUq1NJzX1S3KSQYBETTmQu4GSojvZPLjTQHeEPXjLhNz0DOVKL2NLqAdannHWlPuFS5nFNbVdsZmnBorUZWwIeccQaAfpeYGpOXpMDlbqbiqsEnxmKOj/Ygd/vYhRWjl9DKBbGb1MWglIbgTrZy5Wflq2FwqZ5nb5tSm2QJpMe3Qi9sm4SbE0aQOFbwloZt1HsM2kz+M/ZC2kXot4wtn7uEzBg1AqdyBURu2TrWkF0bLCOqFI9hQquJUce9HptiOkgJ+oxfeTULSIan+qChaVy2vJwgMgHYGo/KN8kPJNbVEDP2/IRs3cSohbAYSx2VyZyuXClN4pGIxJKY36TYfFD0jW2gZAHDeagxIty4ZME98UQQ6tKHcq3NIXCB4/4aGs/vksZkIxUQ== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:lUnwwSw/SdKyVLmC65aHz2qGrkzKC5WFPmEreLgoSrvUvBwtSLiPxbWX3QbfWmr3Nq9hZ5HEhIdF9HV+sFcBsRFiEJfy2pxp9aeBOjW0NaNyT9/VcKBWm17sI92EfE1JvV0Y4Q5jgiPVz2wLTH+JOzGWPK6fjKjofe8RqXEQr7dfzhUJA1coUiuDkAhIxZ6avXnDF5wxckqGtrfuM1aO/3JdP9iu/Ng9MbLpir5XnHQ=; 20:ZuyFnjeIWcjx81B7nqUXZW7kxnZfh81ntnLpNOYfHF5G2I7g3HOvPoWfD1AjY0e8NVvqVedv6ml+RmyFykA2wRyYbpNalWM28w/oa67P9gcsycLMqgWtirCAllo+OJ5F08BBw670sY/d7l/hUnBhh4PNG97nrP119dEu7JUh3Dsnobx81wg2uiQuzMT43yvKYyvc6NQhOiaek3y4RbTKzr3yA54AjI6hxyOUJLvPWRhlYp+MJRjrVZhIWGjEmA3Ipc1m9l/Dj7+8SJCicRgsXStr4GL1nLWa6AXy2DziKP7ICVwBdG9xprzqU8F3GmXIj6XGcsUSMR2cgJM2+8crKYZT8NazfmAHgSdstpxY6fw1ABk8mvOcTsAXl+vVVzStbNa1tu+nugNijNGf4HptNLh0lP55cPNJIsvR7kZ4ghWz4hoR74i0fmqFl7cxPwPUr/8QWaCJ6+iNzf/3OLjHdjfv7xGVpDijELRzti/hryTbA3I3qCessDFipqM9VpLr//r1gbnCE7XqL/ONYcrPolpjx5abQ+KpwmwDzVWbR+o1jbQkl5gbk5N7cG1n94p4/PGKmmVu8pOtZH7vO82FNYFhhw/u7CVLplGsbPP6IQs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558025)(6072148); SRVR:SN1PR07MB2285; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 4:SWg30uLzpvxp1HB/awTHMTjVk29yzAvecHuJ4ppyVJEoCziYDq6pnoP0K0D4RExuH4mCf2u1Ap4+L12ONXvJJC3NTtSIQX/LJblqhTybcI6QHW/a4xx835qBxXuFb7qXeyl2zjiXB6SZz+IhFBEFPxAiGbrJcv7IzeHAA4/phcKf4hRS32Uvct63jhgwRN7iPjZVOqtw268F03b0JDG4mMH+bnnfghDqv8Jr5ZF038cfGsARp2/0hPZKoJji4+rxtXc1XHU01L6Z/+1PKpJSRS1icl5xDcZ/wsWA2MPmA/28fp1XbntLFRB4k3qTb/NSbNiL6Whv/7GzYB0IOi0aCn64M7p5mNardhmik7UmJnVdUyezHmIOADbRVNPpfA4x6HVvzQ7ArjjVKE7334xKzMvxUvTEYoOWl3bEkitx6G0w+YLbmI4OV+E9r8CDyGoSN45rHB4nX2jEus1yxmrZ60hnJ7JpabCckiYmk0+Ur9W1SRkWrh7UIGJ3ktF6cMni5RXDs3dcn7NFok1/2qoaUU0k/l8Sovov2nuO2ufATwF4pVw3OTxZyMLiV49EKdVg68DSJ9jJeeVR6Lyc2j1G35J9ZwMM6lVMs7Aw2D34OC4= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(101416001)(81156014)(305945005)(3846002)(6116002)(5009440100003)(8676002)(105586002)(7736002)(53936002)(36756003)(110136004)(106356001)(6506006)(25786008)(38730400002)(2351001)(92566002)(48376002)(6486002)(97736004)(50466002)(5003940100001)(189998001)(68736007)(2906002)(4326007)(33646002)(76176999)(54906002)(5660300001)(6916009)(50986999)(2950100002)(6512007)(4720700003)(42882006)(66066001)(47776003)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2285; H:lio357.in.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; SN1PR07MB2285; 23:kDNx7n3Pym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ZfSym81n9IfJpMjOO0vXX/TaNVY9g4lCscqu1MbeltzDR8qdxpcm8/oHx7UiQ==; 24:LDfblC23wg86nP1IzDwRgJt8eEmcgulvzaSA5/4D8C45rQMnjHHGg45er6WRGabw/sjCWUoYNrgbmzp5MFzu7fBL+R86pJGKEHs+hJGvAk0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:bPp/vl8htZEQ108zWLl2p26mSuYoYMF5KnAaZjcfxG7BrpZiu0AvmssqbY3lnhfc5EtFbDq3XKvWjODwOzRzkm2ch9/KMK3BApNGV88l2gCMXp4zu8ExDihUVV//VdU7DDfC7qUeYZl9eOWL9sG5tZ/n6n6kUmmQbTyxuAv30qjzNbUmVPxaNfOa1/cjCcdwMnc1y4yqiCshVY1Yv6BWIjzwfJJI29zkW6p1q/zX2oSqqDS8dWzlF4jnCRhT/UAhKOq+NNindE9tLYUnIg1wEzNhtNySktU5DeK7Q5YeDsgcoU8d5/Bpj2+W+ChXdC5E7u7MarfeV2TqfmDoRbZ4fA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:28:13.3681 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 04/50] 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: Tue, 21 Feb 2017 09:28:18 -0000 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: Mallesham Jatharakonda --- drivers/net/liquidio/lio_logs.h | 91 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 drivers/net/liquidio/lio_logs.h 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