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]
Message-ID: <20251204103739.013d053b@kernel.org>
Date: Thu, 4 Dec 2025 10:37:39 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Frank Wunderlich <linux@...web.de>
Cc: Felix Fietkau <nbd@....name>, Sean Wang <sean.wang@...iatek.com>,
 Lorenzo Bianconi <lorenzo@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Matthias Brugger
 <matthias.bgg@...il.com>, AngeloGioacchino Del Regno
 <angelogioacchino.delregno@...labora.com>, Russell King
 <linux@...linux.org.uk>, Frank Wunderlich <frank-w@...lic-files.de>, Daniel
 Golle <daniel@...rotopia.org>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 linux-mediatek@...ts.infradead.org, Mason Chang
 <mason-cw.chang@...iatek.com>
Subject: Re: [RFC v2 2/3] net: ethernet: mtk_eth_soc: Add RSS support

On Thu,  4 Dec 2025 17:58:44 +0100 Frank Wunderlich wrote:
> +static int mtk_rss_init(struct mtk_eth *eth)
> +{
> +	const struct mtk_soc_data *soc = eth->soc;
> +	const struct mtk_reg_map *reg_map = eth->soc->reg_map;
> +	struct mtk_rss_params *rss_params = &eth->rss_params;
> +	static u8 hash_key[MTK_RSS_HASH_KEYSIZE] = {
> +		0xfa, 0x01, 0xac, 0xbe, 0x3b, 0xb7, 0x42, 0x6a,
> +		0x0c, 0xf2, 0x30, 0x80, 0xa3, 0x2d, 0xcb, 0x77,
> +		0xb4, 0x30, 0x7b, 0xae, 0xcb, 0x2b, 0xca, 0xd0,
> +		0xb0, 0x8f, 0xa3, 0x43, 0x3d, 0x25, 0x67, 0x41,
> +		0xc2, 0x0e, 0x5b, 0x25, 0xda, 0x56, 0x5a, 0x6d};
> +	u32 val;
> +	int i;
> +
> +	memcpy(rss_params->hash_key, hash_key, MTK_RSS_HASH_KEYSIZE);

netdev_rss_key_fill()

> +	for (i = 0; i < MTK_RSS_MAX_INDIRECTION_TABLE; i++)
> +		rss_params->indirection_table[i] = i % eth->soc->rss_num;

ethtool_rxfh_indir_default()

> +static int mtk_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh)
> +{
> +	struct mtk_mac *mac = netdev_priv(dev);
> +	struct mtk_eth *eth = mac->hw;
> +	struct mtk_rss_params *rss_params = &eth->rss_params;
> +	int i;
> +
> +	if (rxfh->hfunc)
> +		rxfh->hfunc = ETH_RSS_HASH_TOP;	/* Toeplitz */

hfunc is not a pointer, you should just set it?

> +	if (rxfh->key) {
> +		memcpy(rxfh->key, rss_params->hash_key,
> +		       sizeof(rss_params->hash_key));
> +	}
> +
> +	if (rxfh->indir) {
> +		for (i = 0; i < MTK_RSS_MAX_INDIRECTION_TABLE; i++)
> +			rxfh->indir[i] = rss_params->indirection_table[i];
> +	}
> +
> +	return 0;
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ