When the rule associated with rule_execute is an exact match rule, and
the flow is the exact match flow associated with that rule, it pulls
the actions directly from the rule.  I don't really want to dig into
this because

1) The code is really old, this is done differently now.
2) It's not clear to me why it matters how this works precisely, are
you experiencing problems?

Ethan

On Tue, Jun 5, 2012 at 6:08 PM, YIMIN CHEN <[email protected]> wrote:
> Hi Ethan,
>
> Thank you for your reply. I actually sent second email regarding the
> comments before this function. If I am reading the logic correctly
> (please correct me if I am wrong):
>
> rule_execute() will construct odp actions for two cases, not only
> exact-match case:
> 1) wildcards
> 2) exact-match with no matching flow.
>
> Is my above observation correct?
>
> If it is correct, then I am confused about the call to
> rule_make_action() in handle_odp_miss_msg(), which is also called for
> wildcard case, are we calling for wildcard twice?
>
>   if (rule->cr.wc.wildcards) {  <=== so called for wildcard as well???
>       rule = rule_create_subrule(p, rule, &flow);
>       rule_make_actions(p, rule, packet);
>   } else {
>       if (!rule->may_install) {
>           /* The rule is not installable, that is, we need to process every
>            * packet, so process the current packet and set its actions into
>            * 'subrule'. */
>           rule_make_actions(p, rule, packet);
>       } else {
>           /* XXX revalidate rule if it needs it */
>       }
>   }
>
> rule_make_action() will construct for
> 1) wildcard.
>
> Now wildcard is handled twice? I think there must be something I
> overlooked, I really appreciate if you can clarify for me.
>
>
> Thanks!
> Yimin
>
> On Wed, Jun 6, 2012 at 8:24 AM, Ethan Jackson <[email protected]> wrote:
>>>    /* Grab or compose the ODP actions.
>>>     *
>>>     * The special case for an exact-match 'rule' where 'flow' is not the
>>>     * rule's flow is important to avoid, e.g., sending a packet out its 
>>> input
>>>     * port simply because the ODP actions were composed for the wrong
>>>     * scenario. */
>>>    if (rule->cr.wc.wildcards || !flow_equal(flow, &rule->cr.flow)) {
>>> <=== if wildcard we call xlate_actions() again, why?
>>
>> I think the comment here clearly explains what's going on.
>>
>> Ethan
>>
>>
>>
>>>        struct rule *super = rule->super ? rule->super : rule;
>>>        if (xlate_actions(super->actions, super->n_actions, flow, ofproto,
>>>                          packet, &a, NULL, 0, NULL)) {
>>>            ofpbuf_delete(packet);
>>>            return;
>>>        }
>>>        actions = a.actions;
>>>        n_actions = a.n_actions;
>>>    } else {
>>>        actions = rule->odp_actions;
>>>        n_actions = rule->n_odp_actions;
>>>    }
>>> _______________________________________________
>>> discuss mailing list
>>> [email protected]
>>> http://openvswitch.org/mailman/listinfo/discuss
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to