ovs_lib.OVSBridge mod_flow() method doesn't work

Bug #1255058 reported by Aleksandr Chirko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Aleksandr Chirko

Bug Description

During my OVS-related prototyping I spotted this. For bug verification I used 'ovs_lib' as a standalone python package (without Openstack runnig).

OVS info:
    ovs-ofctl (Open vSwitch) 1.4.0+build0
    Compiled Feb 18 2013 13:13:22
    OpenFlow versions 0x1:0x1

I can define flow with no problems:
    from neutron.agent.linux import ovs_lib

    int_br = ovs_lib.OVSBridge('br-int', root_helper='sudo')
    int_br.add_flow(priority=777,dl_type=2048, actions='normal')

Run 'ovs-ofctl dump-flows br-int'
    'cookie=0x0, duration=115.956s, table=0, n_packets=0, n_bytes=0, priority=777,ip actions=NORMAL'

However when I try to modify this flow:
    int_br.mod_flow(dl_type=2048, actions='drop')
I see
    'Command: ['sudo', 'ovs-ofctl', 'mod-flows', 'br-int', 'hard_timeout=0,idle_timeout=0,priority=0,dl_type=2048,actions=drop']
    Exit code: 1
    Stdout: ''
    Stderr: 'ovs-ofctl: unknown keyword hard_timeout\n'

Tags: ovs
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

What version of OVS are you using?

Changed in neutron:
status: New → Incomplete
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/58533

Changed in neutron:
assignee: nobody → Aleksandr Chirko (achirko)
status: Incomplete → In Progress
Revision history for this message
Akihiro Motoki (amotoki) wrote :

According to the output of ovs-ofctl (version and build date),
OVS version is 1.4.0 and it comes from Ubuntu 12.04 OVS package.

Revision history for this message
Kyle Mestery (mestery) wrote :

The actual problem here is that "hard_timeout" is not a supported argument when modifying an existing flow. The patch, as proposed, does address this, but it also introduces some significant changes to the flow programming logic. I am still reviewing those at the moment.

Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/58533
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3c00dd43f613c838f713a7cbf3cedb6767a8c52a
Submitter: Jenkins
Branch: master

commit 3c00dd43f613c838f713a7cbf3cedb6767a8c52a
Author: Aleks Chirko <email address hidden>
Date: Tue Nov 26 16:22:57 2013 +0200

    Bugfix and refactoring for ovs_lib flow methods

    Remove hardcoded flow parameters from
    '_build_flow_expr_str' method, so we can
    define any flows we want and can rely on 'ovs-ofctl'
    command to verify flow arguments correctness.
    When building flow string inside _build_flow_expr_str
    use the following approach:
    1. Build prefix and remove prefix params from flow_dict.
    2. Build postfix (actions) and remove 'actions' from
    flow dict.
    3. Inside the loop build flow array from everything
    what's left in flow_dict.
    4. Append postfix (actions) to the flow array.
    5. 'Join' flow array into flow string.

    Change _build_flow_expr_str() to be a function
    instead of an object method because 'self'
    parameter wasn't used.

    Remove 'add_or_mod_flow_str' method because
    we have to use separate logic when bulding flow
    strings for 'add_flow' and 'mod_flow' methods.

    Add more unit tests for OVSBridge class.

    Closes-Bug: #1255058
    Closes-Bug: #1240572

    Change-Id: Ic89221d006a626aa2fc40314a9acffc0ea6fd61c

Changed in neutron:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in neutron:
milestone: none → icehouse-rc1
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-rc1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.