The idea is dpNo could change in odd circumstances. We could use gOvsSwitchContext->dispatchLock and make OvsGetOpenInstance safe by itself.
Thanks, Alin. > -----Mesaj original----- > De la: Sairam Venugopal [mailto:vsai...@vmware.com] > Trimis: Thursday, July 21, 2016 9:52 PM > Către: Alin Serdean <aserd...@cloudbasesolutions.com>; Yin Lin > <yinli...@gmail.com> > Cc: dev@openvswitch.org > Subiect: Re: [ovs-dev] [PATCH 4/9] datapath-windows: Fix bugs in Event.c > around subscribe and lock > > Hi Alin, > > gOvsSwitchContext->dpNo and gOvsSwitchContext in general is currently > gOvsSwitchContext->read > in a lot of places without any locks being taken out. > > Eg: - > https://github.com/openvswitch/ovs/blob/15850211ce88d540e57a6f2fc8096 > 3465b9 > a5475/datapath-windows/ovsext/Datapath.c#L973 > https://github.com/openvswitch/ovs/blob/15850211ce88d540e57a6f2fc8096 > 3465b9 > a5475/datapath-windows/ovsext/Datapath.c#L1420 > > The function OvsGetOpenInstance() is currently defined in Datapath.c and > only used by 2 methods in Event.c. If gOvsSwitchContext->dpNo was meant > to be read after acquiring a lock, then we need to define a lock specific to > gOvsSwitchContext inside OvsGetOpenInstance() and not rely on > EventQueue lock to enforce it. > > Thanks, > Sairam > > > > > On 7/21/16, 6:58 AM, "Alin Serdean" <aserd...@cloudbasesolutions.com> > wrote: > > >> -----Mesaj original----- > > > >> De la: dev [mailto:dev-boun...@openvswitch.org] În numele Sairam > > > >> Venugopal > > > >> Trimis: Monday, July 18, 2016 9:27 PM > > > >> Către: Yin Lin <yinli...@gmail.com> > > > >> Cc: dev@openvswitch.org > > > >> Subiect: Re: [ovs-dev] [PATCH 4/9] datapath-windows: Fix bugs in > >> Event.c > > > >> around subscribe and lock > > > >> > > > >> Hi Yin, > > > >> > > > >> Thanks for reviewing this. (1) has been addressed in a different patch. > > > >> (2) We don¹t need the lock for OvsGetOpenInstance(). > > > >[Alin Gabriel Serdean: ] we need a lock in OvsGetOpenInstance because: > > > >https://urldefense.proofpoint.com/v2/url?u=https- > 3A__github.com_openvsw > >itc > >h_ovs_blob_master_datapath-2Dwindows_ovsext_Datapath.c- > 23L527&d=CwIGaQ& > >c=S > >qcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt- > uEs&r=Dcruz40PROJ40ROzSpxyQSLw6f > >crO > >WpJgEcEmNR3JEQ&m=TIfmnsdkLsgajJWRZp6fyWcW_1eXVWsfuqHqHzvVhi > M&s=Lb5uwUve > >kGK > >ck_ubpcUaZVZkJMFEEgaBwQtbZVsD8vw&e= > > > > > > > >gOvsSwitchContext->dpNo _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev