Hi HieuNT, I am not surprised performance is this bad. There could be a number of causes for this ... but it's not worth debugging.
Use the method Dave suggests ... Ray K On 06/05/2020 14:44, Nguyễn Thế Hiếu wrote: > Hi Dave & Joe. > Thanks for your both answers. I'm glad to see them. > I will try to use vlib_node_increment_counter() 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 thoughput 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. > > I have increased 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 <mailto:dbar...@cisco.com>> đã 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.____ > > __ __ > > To count every packet fed to the node dispatch function, you can bump a > node counter once per frame:____ > > __ __ > > vlib_node_increment_counter (vm, myplugin_node.index, > MYPLUGIN_ERROR_WHATEVER, frame->n_vectors);____ > > __ __ > > 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.____ > > __ __ > > Dave____ > > __ __ > > *From:* vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io> > <vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io>> *On Behalf Of *Nguy?n Th? > Hi?u > *Sent:* Wednesday, May 6, 2020 5:26 AM > *To:* vpp-dev@lists.fd.io <mailto:vpp-dev@lists.fd.io> > *Subject:* [vpp-dev] Why VPP performance down very much when I use > print() function.____ > > __ __ > > 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->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 throughput just is *300Mbps *when I add a /counter /variable to > count number of received packet and a printf() to print value of /counter/ > in "swap_mac" node function. > My code: > > counter ++ > if((counter % 600.000.000) == 0) > { > printf("Receive packets: %ld", counter ); > } > So, why VPP throughput change from 7Gbps to 300Mbps when I just call > printf() function every 600.000.000 packets? > ( I have tried to comment out printf() , VPP throughput go up 7Gb again. > ) > > Please help me to see it. I'm sorry for my bad English.____ > > > >
signature.asc
Description: OpenPGP digital signature
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#16262): https://lists.fd.io/g/vpp-dev/message/16262 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] -=-=-=-=-=-=-=-=-=-=-=-