diff options
-rw-r--r-- | datapath/actions.c | 5 | ||||
-rw-r--r-- | datapath/datapath.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/datapath/actions.c b/datapath/actions.c index 30ea1d23..3550a00a 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -28,6 +28,7 @@ #include <linux/in6.h> #include <linux/if_arp.h> #include <linux/if_vlan.h> +#include <linux/spinlock.h> #include <net/ip.h> #include <net/ipv6.h> #include <net/checksum.h> @@ -38,6 +39,8 @@ #include "vlan.h" #include "vport.h" +static DEFINE_SPINLOCK(action_lock); + static int do_execute_actions(struct datapath *dp, struct sk_buff *skb, const struct nlattr *attr, int len, bool keep_skb); @@ -600,6 +603,7 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb) int error; /* Check whether we've looped too much. */ + spin_lock_bh(&action_lock); loop = &__get_cpu_var(loop_counters); if (unlikely(++loop->count > MAX_LOOPS)) loop->looping = true; @@ -622,5 +626,6 @@ out_loop: if (!--loop->count) loop->looping = false; + spin_unlock_bh(&action_lock); return error; } diff --git a/datapath/datapath.c b/datapath/datapath.c index 50ee6cd3..6b7298a6 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -528,9 +528,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info) if (!dp) goto err_unlock; - local_bh_disable(); err = ovs_execute_actions(dp, packet); - local_bh_enable(); rcu_read_unlock(); ovs_flow_free(flow, false); |