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-next>] [day] [month] [year] [list]
Message-ID: <20250710173213.1638397-1-edward.cree@amd.com>
Date: Thu, 10 Jul 2025 18:32:13 +0100
From: <edward.cree@....com>
To: <linux-net-drivers@....com>, <davem@...emloft.net>, <kuba@...nel.org>,
	<edumazet@...gle.com>, <pabeni@...hat.com>, <andrew+netdev@...n.ch>
CC: Edward Cree <ecree.xilinx@...il.com>, <netdev@...r.kernel.org>
Subject: [PATCH net-next] sfc: falcon: refactor and document ef4_ethtool_get_rxfh_fields

From: Edward Cree <ecree.xilinx@...il.com>

The code had some rather odd control flow inherited from when it was
 shared with siena and ef10 before this driver was split out.
Simplify that for easier reading.
Also add a comment explaining why we return the values we do, since
 some Falcon documents and datasheets confusingly mention the part
 supporting 4-tuple UDP hashing.
(I couldn't find any record of exactly what was "broken" about the
 original Falcon A hash, I'm just trusting that falcon_init_rx_cfg()
 had a good reason for not using it.)

Signed-off-by: Edward Cree <ecree.xilinx@...il.com>
---
 drivers/net/ethernet/sfc/falcon/ethtool.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/sfc/falcon/ethtool.c b/drivers/net/ethernet/sfc/falcon/ethtool.c
index 6685e71ab13f..27d1cd6f24ca 100644
--- a/drivers/net/ethernet/sfc/falcon/ethtool.c
+++ b/drivers/net/ethernet/sfc/falcon/ethtool.c
@@ -948,9 +948,16 @@ ef4_ethtool_get_rxfh_fields(struct net_device *net_dev,
 			    struct ethtool_rxfh_fields *info)
 {
 	struct ef4_nic *efx = netdev_priv(net_dev);
-	unsigned int min_revision = 0;
 
 	info->data = 0;
+	/* Falcon A0 and A1 had a 4-tuple hash for TCP and UDP, but it was
+	 * broken so we do not enable it.
+	 * Falcon B0 adds a Toeplitz hash, 4-tuple for TCP and 2-tuple for
+	 * other IPv4, including UDP.
+	 * See falcon_init_rx_cfg().
+	 */
+	if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0)
+		return 0;
 	switch (info->flow_type) {
 	case TCP_V4_FLOW:
 		info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
@@ -960,13 +967,10 @@ ef4_ethtool_get_rxfh_fields(struct net_device *net_dev,
 	case AH_ESP_V4_FLOW:
 	case IPV4_FLOW:
 		info->data |= RXH_IP_SRC | RXH_IP_DST;
-		min_revision = EF4_REV_FALCON_B0;
 		break;
 	default:
 		break;
 	}
-	if (ef4_nic_rev(efx) < min_revision)
-		info->data = 0;
 	return 0;
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ