[PATCH net-next 03/10] net: microchip: sparx5: add support for Service Dual Leacky Buckets

Simon Horman simon.horman at corigine.com
Mon Feb 6 02:18:23 PST 2023


On Sun, Feb 05, 2023 at 08:11:02PM +0000, Daniel.Machon at 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.



More information about the linux-arm-kernel mailing list