[ovs-dev] [PATCH 1/3] ofproto-dpif: Move send_packet() to ofproto-dpif-xlate module.
Alex Wang
alexw at nicira.com
Thu Sep 26 16:28:05 UTC 2013
Following is Ethan's reply from a almost same RFC patch I sent just to him
earlier,
Repost it here, so that all following comments can be made on this thread.
"""
In xlate_send_packet() you aren't allow to hold the xlate_rwlock while
calling xlate_actions(). There are two options to deal with this.
(1) make a new xlate_actions_unsafe() function internal to
ofproto-dpif-xlate which doesn't take the xlate_rwlock, and call that.
(2) Take the xlate_rwlock, compose the xin, release the xlate_rwlock,
and call xlate_actions.
The ofproto_dpif_send_packet() function isn't thread safe. You aren't
allowed to dereference ofport even to do an ofport->up.ofproto.
Furthermore, incrementing the stats.tx_packets isn't thread safe
without a mutex. The ++ operation isn't atomic.
Ben, how do you feel about ditching ofproto_dpif's stats member? It
doesn't seem like a particularly important feature to me, and I think
it's going to be annoying to implement in a thread safe manner.
"""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130926/0c29c3de/attachment-0003.html>
More information about the dev
mailing list