[ovs-discuss] Thread Safety in rconn

Dirk van der Merwe dirk.vandermerwe at netronome.com
Wed Aug 28 11:25:01 UTC 2013


Hi Guys

We have implemented another datapath protocol provider (replaced
ofproto-dpif module) specifically interfacing with our hardware, and then
slotting into OVS.

When I send a couple of thousand packets (without any flow configured),
thus generating packet_in messages to the controller, at some point I get
an assertion error in 'rconn_packet_counter_dec' function within the
'rconn' source file. Note that the rconn queue needs to get backed up for
this to happen.

The assertion fails on anyone of these two statements each time:
    ovs_assert(c->n_packets > 0);
    ovs_assert(c->n_bytes >= n_bytes);

I have seen that there are two threads operating on the rconn queue, the
one thread doing the maintenance of the rconn (when the queue starts to
back up) and the other when a packet_in is actually generated. And it seems
that there is a race condition occurring here.

I am unsure whether our code is the cause for this or if this will occur in
standard OVS too (obviously depending on very rare timing scenarios). FWIW,
the traffic I am sending to get this happening fairly consistent on this
machine is packets of 90 bytes size.

Is it expected that the packet_in messages should only be generated by a
single thread or is there any other mechanism to ensure thread safety in
the rconn module?

Thanks for the assistance.

Regards
Dirk van der Merwe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20130828/5f85688b/attachment.html>


More information about the discuss mailing list