[ovs-dev] same wildcard entries exist
Tetsuo NAKAGAWA
nakagawa at mxc.nes.nec.co.jp
Thu Mar 25 00:43:53 UTC 2010
Hi, Jesse.
> On Fri, Mar 19, 2010 at 7:45 AM, Tetsuo NAKAGAWA <nakagawa at mxc.nes.nec.co.jp
>> wrote:
>
>> Hi.
>>
>> I'm using Open vSwitch with master and openflow-1.0 branch
>> on XenServer 5.5.0.
>>
>> When same wildcard entries are added continuously twice,
>> a same wildcard entry is overwritten, so just same wildcard
>> entries are not left as follows.
>>
>
> Thanks for pointing this out. However, I think the following patch retains
> the goal of the original code and is slightly more efficient since it does
> not keep on searching the list after we run out of equal priority rules:
Looks good.
Thank you very much for your support.
> diff --git a/lib/classifier.c b/lib/classifier.c
> index cdad9c9..ee78dad 100644
> --- a/lib/classifier.c
> +++ b/lib/classifier.c
> @@ -640,14 +640,14 @@ bucket_insert(struct cls_bucket *bucket, struct
> cls_rule *
> {
> struct cls_rule *pos;
> LIST_FOR_EACH (pos, struct cls_rule, node.list, &bucket->rules) {
> - if (pos->priority <= rule->priority) {
> - if (pos->priority == rule->priority
> - && pos->wc.wildcards == rule->wc.wildcards
> + if (pos->priority == rule->priority) {
> + if (pos->wc.wildcards == rule->wc.wildcards
> && rules_match_1wild(pos, rule, rule->table_idx))
> {
> list_replace(&rule->node.list, &pos->node.list);
> return pos;
> }
> + } else if (pos->priority < rule->priority) {
> break;
> }
> }
Best regards,
--- Tetsuo NAKAGAWA
More information about the dev
mailing list