From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0059.outbound.protection.outlook.com [104.47.40.59]) by dpdk.org (Postfix) with ESMTP id 85C902B93 for ; Thu, 2 Mar 2017 12:37:53 +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=D9PEnP62LJp1HO5jLJytwtsJKcZhghPO6GIYFsyfBng=; b=d2PLrhYh/xZ3hoVcxqlU3fdQxanJMAz/pFcA6dFzvEZs+lL9OjQgF+bpY8NFsD/XPoCUbGIcBf+pzrW2jyeQC+L/Akb3Ud5YCUcnyMk9fu971o8J+o4uWthrfxKqrkedrYs0/74XF/katZQJmc/Mx1bIMpdlLqd1p+0Pvb/9IOo= 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 CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Thu, 2 Mar 2017 11:37:47 +0000 From: Shijith Thotton To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Thu, 2 Mar 2017 17:02:08 +0530 Message-Id: <1488454371-3342-4-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> <1488454371-3342-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: BM1PR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.163.198.156) To CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) X-MS-Office365-Filtering-Correlation-Id: a2521c44-e5b5-4a11-0bea-08d461608f45 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 3:BUYv4kCI3+Ppkumq+PW0vruuoKDzqC7qx2OxQy6+yeskl1thul3xJcddKDJqY2lOgWxMVTTGcrRMmu7O7Xa+W8Lnlou0H5cPzo7up/2+/D6anpKo1P0II2lA1e8eN3qNyqg8VsdvRgq/+xpOeNjc0zgiaboFvF1f8eJVVHqnYVeyL81RGx47Nuee46nNF/MpgsFizZuBkFYAr/uPG1560oAR27dqVu4yT52i+OFTOOK4RDKSaeU6X+qw3zn9bQdoI82z61jteQefvPMlerIeLQ==; 25:eQG7BGfhgjgg76Jl8pA7Gqf+SVxodsbZd7d4EBWBNACM4+0lG5gErVUVGcLVI1uB3P5SDgc63/gvs4zWclD1Gx+10EK4mY/8vKlTR30NUqGcfqUQ+b6wPFKUDQmcE8znkZV+957MGiYXlUp8UF4bC57IkxgbRuuT1zDj+j/5D9IvAVU/mYPKY1jEwwcIYyj/QvXRJeqleEUT16eigi+QCuEiKNjJxPmZQsdlgwV0B8QORSM6mi8dgTTaqTxXc9M5U+0fYwXwWo2TilpYXTpNE2ub71X/u9D4YBViKsNrvAnYUUfpgI4jk+H/aaOxe4gEw0WymQznbggJ6xq1qbBGkq7yzjpgNmJZTvBhLCzOsHUm6U887gncoV/q13ocgbrx9VceyYN1sgpHy4S7KicG3EuCvyMmqnXhg5aKjmYFJrWQzSvzSyNlaZAPjlSi4u+u0Ci9FMKQsGjLuEakpTpb8g== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 31:vamXTWK8Fv+sToB7UrhJDzJMPGgapGurZwxonXgonvv3NV8ZuDruehdsP20V46ZjJa8tQhNZh9y/rKdjq50LpZUz7X/TMv6JBmUCrgT7Kd6Sxe5VecSscOUVGfZs3Oj2ovXuvgoFwFky689/UU8jJheDekgy5i/aDcVnuM4hssjaJQ35jUZ6WCvVd7Mp11jAO83In96vfKx7Xw9Lt6BGfGVW8daFkglZjdL1HGFmWt3R3ymcenjCEZ9yR3Rjk1Sn; 20:V3B3Kv7ZizENHGF1EV5F/2vHYIfDuwfHKGW/nYY6ExFEydR9Gqm4pmdKJwcKas0/nw4GCIiNJsZvz7ylopX6JUWJWx0Tev+ZCl5o2ALxSUXgT0iDhX9htoxDtlB3d7YJkWpaFXzbLQQLEY4fOhGgPqY2Lul8C/aDOs/Hvw+JReACVeP4TOrYdpBjJGwZhVUwZxJQCv+TcsY1U4IggvYFKwMHtdWfJxytzZsx4JdqDkEEKwn1aEn0o0A2JaDwy+DAtRHwCpm7JBn1lUetzNhtANEHuR/JL08BTYSFtTvSeXXljaO1Gp/NSWVsoHzHNhGZ+lcX6R37cipuJ18tUr+Xq2BaSXTDmvsBQ9dYX7I5Olq2GseSlnqXEwdR1nzt2WmCxruFbuZn16WMHJQwRKcMRRmNcwsO0vk9aq+/xpREZEraXWiDZmqjBUj20CPKx+tcErj4QSLuGyB3MquTgXxy/BndXq0mUX2T0AOZrwpWTC/YPE7P2sum1FzkSkpk+XwDtizw4xG4ySMMb9ScWf3WHd2SbqdWhu86CE/1i1PJWgq4rafsfksf3vu2SOBWg9N/6gQH3hsOfeD82rHCQqoxNZK4luBuTFhqAXRS6Y01M0E= 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)(10201501046)(3002001)(6041248)(20161123558025)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR07MB2277; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 4:yuSszWSMZN9kFn3gb7Zh7J1qS/JJxXpstUE8Ry6ehiSbpg1EQ9itZI4t7xxUJb8uGUP4M9pzRRkpwJFYCWTq5y1WYiCumA9S0ndofy/lRfLqjzr/Gq+7O+T4YEZCJAjQQe2I7IoA/Xi249tZJRCxE4TBMgElUIO4u3xBHWbLJV+KZsdaIveqV4HVpgYOsjj5UVXyyF3fYbW3EoP6t1lCdcDAyKXwVz57faIy6HgpUFWZSB1eqaCflX4rER8RaIfH4PhaLFLw8FbcRKPhy+Ew5eNRjEoqdAO6dOGq5EljOCXSRX5JRrdlzfTZj9w8yzePGNJ3IG+vrnFwPcnRhlWQ0jcdFCgSf10QsO1ZTBuhv1KhYv1E7FcoMgfUY8oc5FtlzR76n7Xh7hOYQy6LEyTifV9eWh62fQK/oX/DmTQ7f1bPRrlcQwGwuK53PuoAAaZEG73fv7ITmG/m9+paMXpydiE9j80A8deEpZ/ybBGVXrlrrmI/9xhNxxs8LYGvcjrfx7b0aUURnSPtacQZAz40iq6RXSIHXGG51YWXtjdzR2RNFIINm4WRgPJ1j1UK7q34rph/3ATeVpVmu+b3yVk3aYjplzt/SLOVBMC/hKOJDlA= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(2950100002)(6916009)(42882006)(5660300001)(92566002)(4720700003)(33646002)(48376002)(50226002)(6666003)(2906002)(5003940100001)(36756003)(8676002)(50466002)(81166006)(110136004)(38730400002)(4326008)(305945005)(2361001)(53936002)(2351001)(25786008)(6512007)(189998001)(54906002)(47776003)(6506006)(6486002)(66066001)(6116002)(3846002)(50986999)(76176999)(5009440100003)(42186005)(7736002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2277; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB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-ascii?Q?h6D1HZqWYT2KODX2LXKS9XK8oKTj71T+S5pzGTdKd9NdCd+IxWLlfu//hWQi?= =?us-ascii?Q?Pt8XicDbZffLosBsbCKFXJOc7lrbHtwPzbSLmnz++V09VExQZkg8jx9G6IS7?= =?us-ascii?Q?tA/OCZF5ByUStm/jQCU6CIrocHNXsmGM116/zRB5Dx53zoQzAGuAgOjgON54?= =?us-ascii?Q?7Ziv0Ifdtlk2+hnVjajeUeL+TuQnlFy4EF7UJ2CdFJXRm6dwA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 6:Hnt7k7gDX9iCE1M4sXIeDhO0RLs707zF3J5qZT9HL447FP1XpGFq+lUuUcW69RluhRvqhh9xwIQz1rfhAumzH/s9fdjz8hiILX2cdc1QLZO6tPWQdfZwN8LGhFTfWlxcZBfn0JJhQ3kSLv28tMz/uf/SyGBLq9almK61u4C+QKUQfiZF2TZx6OO8PDs3e50RthngI+VyqLIqmXUdQr/4Myx4Z+iqDz4rX/A8XfCxhKRIaqGHTnik86Aerf8IE2bm7FhYwdjTF9v7InDX77CIFoQInXSs4pa1BOvTh32PNrop3a4ouQIvaIkkbCVW50fqn5wcvigqaLITplZ6LmVAk3wWEOhgr5UdssKcPgE6IIBhUG3RPPcWw5K0YC9/4MlLoN+mP6gu8Mtyjtq+zcLN7g==; 5:CDwXuazu1V/usob7AybdeZ0CvN1q2PWVQA8DtmyzVSyXRjLxq0ouQqe6U9dwMJWdl/MtRzrA7EiNQHZda9ACg7YbH9wLcf19Yzrv6q7GuZZDOotHJ5YbQUkwzdaC5hnlfwxWI8Vhs0gq5H8VW7mvFA==; 24:S3Fidt+r4IRhzMc6T0cLrvmyLwq2qqAbdy5+zwG9XYP6eDJjmVYVrKOf6hr05xBhswaf48CRFrvQRtX02BV/KXqMu6/6t4pmWM3Z9wuR/yg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 7:f8XqXkV5TwEAt4683b9l4Di5M2VLX6sw14jKw28ZTfhN5NMAvGRz2oDRi8DI0xPxBFZ0/bu/g4OtaCmfnHAPKruz0hDxB1WgnbXJLliAQCtsVoV1HKHFDjeHxSbD2n7NRwXN1tIUly3lDleDqlfSed5DuukAks85RgXLo7nSM03mgyywA5Facj8lK187PFw1930hpO0eb983P4dmE6kzCK/+Wu7chlpmjWu8ZVCFR4MXhUq5OD6leVsObdZnpoDICi+GPwWLqE9p7s8LYXoejENYNHcntNTdV98fav8C77Vq1ffRev3atGq8On2Mr5crhCPPn+EVVCaVFizUvOJ+6A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 11:37:47.1065 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2277 Subject: [dpdk-dev] [PATCH v2 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: Thu, 02 Mar 2017 11:37:54 -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 23afaea..109dd4d 100644 --- a/config/common_base +++ b/config/common_base @@ -290,6 +290,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 burst-oriented VIRTIO PMD driver 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