[ovs-dev] [PATCH v3 ovn 1/3] northd: optimize build_lb_rules routine

Mark Gray mark.d.gray at redhat.com
Fri Aug 27 17:21:46 UTC 2021


On 27/08/2021 17:20, Lorenzo Bianconi wrote:
> [...]
>>> +        struct ovn_lflow *lflow_ref = NULL;
>>> +        uint32_t hash = ovn_logical_flow_hash(
>>> +                ovn_stage_get_table(S_SWITCH_IN_STATEFUL),
>>> +                ovn_stage_get_pipeline_name(S_SWITCH_IN_STATEFUL), priority,
>>> +                ds_cstr(match), ds_cstr(action));
>>> +
>>>          for (size_t j = 0; j < lb->n_nb_ls; j++) {
>>>              struct ovn_datapath *od = lb->nb_ls[j];
>>>  
>>>              if (reject) {
>>>                  meter = copp_meter_get(COPP_REJECT, od->nbs->copp,
>>>                                         meter_groups);
>>> +            } else if (ovn_dp_group_add_with_reference(lflow_ref, od, hash)) {
>>> +                continue;
>>>              }
>>
>> Should this be another if statement instead of else if?
>>
>> if (reject) {
>>     meter = copp_meter_get(COPP_REJECT, od->nbs->copp,
>>                            meter_groups);
>> }
>>
>> if (ovn_dp_group_add_with_reference(lflow_ref, od, hash)) {
>>     continue;
> 
> we need else if here since the merter pointer introduces a dp dependency
> 
> Regards,
> Lorenzo
> 
>> }
>>
>>
>>> -            ovn_lflow_add_with_hint__(lflows, od, S_SWITCH_IN_STATEFUL,
>>> -                                      priority, ds_cstr(match),
>>> -                                      ds_cstr(action), NULL, meter,
>>> -                                      &lb->nlb->header_);
>>> +            lflow_ref = ovn_lflow_add_at_with_hash(lflows, od,
>>> +                    S_SWITCH_IN_STATEFUL, priority,
>>> +                    ds_cstr(match), ds_cstr(action),
>>> +                    NULL, meter, &lb->nlb->header_,
>>> +                    OVS_SOURCE_LOCATOR, hash);
>>>          }
>>>      }
>>>  }
>>>
>>

Acked-by: Mark D. Gray <mark.d.gray at redhat.com>



More information about the dev mailing list