[ovs-dev] [PATCH] ovs: fix the bug of bucket counter is not updated

Simon Horman simon.horman at netronome.com
Tue Mar 26 13:17:07 UTC 2019


On Tue, Mar 26, 2019 at 04:50:03PM +0800, solomon wrote:
> Ilya Maximets wrote:
> >> On Thu, Mar 21, 2019 at 10:41:05AM +0800, solomon wrote:
> >>> Ben Pfaff wrote:
> >>>> On Wed, Mar 20, 2019 at 08:16:18PM +0800, Li Wei wrote:
> >>>>>
> >>>>> After inserting/removing a bucket, we don't update the bucket counter.
> >>>>> When we call ovs-ofctl dump-group-stats br-int, a panic happened.
> >>>>
> >>>> Thanks for the patch!  It looks correct to me.  Thank you for adding a
> >>>> test, too.
> >>>>
> >>>> I took a closer look and I saw that 'n_buckets' is not very useful,
> >>>> because it is only used in cases where the code is already
> >>>> O(n_buckets).  I think that we can just remove it.  Then it cannot get
> >>>> out-of-sync.  What do you think of this variation of your patch?
> >>>
> >>>
> >>> ovs_list_size() will traversing the list to get the total length.
> >>>
> >>> In our custom scheduling algorithms (eg wrr, least-connection), 
> >>> we need to know the total number of buckets before traversing the bucket list to hit target bucket. 
> >>> so, it is traversed twice.
> >>>
> >>> If the number of buckets reaches 100+, there are tens of thousands of groups, don't this modification affect performance?
> >>>
> >>> I hope to keep n_buckets in struct ofgroup.
> >>
> >> OK.
> >>
> >> I applied the original to master and backported as far as branch-2.6.
> > 
> > This patch broke the testsuite on branches 2.6 to 2.10.
> 
> The new testcase in this patch insert new bucket using insert-buckets command.
> But there is a bug in inserting bucket with weight fixed in commit 
> 0b4caa2eba22a516a312e7b404107eaebe618ee1
> (ofp-group: support to insert bucket with weight value for select type)
> 
> Also need to backport commit 0b4caa2eba to branch2.6~2.10.

Thanks, I have made preliminary backports to the relevant branches
and am running travisci to see if the tests pass.

https://travis-ci.org/horms2/ovs/builds/511479533
https://travis-ci.org/horms2/ovs/builds/511482871
https://travis-ci.org/horms2/ovs/builds/511482977
https://travis-ci.org/horms2/ovs/builds/511482911
https://travis-ci.org/horms2/ovs/builds/511482945

>From my point of view travisci passing is a base requirement
for applying patches, in particular backports to released versions.


More information about the dev mailing list