It sounds weird, have you commented "if((counter % 600.000.000) == 0)" ?mod 
operation maybe expensive since 600,000,000 is a large number than 
MAX_INT. 
but it should do so much harm to throughput :-(



  --
  Best Regard
  Joe



 




------------------ Original ------------------
From:&nbsp;"Nguyễn Thế Hiếu"<hieuntg...@gmail.com&gt;;
Date:&nbsp;Wed, May 6, 2020 09:44 PM
To:&nbsp;"Dave Barach (dbarach)"<dbar...@cisco.com&gt;;
Cc:&nbsp;"vpp-dev@lists.fd.io"<vpp-dev@lists.fd.io&gt;;
Subject:&nbsp;Re: [vpp-dev] Why VPP performance down very much when I use 
print() function.



Hi Dave &amp;&nbsp; Joe.Thanks for your both answers. I'm glad to see them.
I will try to use&nbsp;vlib_node_increment_counter()&nbsp;function instead.


But I still wonder. I know printf() can be bottleneck of performance, that's 
why I just call printf() every 600.000.000 packets.
Even if&nbsp; thoughput&nbsp;is 7Gbps, 600.000.000 packets mean VPP just call 
printf() function 1 time per minute.
So, I think at least VPP throughput should be 7Gbps at start testing point and 
just down after 1 minute.
But in my case, the throughput is 300Mbps from start testing point.&nbsp;


I have increased&nbsp; 600.000.000 to 1.200.000.000 and got the same result.


Best regards!
HieuNT


Vào Th 4, 6 thg 5, 2020 vào lúc 19:08 Dave Barach (dbarach) 
<dbar...@cisco.com&gt; đã viết:

   
If you want to count things in data plane nodes, use a per-node counter and the 
“show error” debug CLI to inspect it.
 
&nbsp;
 
To count every packet fed to the node dispatch function, you can bump a node 
counter once per frame:
 
&nbsp;
 
&nbsp; vlib_node_increment_counter (vm, myplugin_node.index, 
MYPLUGIN_ERROR_WHATEVER, frame-&gt;n_vectors);
 
&nbsp;
 
A single printf call costs roughly the same number of clock cycles as 
processing O(10) packets from start to finish. It’s really expensive.
 
&nbsp;
 
Dave
 
&nbsp;
  
From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io&gt; On Behalf Of Nguy?n Th? Hi?u
 Sent: Wednesday, May 6, 2020 5:26 AM
 To: vpp-dev@lists.fd.io
 Subject: [vpp-dev] Why VPP performance down very much when I use print() 
function.
 
 
&nbsp;
 
Hi VPP team.
 I create a simple VPP node name "swap_mac". "swap_mac" node just swap between 
source and destination MAC address and send packet back.
 Then, I use Pktgen tool to send packet to VPP. In VPP, the packet will go to 
swap_mac-&gt;interface-output node and finally send back Pktgen tool.
 
 I found out with this test model, VPP throughput can go up 7Gbps in my lab. 
But VPP&nbsp;throughput just is 300Mbps&nbsp;when I add a counter&nbsp;variable 
to count number of received packet and a printf() to print value of&nbsp; 
counter&nbsp;in "swap_mac" node function. 
 My code:
 
 counter ++
 if((counter % 600.000.000) == 0)
 {
 &nbsp; &nbsp; &nbsp; &nbsp;printf("Receive packets: %ld", counter&nbsp;);
 }
 So, why VPP throughput change from 7Gbps to 300Mbps when I just call printf() 
function every&nbsp;&nbsp;600.000.000 packets?
 ( I have tried to&nbsp; comment out printf() , VPP throughput go up 7Gb again. 
)
 
 Please help me to see it. I'm sorry for my bad English.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16261): https://lists.fd.io/g/vpp-dev/message/16261
Mute This Topic: https://lists.fd.io/mt/74025182/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to