Add annotations to find vport functions to check if the dispatch lock is held.
Signed-off-by: Alin Gabriel Serdean <aserd...@ovn.org> --- datapath-windows/ovsext/Vport.c | 7 ++++++- datapath-windows/ovsext/Vport.h | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c index e08cb90ce..f79324d28 100644 --- a/datapath-windows/ovsext/Vport.c +++ b/datapath-windows/ovsext/Vport.c @@ -135,7 +135,7 @@ HvCreatePort(POVS_SWITCH_CONTEXT switchContext, * Lookup by port name to see if this port with this name had been added * (and deleted) previously. */ - vport = OvsFindVportByHvNameW(gOvsSwitchContext, + vport = OvsFindVportByHvNameW(switchContext, portParam->PortFriendlyName.String, portParam->PortFriendlyName.Length); if (vport && vport->isAbsentOnHv == FALSE) { @@ -693,6 +693,7 @@ done: /* * OVS Vport related functionality. */ +_Use_decl_annotations_ POVS_VPORT_ENTRY OvsFindVportByPortNo(POVS_SWITCH_CONTEXT switchContext, UINT32 portNo) @@ -787,6 +788,7 @@ OvsFindTunnelVportByPortType(POVS_SWITCH_CONTEXT switchContext, return NULL; } +_Use_decl_annotations_ POVS_VPORT_ENTRY OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext, PSTR name) @@ -810,6 +812,7 @@ OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext, } /* OvsFindVportByHvName: "name" is assumed to be null-terminated */ +_Use_decl_annotations_ POVS_VPORT_ENTRY OvsFindVportByHvNameW(POVS_SWITCH_CONTEXT switchContext, PWSTR wsName, SIZE_T wstrSize) @@ -862,6 +865,7 @@ Cleanup: return vport; } +_Use_decl_annotations_ POVS_VPORT_ENTRY OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext, PSTR name) @@ -884,6 +888,7 @@ OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext, return vport; } +_Use_decl_annotations_ POVS_VPORT_ENTRY OvsFindVportByPortIdAndNicIndex(POVS_SWITCH_CONTEXT switchContext, NDIS_SWITCH_PORT_ID portId, diff --git a/datapath-windows/ovsext/Vport.h b/datapath-windows/ovsext/Vport.h index 7d88f86fb..32cbf8bcc 100644 --- a/datapath-windows/ovsext/Vport.h +++ b/datapath-windows/ovsext/Vport.h @@ -122,15 +122,20 @@ typedef struct _OVS_VPORT_ENTRY { struct _OVS_SWITCH_CONTEXT; +_Requires_lock_held_(switchContext->dispatchLock) POVS_VPORT_ENTRY OvsFindVportByPortNo(POVS_SWITCH_CONTEXT switchContext, UINT32 portNo); /* "name" is null-terminated */ +_Requires_lock_held_(switchContext->dispatchLock) POVS_VPORT_ENTRY OvsFindVportByOvsName(POVS_SWITCH_CONTEXT switchContext, PSTR name); +_Requires_lock_held_(switchContext->dispatchLock) POVS_VPORT_ENTRY OvsFindVportByHvNameA(POVS_SWITCH_CONTEXT switchContext, PSTR name); +_Requires_lock_held_(switchContext->dispatchLock) POVS_VPORT_ENTRY OvsFindVportByHvNameW(POVS_SWITCH_CONTEXT switchContext, PWSTR wsName, SIZE_T wstrSize); +_Requires_lock_held_(switchContext->dispatchLock) POVS_VPORT_ENTRY OvsFindVportByPortIdAndNicIndex(POVS_SWITCH_CONTEXT switchContext, NDIS_SWITCH_PORT_ID portId, NDIS_SWITCH_NIC_INDEX index); -- 2.16.1.windows.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev