Re: [PATCH net 1/2] net/sched: pfifo_fast: cap ring size and account to memcg

Jakub Kicinski <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.stable
Message-ID <[email protected]>
On Sat, 22 Aug 2026 18:14:49 -0400 Jamal Hadi Salim wrote:
> > On Thu, 20 Aug 2026 05:57:41 -0400 Jamal Hadi Salim wrote:  
> > > +     if (qlen > 65535) {
> > > +             pr_warn_ratelimited("pfifo_fast: capping ring size %u to 65535 for dev %s\n",
> > > +                                 qlen, qdisc_dev(qdisc)->name);
> > > +             qlen = 65535;
> > > +     }  
> >
> > Why not a hard cap?  
> 
> sorry, where to put the hard cap and what would it be?
> Or maybe you misspoke and intended to say "why put a hardcap"?
> 
> Or maybe in this case probably safer to just reject the change if > hard cap?

The latter, I'm asking why not:

if (qlen > 64k)
	return -EINVAL;

To be clear I didn't dig into the code, just read the commit msg, so
maybe you have a reason. But the "normal behavior" for out of range
params should be to return an error rather than silently clamp() into
the allowed range?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.