lkml.org 
[lkml]   [2023]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 03/10] net: microchip: sparx5: add support for Service Dual Leacky Buckets
On Sun, Feb 05, 2023 at 08:11:02PM +0000, Daniel.Machon@microchip.com wrote:
> Hi Simon,
>
> Thanks for reviewing my patches, appreciate it!
>
> > > +static u32 sparx5_sdlb_group_get_last(struct sparx5 *sparx5, u32 group)
> > > +{
> > > + u32 itr, next;
> > > +
> > > + itr = sparx5_sdlb_group_get_first(sparx5, group);
> > > +
> > > + for (;;) {
> >
> > Unbounded loops like this give me some apprehension.
> > Will they always terminate?
>
> Yes, it will always terminate - unless the add() del() functions are
> buggy to begin with.
>
> The end of the leak chain is marked by an index pointing to itself, and
> this is the exit condition I am looking for in the unbounded loop.

Thanks for confirming, much appreciated.

\
 
 \ /
  Last update: 2023-03-27 00:10    [W:0.044 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site