DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: Fix compilation issue
@ 2015-05-04  7:15 Ouyang Changchun
  2015-05-12  9:23 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Ouyang Changchun @ 2015-05-04  7:15 UTC (permalink / raw)
  To: 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 <changchun.ouyang@intel.com>
---
 examples/vhost/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 195d82f..8cec7c2 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1105,7 +1105,7 @@ find_local_dest(struct virtio_net *dev, struct rte_mbuf *m,
 			"(%"PRIu64") TX: pkt to local VM device id:"
 			"(%"PRIu64") vlan tag: %d.\n",
 			dev->device_fh, dev_ll->vdev->dev->device_fh,
-			vlan_tag);
+			(int)*vlan_tag);
 
 			break;
 		}
-- 
1.8.4.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] vhost: Fix compilation issue
  2015-05-04  7:15 [dpdk-dev] [PATCH] vhost: Fix compilation issue Ouyang Changchun
@ 2015-05-12  9:23 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-05-12  9:23 UTC (permalink / raw)
  To: Ouyang Changchun, huawei.xie; +Cc: 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 <changchun.ouyang@intel.com>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-12  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04  7:15 [dpdk-dev] [PATCH] vhost: Fix compilation issue Ouyang Changchun
2015-05-12  9:23 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).