From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] vhost: Fix compilation issue Date: Tue, 12 May 2015 11:23:47 +0200 Message-ID: <2042841.HJ0llvHanu@xps13> References: <1430723719-27999-1-git-send-email-changchun.ouyang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Ouyang Changchun , huawei.xie@intel.com Return-path: Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id BC8FF2A07 for ; Tue, 12 May 2015 11:24:29 +0200 (CEST) Received: by wgic8 with SMTP id c8so1779865wgi.1 for ; Tue, 12 May 2015 02:24:29 -0700 (PDT) In-Reply-To: <1430723719-27999-1-git-send-email-changchun.ouyang@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > Minor fix for the referring of a pointer when debug and dump is enabled. > The original commit is: 72ec8d77 > > Signed-off-by: Changchun Ouyang Applied, thanks This bug was not seen before because it was disabled: examples/vhost/main.h: //#define DEBUG That's why we must avoid putting some code in #if blocks. Please use log levels when possible. If you absolutely want a compile-time option (other than CONFIG_RTE_LOG_LEVEL), please put it in the config file instead of commenting a #define in a header file. In this case, it should be handled only with CONFIG_RTE_LOG_LEVEL. I think we can assume the debug level will have an impact on datapath performance. And maybe we should raise the default log level to RTE_LOG_NOTICE. Last comment about logs in vhost example: CONFIG_RTE_LOG_LEVEL should be used to define the macro PRINT_PACKET. In case of debug level at compile-time, it should call a function checking the runtime log level as in rte_vlog(). Please, let's avoid defining entirely a function in a macro, it's ugly. Thanks