[ovs-discuss] Question about handle_odp_miss_msg() in ofproto.c

YIMIN CHEN ymchen.nbzj at gmail.com
Wed Jun 6 01:08:48 UTC 2012


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 <ethan at nicira.com> 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
>> discuss at openvswitch.org
>> http://openvswitch.org/mailman/listinfo/discuss



More information about the discuss mailing list