[ovs-dev] [PATCH 1/3] ofp-util: Allow updating the cookie from the ovs-ofctl mod-flows command.

Ben Pfaff blp at nicira.com
Mon Mar 26 21:58:54 UTC 2012


On Sun, Mar 25, 2012 at 11:20:40PM -0700, Justin Pettit wrote:
> Signed-off-by: Justin Pettit <jpettit at nicira.com>

I don't really understand this change.

First, my understanding was that on modify and delete operations,
"cookie_mask" is supposed to be a mask for matching an existing
cookie.  But the new code in ofputil_flow_mod_usable_protocols() seems
to regard it as a mask for bits that should be set or updated when a
flow is added or modified.

I'd be inclined to change struct ofputil_flow_mod so that there are
three fields, like this:
    ovs_be64 cookie;            /* Cookie bits to match. */
    ovs_be64 cookie_mask;       /* 1-bit in each 'cookie' bit to match. */
    ovs_be64 new_cookie;        /* New cookie to install or UINT64_MAX. */
which would make it clear what is intended although I haven't
carefully though it through.

Second, the comment here:
    # In NXM, the modification of an existing flow should not update the
    # cookie.  For OpenFlow, the behavior is different depending on the
    # version.  See below.
seems to inaccurately describe what OVS actually implements.  If this
is correct, then the following:
        ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=0 
        ovs-ofctl -F nxm mod-flows br0 cookie=0x4321/1,in_port=1,actions=1
should yield a flow table like this, with the cookie unchanged:
        cookie=0x1 in_port=1 actions=output:1
but in fact in my testing it changes the cookie:
        cookie=0x4321 in_port=1 actions=output:1

What am I missing?



More information about the dev mailing list