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] [day] [month] [year] [list]
Date:	Wed, 26 Nov 2014 22:29:33 +0200
From:	Eyal perry <eyalpe@....mellanox.co.il>
To:	David Miller <davem@...emloft.net>, ben@...adent.org.uk
CC:	amirv@...lanox.com, netdev@...r.kernel.org, ogerlitz@...lanox.com,
	yevgenyp@...lanox.com, eyalpe@...lanox.com,
	Tom Lendacky <thomas.lendacky@....com>, ariel.elior@...gic.com,
	prashant@...adcom.com, mchan@...adcom.com, hariprasad@...lsio.com,
	sathya.perla@...lex.com, subbu.seetharaman@...lex.com,
	ajit.khaparde@...lex.com, jeffrey.t.kirsher@...el.com,
	jesse.brandeburg@...el.com, bruce.w.allan@...el.com,
	carolyn.wyborny@...el.com, donald.c.skidmore@...el.com,
	gregory.v.rose@...el.com, matthew.vick@...el.com,
	john.ronciak@...el.com, mitch.a.williams@...el.com,
	linux-net-drivers@...arflare.com, sshah@...arflare.com,
	sbhatewara@...are.com, pv-drivers@...are.com
Subject: Re: [PATCH net-next V1 1/2] ethtool: Support for configurable RSS
 hash function

On 11/22/2014 11:54 PM, David Miller wrote:
> From: Amir Vadai <amirv@...lanox.com>
> Date: Thu, 20 Nov 2014 16:26:49 +0200
> 
>> +	/* We require at least one supported parameter to be changed and no
>> +	 * change in any of the unsupported parameters
>> +	 */
>> +	if ((!indir && !key) || hfunc != ETH_RSS_HASH_NO_CHANGE)
>> +		return -EOPNOTSUPP;
>> +
> 
> I know it will make more work for you, but all of these driver
> implementations of this hook should:
> 
> 1) Accept hfunc of whatever hash function the chip is using,
>    not just ETH_RSS_HASH_NO_CHANGE.
> 
> 2) Provide an accurate hfunc value in the ->get() call.
Hello David, Ben, et al,
Before submitting V2, I'd like to consult you regarding the
implementation shown above. I thought of skipping the validity check
which I've described above as "We require at least one supported
parameter...", instead, I think it's better to fail the ->set() call
only in case of unsupported action requested, e.g.:
+	if (hfunc != ETH_RSS_HASH_NO_CHANGE &&
+	    hfunc != ETH_RSS_HASH_TOP)
+		return -EOPNOTSUPP;
+	if (indir)
+		/* set indirection table code ... */
+	if (key)
+		/* set hash key code ... */
The drawbacks are the change of previous behavior (only requests for at
least one change were supported), however it seems more reasonable and
makes the code much more readable.
In similar manner, for the ->get() call, remove the validity checks (as
I suggested in V1), and just protect against NULL pointer dereference, e.g:
-	if (!indir && !key)
-		return -EOPNOTSUPP;
+	if (indir)
+		/* fill in the given indirection table array */
+	if (key)
+		/* fill in the given hash key array */
+	if (hfunc)
+		*hfunc = ETH_RSS_HASH_TOP;
Please advise,
Thanks,
Eyal.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ