diff mbox

[ovs-dev,5/6] upcall: Check for recirc_id in ukey_create_from_dpif_flow()

Message ID 1446088078-32610-5-git-send-email-jrajahalme@nicira.com
State Accepted
Headers show

Commit Message

Jarno Rajahalme Oct. 29, 2015, 3:07 a.m. UTC
Filter out not only flows with recirculation actions, but also flows
with non-zero recirculation id in flow key when creating ukeys from
datapath flows, as such flows also depend on the recirculation
context, which have been lost after a restart.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
---
 ofproto/ofproto-dpif-upcall.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Joe Stringer Nov. 4, 2015, 7:40 p.m. UTC | #1
On 28 October 2015 at 20:07, Jarno Rajahalme <jrajahalme@nicira.com> wrote:
> Filter out not only flows with recirculation actions, but also flows
> with non-zero recirculation id in flow key when creating ukeys from
> datapath flows, as such flows also depend on the recirculation
> context, which have been lost after a restart.
>
> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>

Good catch.

Acked-by: Joe Stringer <joestringer@nicira.com>
Jarno Rajahalme Nov. 7, 2015, 2:57 a.m. UTC | #2
Pushed,

  Jarno

> On Nov 4, 2015, at 11:40 AM, Joe Stringer <joestringer@nicira.com> wrote:
> 
> On 28 October 2015 at 20:07, Jarno Rajahalme <jrajahalme@nicira.com> wrote:
>> Filter out not only flows with recirculation actions, but also flows
>> with non-zero recirculation id in flow key when creating ukeys from
>> datapath flows, as such flows also depend on the recirculation
>> context, which have been lost after a restart.
>> 
>> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
> 
> Good catch.
> 
> Acked-by: Joe Stringer <joestringer@nicira.com>
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 1d8790c..f749c66 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1565,7 +1565,14 @@  ukey_create_from_dpif_flow(const struct udpif *udpif,
 
     /* Check the flow actions for recirculation action.  As recirculation
      * relies on OVS userspace internal state, we need to delete all old
-     * datapath flows with recirculation upon OVS restart. */
+     * datapath flows with either a non-zero recirc_id in the key, or any
+     * recirculation actions upon OVS restart. */
+    NL_ATTR_FOR_EACH_UNSAFE (a, left, flow->key, flow->key_len) {
+        if (nl_attr_type(a) == OVS_KEY_ATTR_RECIRC_ID
+            && nl_attr_get_u32(a) != 0) {
+            return EINVAL;
+        }
+    }
     NL_ATTR_FOR_EACH_UNSAFE (a, left, flow->actions, flow->actions_len) {
         if (nl_attr_type(a) == OVS_ACTION_ATTR_RECIRC) {
             return EINVAL;