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: <20240805145933.3ac6ae7a@kernel.org>
Date: Mon, 5 Aug 2024 14:59:33 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Joe Damato <jdamato@...tly.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
 pabeni@...hat.com, dxu@...uu.xyz, ecree.xilinx@...il.com,
 przemyslaw.kitszel@...el.com, donald.hunter@...il.com,
 gal.pressman@...ux.dev, tariqt@...dia.com, willemdebruijn.kernel@...il.com
Subject: Re: [PATCH net-next v2 09/12] ethtool: rss: support dumping RSS
 contexts

On Sat, 3 Aug 2024 19:11:28 +0100 Joe Damato wrote:
> > +struct rss_nl_dump_ctx {
> > +	unsigned long		ifindex;
> > +	unsigned long		ctx_idx;
> > +
> > +	unsigned int		one_ifindex;  
> 
> My apologies: I'm probably just not familiar enough with the code,
> but I'm having a hard time understanding what the purpose of
> one_ifindex is.
> 
> I read both ethnl_rss_dump_start and ethnl_rss_dumpit, but I'm still
> not following what this is used for; it'll probably be obvious in
> retrospect once you explain it, but I suppose my feedback is that a
> comment or something would be really helpful :)

Better name would probably help, but can't think of any.

User can (optionally) pass an ifindex/ifname to the dump, to dump
contexts only for the specified ifindex. If they do we "preset"
the ifindex and one_ifindex:

+	if (req_info.dev) {
+		ctx->one_ifindex = req_info.dev->ifindex;
+		ctx->ifindex = ctx->one_ifindex;
+		ethnl_parse_header_dev_put(&req_info);
+		req_info.dev = NULL;
+	}

and then the iteration is stopped after first full pass:

+	rtnl_lock();
+	for_each_netdev_dump(net, dev, ctx->ifindex) {
+		if (ctx->one_ifindex && ctx->one_ifindex != ctx->ifindex)
+			break;

Unfortunately we don't have any best practice for handling filtering 
in dumps. I find this cleaner than approaches I previously tried, but
we'll see if it stands the test of time.

I'll add the following comment:

	/* User wants to dump contexts for one ifindex only */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ