From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0071.outbound.protection.outlook.com [104.47.33.71]) by dpdk.org (Postfix) with ESMTP id F34597CEF for ; Tue, 19 Dec 2017 13:25:43 +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=zRTpyKoJHhMv+BYU0x+XFlULHv2Ln64RoXMYlkXLEf0=; b=SKyzFh03EIIzCDYQh2uOvMnn/4dBz+MiHULl/rQPKqsLpSwGYUyK+y6JCPsruFzOBj1Deu0jvD4VDWQGMceF6GgBTVCY/Gs46aVOKOvhfblb5vgWEOJCn1wlzKhme82fn1E7w8ACsnS3aRe5nTAu6pRvLj1gDqeDNy3GfnTM0HE= 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:39 +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:06 +0530 Message-Id: <20171219122510.15004-2-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: 3af7129f-7126-45b4-2007-08d546db9f02 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:QSH/UmH7ASus5L4ZQK9+zjYK/23LND+0V2QYcXfPdF3XFm8Caj/GByUbVF5JfD5n/5wrB+UrnUpMMgh+br7GGjR2CKniaDK6gz0FPTSEj+MVLk+f6SjalVN8JQRdyYpq5LxnE8HkrGAU3IOoxqe+WNUWQvaopI1KsjsNNoW/12yIV3qu0qeZDMcaVN1uxKtXdjW8Uk3VtcFIOPuekRDNA775+Bz/clQzbeeNL8CJpToqEmWfyWnTcDp7T9aC/sMh; 25:BQJ5/IleU/cC4PpWXxsqxoySUv2WlevG0zcHgEK9HhVAMGNGO7w5MoZYsKE7zkqoencGZadhqal5MiMnHx/1vmYjemb82oTuJ68dq5+VXxG041sQwnCNIy4YrPVIy+s889VOr4vptOXnKGHOP5JCt6chTVvVqx8lYzQfMeROSjRu811tJYwVKszAnJln7fxsXfFfyN+ISSdQyjKbuxxAB457QJOYWBLuETiWUZtw86w9xLf7UiX/Iy5QtD+MkUQeEcsk4mUTqciB8MNh6zOx9FBWtOstwlI735mEKNJuMVWKg6z+8DhXwwdS61eg+Jkbkyo44T4aGEbq3HzgAKkidA==; 31:RtY0bjesYf0bzllH9Z151cflAcR7JeO0ZOXT4hMD/6n3JGFwSK6LD2lVCw7Bwr9BiKYEFuJj92rQjMmh7wwTFOnnY1p+p81tJWYOTqK8ieZqFs2R+DiHXT/WwhBHsH86g44PKlZ2zmIhnf2EFhcq/XG/cKqKokg6SQBeO8HcsKq5hBkrCgfZEHPraKFCLBwl6h+D3wAY+QZ+/RJqS5vRatZr+yqG++jXWknEtugVKWE= X-MS-TrafficTypeDiagnostic: CY4PR07MB3462: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 20:aCCVpV+lj5muiyXJCQc81i7ewGehcLITQnln97XifkUaNWPVIDxktQkgOuO0bGtSkTMlTKuvZMpH5Q/zhtyTfmX6+Q6LL20ZPTvbZwELzuwztO/i3hDKsVqsclOXEy5AvpG+C4qFRjd8hkrQSx0DZKbd+E6g2JUg36TCt7R3BxIcHjH1iQVzxjWNyPqdtP4O61NBPZkZTxlmJgkUVp1NYQyRLNigor6JuzlvP9iWfHDHmtLIz1ex0NmSEWTqmgKyrtGbqVlzHzQue0YpRJLot90YUeI0w6o1ocBDVSmMYpZxefJw9zctPk2m2nPBMquqLkiKECioJGt/he52XUW93TSv1H7ZQ4S0m7jY2cqmt/KOS2Sd99dvpblSLS+Rmp+IGyqupeGwo8085gFXaNtv5gVPz5T3gy57SLRjgp5ah4Gf9N4U2Qg8RnHmACCfDVl+LtPgJfzHd1qcHPsKIuqnYJ1m3SvZj+OnXsG0XAlvXM/wB2LNv2IDhLhzU2d5/puU2R9OrqJN1Sl418HV0RtBvc/dd+Y5lm0kDguhPjjWQm1ONUzKvGWYrV/QC3PO4cWCEk+ujQc0ZCdE9/vn/lNCu1dNepSGQ667lD/5reUileE=; 4:Du4PH8uZxNyKM9YTdjcCGNAa10Eg2f0KcaLW3m3ZGcbguNOQWZTxoWFUDqWHM28FUtdCN+rBKsuGPEmW7aWgVE3XJf4uQXR5qsHBF1MV8k95KoQMLFAdp5cj/KPudJXP8QCF0Ur0rMpOzuh1Tji6v/F2MCVvRLkmg4rk3pUBg1nGtMXRMvNsGhSFq+bec5XHonW99ZTT2mi6hiPHVPM8YagHHQBkf5mOX+HH+Z99NjIsV9D0Ui5x+VLZR9s5rLrcDQDjU+ZQvFxOgr5iozBBqQ== 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:l/SL5YiGKSU4pGV0qgPa5/B1DOQJ9vLgnWNKTyvX+?= =?us-ascii?Q?2tfgqWIpLffeP6Bkr9eUZN5aiiEFT/hQ5URZG10p5tbssqUSLRh20aQkLIDS?= =?us-ascii?Q?DL43px87B2a9SqRpazxbGDwjVzzqGExRVz9LUT/roMcvKPfC2fsPOoa79mL1?= =?us-ascii?Q?Bbb5HeUiaWYwfSKRZcKVXAyh6oll6wy6mqQ0pr00d5ByzO24X95q1GFpaxLd?= =?us-ascii?Q?cP8UzVwFROqHHNVgaWv6E93q41fq9KhNreUYTezomTbEqnZVvJRA5gZPeOzq?= =?us-ascii?Q?SYBOGQu/VmI24OvTbaiU6O81fiSzJpkO7tIB9z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eoIBFvCPLLT2lidGsoJC7QANO?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 6:blepNROJdeehfaQHgCEO0lSRU715lKKsk8l706C5S3Ck5yaYYQEiPO145Y0pstzO8gz5iL0hwgTkPS9qFMZPb0/91ISNVvqNnJJzaEDyM6strLmmrybqMtvtWtCjEOmZJlmCWTHjWpIX9jBZF6lGQ4w50s9aQ1z4BKmUIZMKZGBP5F4I7OPs07QpGHh/Bj7W1DBrvuS2XIMX3TMz21TElIHuPa/5PbHeBw7zyj/iiG4W+CxOi1BOnLVzMOkSH2sOE8YvgTDoyuOyenDlsyoQMDJydS8SvxkUSE0llBWY06mqBbIxD9xkyGElO/vzypLj0quWgazN4XQtCakywIulessB60VR/LPGvZ8yZ9huXHY=; 5:bMPkIpUJN5UGzbkUlBBMlrQXUTwaXoRIZKmXQBuZZcQxnsmk5kUB4wwbkae/WeU+WTq/tH3FMqsk094X+qeBM1A+MJSr2kyFZfaLX94yHtz3MUMqL9WTubtebRsqdPi2ujkCLGpxolKptoU1qPXvWo5ZdZ8MXzBueoDLvzOwqoE=; 24:/1E9idro5PtHwdMmfk6GKk29PlRM/hAEZQpjVflyejqNzOVg2lL1CjPMb+rLOI7XgFaCx7dAG8bf9S3zDxVzJX+NGwHeANbRBv06aSc4JZQ=; 7:Agxlc90xf50ihXGMo626eLyTweUQt9YyO4U1Ex34uQ+HYTkHOYeqsw2ymq61bwiEZHEcQQGKkqimzmobCOFeZkz7FwzMFmygOxYvTYUEE/pY5mpNy0p7PkCp1Fh6mGTXaS7BHZbk3gJey+BXJhTtXtkDAzD8A/EXqcS86dE75+fR4eH8Q9Ej6cO0lbVa8ZWixDtrN131uT0mQFVy4Ax0+TXSzSN4bwLbrq1b8CMJUDGGd3yTuMCq8FtjgNryUJPB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 12:25:39.8073 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3af7129f-7126-45b4-2007-08d546db9f02 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 1/5] net/thunderx: 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:44 -0000 Signed-off-by: Pavan Nikhilesh --- config/common_base | 3 --- drivers/net/thunderx/nicvf_ethdev.c | 21 ++++++++++++++++++ drivers/net/thunderx/nicvf_logs.h | 43 ++++++++++++++----------------------- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/config/common_base b/config/common_base index e74febef4..65d51d6da 100644 --- a/config/common_base +++ b/config/common_base @@ -310,11 +310,8 @@ CONFIG_RTE_LIBRTE_PMD_SZEDATA2_AS=0 # Compile burst-oriented Cavium Thunderx NICVF PMD driver # CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD=y -CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_INIT=n CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX=n CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX=n -CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_DRIVER=n -CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=n # # Compile burst-oriented Cavium LiquidIO PMD driver diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index d65d3cee7..9756b29d5 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -71,11 +71,32 @@ #include "nicvf_svf.h" #include "nicvf_logs.h" +int nicvf_logtype_mbox; +int nicvf_logtype_init; +int nicvf_logtype_driver; + static void nicvf_dev_stop(struct rte_eth_dev *dev); static void nicvf_dev_stop_cleanup(struct rte_eth_dev *dev, bool cleanup); static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic, bool cleanup); +RTE_INIT(nicvf_init_log); +static void +nicvf_init_log(void) +{ + nicvf_logtype_mbox = rte_log_register("pmd.nicvf.mbox"); + if (nicvf_logtype_mbox >= 0) + rte_log_set_level(nicvf_logtype_mbox, RTE_LOG_NOTICE); + + nicvf_logtype_init = rte_log_register("pmd.nicvf.init"); + if (nicvf_logtype_init >= 0) + rte_log_set_level(nicvf_logtype_init, RTE_LOG_NOTICE); + + nicvf_logtype_driver = rte_log_register("pmd.nicvf.driver"); + if (nicvf_logtype_driver >= 0) + rte_log_set_level(nicvf_logtype_driver, RTE_LOG_NOTICE); +} + static inline int nicvf_atomic_write_link_status(struct rte_eth_dev *dev, struct rte_eth_link *link) diff --git a/drivers/net/thunderx/nicvf_logs.h b/drivers/net/thunderx/nicvf_logs.h index a76d1987e..aca67ebff 100644 --- a/drivers/net/thunderx/nicvf_logs.h +++ b/drivers/net/thunderx/nicvf_logs.h @@ -35,49 +35,38 @@ #include -#define PMD_INIT_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) - -#ifdef RTE_LIBRTE_THUNDERX_NICVF_DEBUG_INIT -#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, ">>") -#else -#define PMD_INIT_FUNC_TRACE() do { } while (0) -#endif - #ifdef RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX -#define PMD_RX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) #define NICVF_RX_ASSERT(x) assert(x) #else -#define PMD_RX_LOG(level, fmt, args...) do { } while (0) #define NICVF_RX_ASSERT(x) do { } while (0) #endif #ifdef RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX -#define PMD_TX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) #define NICVF_TX_ASSERT(x) assert(x) #else -#define PMD_TX_LOG(level, fmt, args...) do { } while (0) #define NICVF_TX_ASSERT(x) do { } while (0) #endif -#ifdef RTE_LIBRTE_THUNDERX_NICVF_DEBUG_DRIVER +#define PMD_INIT_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, nicvf_logtype_init, \ + "%s(): " fmt "\n", __func__, ## args) +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, ">>") + #define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, nicvf_logtype_driver, \ + "%s(): " fmt "\n", __func__, ## args) #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>") -#else -#define PMD_DRV_LOG(level, fmt, args...) do { } while (0) -#define PMD_DRV_FUNC_TRACE() do { } while (0) -#endif -#ifdef RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX #define PMD_MBOX_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, nicvf_logtype_mbox, \ + "%s(): " fmt "\n", __func__, ## args) #define PMD_MBOX_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>") -#else -#define PMD_MBOX_LOG(level, fmt, args...) do { } while (0) -#define PMD_MBOX_FUNC_TRACE() do { } while (0) -#endif + +#define PMD_RX_LOG PMD_DRV_LOG +#define PMD_TX_LOG PMD_DRV_LOG + +extern int nicvf_logtype_init; +extern int nicvf_logtype_driver; +extern int nicvf_logtype_mbox; #endif /* __THUNDERX_NICVF_LOGS__ */ -- 2.14.1