lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240806082316.02c5d71a@kernel.org>
Date: Tue, 6 Aug 2024 08:23:16 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Edward Cree <ecree.xilinx@...il.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
 pabeni@...hat.com, dxu@...uu.xyz, przemyslaw.kitszel@...el.com,
 donald.hunter@...il.com, gal.pressman@...ux.dev, tariqt@...dia.com,
 willemdebruijn.kernel@...il.com, jdamato@...tly.com
Subject: Re: [PATCH net-next v2 09/12] ethtool: rss: support dumping RSS
 contexts

On Tue, 6 Aug 2024 15:24:50 +0100 Edward Cree wrote:
> > +	if (!ctx->ctx_idx) {
> > +		ret = rss_dump_one_ctx(skb, cb, dev, 0);
> > +		if (ret)
> > +			return ret;
> > +		ctx->ctx_idx++;
> > +	}  
> 
> Maybe comment this block with something like "context 0 is
>  not stored in the XArray" to make clear why this is split
>  out from a loop that looks like it should be able to handle
>  it.

Will do.

> > +
> > +	for (; xa_find(&dev->ethtool->rss_ctx, &ctx->ctx_idx,
> > +		       ULONG_MAX, XA_PRESENT); ctx->ctx_idx++) {
> > +		ret = rss_dump_one_ctx(skb, cb, dev, ctx->ctx_idx);
> > +		if (ret)
> > +			return ret;
> > +	}
> > +	ctx->ctx_idx = 0;  
> 
> Feels like there has to be a way to do this with
>  xa_for_each_start()?  Something like (untested):

It may work in the current code but I prefer to stay away from xarray
iterators in netlink code. They cause too many bugs. They do not
invalidate / move the index past the end of the array once they are
done. Which means if the dump ever gets called again after finishing
we'll re-dump the last element.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ