[ovs-dev] [PATCH 1/2] ofproto: Don't optimize out updating flow cookie.

Justin Pettit jpettit at nicira.com
Wed Mar 24 22:01:11 UTC 2010


Just part 1.  I'm reviewing 2 now.

--Justin


On Mar 24, 2010, at 2:48 PM, Ben Pfaff wrote:

> Are you referring to the change that patch 1 makes or those that 1 and 2
> together make?
> 
> On Wed, Mar 24, 2010 at 02:41:40PM -0700, Justin Pettit wrote:
>> This change seems correct according to the OpenFlow spec.  It doesn't
>> appear that the OpenFlow reference implementation does that, so I'll
>> send them a note.
>> 
>> --Justin
>> 
>> 
>> On Mar 19, 2010, at 12:49 PM, Ben Pfaff wrote:
>> 
>>> The OFPFC_MODIFY and OFPFC_MODIFY_STRICT optimizes out modifying the
>>> actions if the actions didn't change, but it also skipped updating the
>>> flow cookie in that case, which seems wrong.  This commit fixes the
>>> problem.
>>> ---
>>> ofproto/ofproto.c |    2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>> 
>>> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
>>> index fcc76d6..9efc96e 100644
>>> --- a/ofproto/ofproto.c
>>> +++ b/ofproto/ofproto.c
>>> @@ -2929,6 +2929,7 @@ modify_flow(struct ofproto *p, const struct ofp_flow_mod *ofm,
>>>    } else {
>>>        size_t actions_len = n_actions * sizeof *rule->actions;
>>> 
>>> +        rule->flow_cookie = ofm->cookie;
>>>        if (n_actions == rule->n_actions
>>>            && !memcmp(ofm->actions, rule->actions, actions_len))
>>>        {
>>> @@ -2938,7 +2939,6 @@ modify_flow(struct ofproto *p, const struct ofp_flow_mod *ofm,
>>>        free(rule->actions);
>>>        rule->actions = xmemdup(ofm->actions, actions_len);
>>>        rule->n_actions = n_actions;
>>> -        rule->flow_cookie = ofm->cookie;
>>> 
>>>        if (rule->cr.wc.wildcards) {
>>>            COVERAGE_INC(ofproto_mod_wc_flow);
>>> -- 
>>> 1.6.6.1
>>> 
>>> 
>>> _______________________________________________
>>> dev mailing list
>>> dev at openvswitch.org
>>> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>> 





More information about the dev mailing list