[ovs-dev] Query regarding ovs_flow_tbl_insert function

Pravin Shelar pshelar at nicira.com
Fri Oct 12 18:35:25 UTC 2012

Most of flow table modification are done in genl callback which are
called under global genl_mutex.
You can refer to locking related comment in datapath.c for details.


On Fri, Oct 12, 2012 at 7:32 AM, ankur dwivedi <ankurengg2003 at gmail.com> wrote:
> Hi,
> In the flow table present in the datapath,ovs_flow_tbl_insert is the
> functions which inserts flow in the flow table.
> I find that it uses the hlist_add_head_rcu function to insert flows in the
> table. But the man page for this function says the following
> "The caller must take whatever precautions are necessary (such as holding
> appropriate locks) to avoid racing with another list-mutation primitive,
> such as hlist_add_head_rcu or hlist_del_rcu, running on this same list."
> So should not ovs_flow_tbl_insert function take a lock before inserting any
> flow or there will be only one request at a time?
> --
> Thanks
> Ankur Dwivedi
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

More information about the dev mailing list