On Tue, Aug 14, 2012 at 05:33:00PM +0200, Giuseppe Lettieri wrote: > Il giorno 10/ago/2012, alle ore 19:20, Ben Pfaff <b...@nicira.com> ha scritto: > > > ... > >> The datapath thread goes to 100% CPU in my tests, but this is > >> expected, since everything is being done in software and no real I/O > >> is being performed. The main thread goes to ~65%, and this is less > >> expected (at least, I did not expect it) and we should investigate > >> why. > > > > I'm surprised too. I think that your test only has one or two flows, > > so I'd expect the forwarding thread to be busy and the main thread to > > be idle. > > > It turns out that, in my test, the forwarding thread was never able > to found a flow for the incoming packets. When this is the case, the > forwarding thread puts the incoming packet in a queue and signals > the main thread via a pipe. The main thread then completes the > processing, which includes the actual forwarding. This explains why > both threads where busy. It is interesting that a 10x forwarding > improvement can be obtained even in this scenario.
Yes, that is surprising. I would have expected that the cost of communication would outweigh any gain in such a case. > I do not know why my previous test was unable to trigger any flows, > but it appears to be related to my use of the local port "br0". There may be some confusion about numbering. OpenFlow says that the port number of the "local port" is 65534 (OFPP_LOCAL). The datapaths, on the other hand, use port number 0 for the "local port". There is supposed to be translation going on at the interface between the datapath and the OpenFlow implementation, but mistakes can creep in, especially in new code. > In the following setup, instead, flows are used as expected: > > ip tuntap add tap0 mode tap > ip tuntap add tap1 mode tap > ovs-vsctl add-bf br0 -- set bridge br0 datapath_type=netdev > ovs-vsctl add-port br0 tap0 > ovs-vsctl add-port br0 tap1 If port numbering is the problem, then it would make sense that forwarding between other ports works, because the "local port" is the only one that needs translation; other ports have the same number in both OpenFlow and the datapaths. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev