Re: [PATCH net-next 1/5] ethtool: Add RSS indirection table resize helpers

From: Jakub Kicinski

Date: Wed Mar 04 2026 - 12:12:51 EST


On Wed, 4 Mar 2026 12:37:09 +0100 Björn Töpel wrote:
> > > + return -EINVAL;
> > > +
> > > + scoped_guard(mutex, &dev->ethtool->rss_lock) {
> > > + xa_for_each(&dev->ethtool->rss_ctx, context, ctx) {
> > > + ret = ethtool_rxfh_indir_can_resize(ethtool_rxfh_context_indir(ctx),
> >
> > 80 char limit width limit is still king in netdev
> > please shrink the length of the helpers you're adding?
> > And/or take the locks in a normal way..
>
> Hmm, is guard() and friends discouraged in netdev, or ethtool
> specific? I'll fix the 100 chars lines (sad face)!

Yes, non-scoped guards are discouraged.

> > > + ctx->indir_size, new_indir_size);
> > > + if (ret)
> > > + return ret;
> > > + }
> > > +
> > > + xa_for_each(&dev->ethtool->rss_ctx, context, ctx) {
> > > + __ethtool_rxfh_indir_resize(ethtool_rxfh_context_indir(ctx),
> > > + ctx->indir_size, new_indir_size);
> > > + ctx->indir_size = new_indir_size;
> > > + }
> > > + }
> > > +
> > > + xa_for_each(&dev->ethtool->rss_ctx, context, ctx)
> > > + ethtool_rss_notify(dev, ETHTOOL_MSG_RSS_NTF, context);
> >
> > Why a separate loop ?
>
> We can't hold the rss_lock for the notify;
> ethnl_default_notify->rss_prepare->... deadlock.

LOL I guess scoped guard also has negative impact on readability