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: <f80a0316-8bfe-41d7-9ebc-b1457f35a0cf@nvidia.com>
Date: Sun, 13 Jul 2025 14:10:50 +0300
From: Gal Pressman <gal@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
 andrew+netdev@...n.ch, horms@...nel.org, donald.hunter@...il.com,
 shuah@...nel.org, kory.maincent@...tlin.com, maxime.chevallier@...tlin.com,
 sdf@...ichev.me, ecree.xilinx@...il.com
Subject: Re: [PATCH net-next 06/11] ethtool: rss: support setting hkey via
 Netlink

On 11/07/2025 4:52, Jakub Kicinski wrote:
> Support setting RSS hashing key via ethtool Netlink.
> Use the Netlink policy to make sure user doesn't pass
> an empty key, "resetting" the key is not a thing.

Makes sense.

> +static int
> +rss_set_prep_hkey(struct net_device *dev, struct genl_info *info,
> +		  struct rss_reply_data *data, struct ethtool_rxfh_param *rxfh,
> +		  bool *mod)
> +{
> +	struct nlattr **tb = info->attrs;
> +
> +	if (!tb[ETHTOOL_A_RSS_HKEY])
> +		return 0;
> +
> +	if (nla_len(tb[ETHTOOL_A_RSS_HKEY]) != data->hkey_size) {
> +		NL_SET_BAD_ATTR(info->extack, tb[ETHTOOL_A_RSS_HKEY]);
> +		return -EINVAL;
> +	}
> +
> +	rxfh->key_size = data->hkey_size;
> +	rxfh->key = kzalloc(data->hkey_size, GFP_KERNEL);
> +	if (!rxfh->key)
> +		return -ENOMEM;
> +
> +	nla_memcpy(rxfh->key, tb[ETHTOOL_A_RSS_HKEY], rxfh->key_size);
> +
> +	*mod |= memcmp(rxfh->key, data->hkey, data->hkey_size);

ethnl_update_binary()?

> +
> +	return 0;
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ