[ovs-dev] [PATCH] ofproto-dpif: add thread-safety annotation to vsp_{remove, add}

Ben Pfaff blp at nicira.com
Thu Aug 22 16:41:00 UTC 2013


On Thu, Aug 22, 2013 at 02:30:10PM +0900, Simon Horman wrote:
> This corrects an minor oversight in "ofproto-dpif: Make vlan splinters thread
> safe." which add thread-safety to these functions.
> 
> Signed-off-by: Simon Horman <horms at verge.net.au>

Doesn't compile:

../ofproto/ofproto-dpif.c:6179:18: error: use of undeclared identifier 'ofproto'
    OVS_EXCLUDED(ofproto->vsp_mutex)
                 ^
../lib/compiler.h:128:57: note: expanded from macro 'OVS_EXCLUDED'
#define OVS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))
                                                        ^
../ofproto/ofproto-dpif.c:6200:18: error: use of undeclared identifier 'ofproto'
    OVS_EXCLUDED(ofproto->vsp_mutex)
                 ^
../lib/compiler.h:128:57: note: expanded from macro 'OVS_EXCLUDED'
#define OVS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))


> ---
>  ofproto/ofproto-dpif.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index 5a64336..1a23955 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> @@ -6165,6 +6165,7 @@ vsp_adjust_flow(const struct ofproto_dpif *ofproto, struct flow *flow)
>  
>  static void
>  vsp_remove(struct ofport_dpif *port)
> +    OVS_EXCLUDED(ofproto->vsp_mutex)
>  {
>      struct ofproto_dpif *ofproto = ofproto_dpif_cast(port->up.ofproto);
>      struct vlan_splinter *vsp;
> @@ -6185,6 +6186,7 @@ vsp_remove(struct ofport_dpif *port)
>  
>  static void
>  vsp_add(struct ofport_dpif *port, ofp_port_t realdev_ofp_port, int vid)
> +    OVS_EXCLUDED(ofproto->vsp_mutex)
>  {
>      struct ofproto_dpif *ofproto = ofproto_dpif_cast(port->up.ofproto);
>  
> -- 
> 1.8.3.2
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list