Skip to contentSkip to conversation

Symmetric OR-XOR RSS hash

PATCH Superseded Gal Pressman 4 participants 11 messages Feb 5, 2025 – Feb 12, 2025

Subsystems (7)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover Symmetric OR-XOR RSS hash

Add support for a new type of input_xfrm: Symmetric OR-XOR. Symmetric OR-XOR performs hash as follows:
(SRC_IP | DST_IP, SRC_IP ^ DST_IP, SRC_PORT | DST_PORT, SRC_PORT ^ DST_PORT)

Configuration is done through ethtool -x/X command.
For mlx5, the default is already symmetric hash, this patch now exposes this to userspace and allows enabling/disabling of the feature.

Thanks,
Gal

Changelog -
v1->v2: https://lore.kernel.org/all/[email protected]/
* Fix wording in comments (Edward)

Gal Pressman (2):
ethtool: Symmetric OR-XOR RSS hash
net/mlx5e: Symmetric OR-XOR RSS hash control

 Documentation/networking/ethtool-netlink.rst    |  2 +-
 Documentation/networking/scaling.rst            | 14 ++++++++++----
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c  |  2 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c    |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en/rss.c    | 13 +++++++++++--
 .../net/ethernet/mellanox/mlx5/core/en/rss.h    |  4 ++--
 .../net/ethernet/mellanox/mlx5/core/en/rx_res.c | 11 ++++++-----
 .../net/ethernet/mellanox/mlx5/core/en/rx_res.h |  5 +++--
 .../net/ethernet/mellanox/mlx5/core/en/tir.c    |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en/tir.h    |  1 +
 .../ethernet/mellanox/mlx5/core/en_ethtool.c    | 17 ++++++++++++++---
 include/linux/ethtool.h                         |  5 ++---
 include/uapi/linux/ethtool.h                    |  4 ++++
 net/ethtool/ioctl.c                             |  8 ++++----
 14 files changed, 61 insertions(+), 29 deletions(-)
Signature · 1 line
2.40.1
#1 lore raw

PATCH v2 1/2 ethtool: Symmetric OR-XOR RSS hash

Add an additional type of symmetric RSS hash type: OR-XOR. The "Symmetric-OR-XOR" algorithm transforms the input as follows:

(SRC_IP | DST_IP, SRC_IP ^ DST_IP, SRC_PORT | DST_PORT, SRC_PORT ^ DST_PORT)

Change 'cap_rss_sym_xor_supported' to 'supported_input_xfrm', a bitmap of supported RXH_XFRM_* types.

---
 Documentation/networking/ethtool-netlink.rst   |  2 +-
 Documentation/networking/scaling.rst           | 14 ++++++++++----
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c |  2 +-
 drivers/net/ethernet/intel/ice/ice_ethtool.c   |  2 +-
 include/linux/ethtool.h                        |  5 ++---
 include/uapi/linux/ethtool.h                   |  4 ++++
 net/ethtool/ioctl.c                            |  8 ++++----
 7 files changed, 23 insertions(+), 14 deletions(-)
Documentation/networking/ethtool-netlink.rst +1 -1
index 3770a2294509..b6e9af4d0f1b 100644
@@ -1934,7 +1934,7 @@ ETHTOOL_A_RSS_INDIR attribute returns RSS indirection table where each byte
 indicates queue number.
 ETHTOOL_A_RSS_INPUT_XFRM attribute is a bitmap indicating the type of
 transformation applied to the input protocol fields before given to the RSS
-hfunc. Current supported option is symmetric-xor.
+hfunc. Current supported options are symmetric-xor and symmetric-or-xor.
 
 PLCA_GET_CFG
 ============
Documentation/networking/scaling.rst +10 -4
index 4eb50bcb9d42..d8971ce07628 100644
@@ -49,14 +49,20 @@ destination address) and TCP/UDP (source port, destination port) tuples
 are swapped, the computed hash is the same. This is beneficial in some
 applications that monitor TCP/IP flows (IDS, firewalls, ...etc) and need
 both directions of the flow to land on the same Rx queue (and CPU). The
-"Symmetric-XOR" is a type of RSS algorithms that achieves this hash
-symmetry by XORing the input source and destination fields of the IP
-and/or L4 protocols. This, however, results in reduced input entropy and
-could potentially be exploited. Specifically, the algorithm XORs the input
+"Symmetric-XOR" and "Symmetric-OR-XOR" are types of RSS algorithms that
+achieve this hash symmetry by XOR/ORing the input source and destination
+fields of the IP and/or L4 protocols. This, however, results in reduced
+input entropy and could potentially be exploited.
+
+Specifically, the "Symmetric-XOR" algorithm XORs the input
 as follows::
 
     # (SRC_IP ^ DST_IP, SRC_IP ^ DST_IP, SRC_PORT ^ DST_PORT, SRC_PORT ^ DST_PORT)
 
+The "Symmetric-OR-XOR" algorithm transforms the input as follows::
+
+    # (SRC_IP | DST_IP, SRC_IP ^ DST_IP, SRC_PORT | DST_PORT, SRC_PORT ^ DST_PORT)
+
 The result is then fed to the underlying RSS algorithm.
 
 Some advanced NICs allow steering packets to queues based on
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +1 -1
index 74a1e9fe1821..288bb5b2e72e 100644
@@ -1808,7 +1808,7 @@ static int iavf_set_rxfh(struct net_device *netdev,
 static const struct ethtool_ops iavf_ethtool_ops = {
 	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
 				     ETHTOOL_COALESCE_USE_ADAPTIVE,
-	.cap_rss_sym_xor_supported = true,
+	.supported_input_xfrm	= RXH_XFRM_SYM_XOR,
 	.get_drvinfo		= iavf_get_drvinfo,
 	.get_link		= ethtool_op_get_link,
 	.get_ringparam		= iavf_get_ringparam,
drivers/net/ethernet/intel/ice/ice_ethtool.c +1 -1
index 3072634bf049..a02ce2cea852 100644
@@ -4774,7 +4774,7 @@ static const struct ethtool_ops ice_ethtool_ops = {
 	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
 				     ETHTOOL_COALESCE_USE_ADAPTIVE |
 				     ETHTOOL_COALESCE_RX_USECS_HIGH,
-	.cap_rss_sym_xor_supported = true,
+	.supported_input_xfrm	= RXH_XFRM_SYM_XOR,
 	.rxfh_per_ctx_key	= true,
 	.get_link_ksettings	= ice_get_link_ksettings,
 	.set_link_ksettings	= ice_set_link_ksettings,
include/linux/ethtool.h +2 -3
index 870994cc3ef7..0548745d1c36 100644
@@ -768,8 +768,7 @@ struct kernel_ethtool_ts_info {
  * @cap_rss_ctx_supported: indicates if the driver supports RSS
  *	contexts via legacy API, drivers implementing @create_rxfh_context
  *	do not have to set this bit.
- * @cap_rss_sym_xor_supported: indicates if the driver supports symmetric-xor
- *	RSS.
+ * @supported_input_xfrm: supported types of input xfrm from %RXH_XFRM_*.
  * @rxfh_per_ctx_key: device supports setting different RSS key for each
  *	additional context. Netlink API should report hfunc, key, and input_xfrm
  *	for every context, not just context 0.
@@ -997,7 +996,7 @@ struct kernel_ethtool_ts_info {
 struct ethtool_ops {
 	u32     cap_link_lanes_supported:1;
 	u32     cap_rss_ctx_supported:1;
-	u32	cap_rss_sym_xor_supported:1;
+	u32	supported_input_xfrm:8;
 	u32	rxfh_per_ctx_key:1;
 	u32	cap_rss_rxnfc_adds:1;
 	u32	rxfh_indir_space;
include/uapi/linux/ethtool.h +4 -0
index d1089b88efc7..2909ac3a3357 100644
@@ -2269,6 +2269,10 @@ static inline int ethtool_validate_duplex(__u8 duplex)
  * be exploited to reduce the RSS queue spread.
  */
 #define	RXH_XFRM_SYM_XOR	(1 << 0)
+/* Similar to SYM_XOR, except that one copy of the XOR'ed fields is replaced by
+ * an OR of the same fields
+ */
+#define	RXH_XFRM_SYM_OR_XOR	(1 << 1)
 #define	RXH_XFRM_NO_CHANGE	0xff
 
 /* L2-L4 network traffic flow types */
net/ethtool/ioctl.c +4 -4
index 7bb94875a7ec..3829e24f9c4c 100644
@@ -1005,11 +1005,11 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
 		if (rc)
 			return rc;
 
-		/* Sanity check: if symmetric-xor is set, then:
+		/* Sanity check: if symmetric-xor/symmetric-or-xor is set, then:
 		 * 1 - no other fields besides IP src/dst and/or L4 src/dst
 		 * 2 - If src is set, dst must also be set
 		 */
-		if ((rxfh.input_xfrm & RXH_XFRM_SYM_XOR) &&
+		if ((rxfh.input_xfrm & (RXH_XFRM_SYM_XOR | RXH_XFRM_SYM_OR_XOR)) &&
 		    ((info.data & ~(RXH_IP_SRC | RXH_IP_DST |
 				    RXH_L4_B_0_1 | RXH_L4_B_2_3)) ||
 		     (!!(info.data & RXH_IP_SRC) ^ !!(info.data & RXH_IP_DST)) ||
@@ -1382,11 +1382,11 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
 		return -EOPNOTSUPP;
 	/* Check input data transformation capabilities */
 	if (rxfh.input_xfrm && rxfh.input_xfrm != RXH_XFRM_SYM_XOR &&
+	    rxfh.input_xfrm != RXH_XFRM_SYM_OR_XOR &&
 	    rxfh.input_xfrm != RXH_XFRM_NO_CHANGE)
 		return -EINVAL;
 	if (rxfh.input_xfrm != RXH_XFRM_NO_CHANGE &&
-	    (rxfh.input_xfrm & RXH_XFRM_SYM_XOR) &&
-	    !ops->cap_rss_sym_xor_supported)
+	    rxfh.input_xfrm & ~ops->supported_input_xfrm)
 		return -EOPNOTSUPP;
 	create = rxfh.rss_context == ETH_RXFH_CONTEXT_ALLOC;
 
Signature · 1 line
2.40.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH net-next v2 1/2] ethtool: Symmetric OR-XOR RSS hash

Quoted 11 lines · Gal Pressman

Add an additional type of symmetric RSS hash type: OR-XOR. The "Symmetric-OR-XOR" algorithm transforms the input as follows:

(SRC_IP | DST_IP, SRC_IP ^ DST_IP, SRC_PORT | DST_PORT, SRC_PORT ^ DST_PORT)

Change 'cap_rss_sym_xor_supported' to 'supported_input_xfrm', a bitmap of supported RXH_XFRM_* types.

maintainer
#3 lore raw

Re: [PATCH net-next v2 1/2] ethtool: Symmetric OR-XOR RSS hash

In reply to Gal Pressman

include/linux/ethtool.h struct kernel_ethtool_ts_info { · line 1002

Quoted 9 lines · On Wed, 5 Feb 2025 15:53:40 +0200 Gal Pressman wrote:
include/linux/ethtool.h +1 -1
@@ -997,7 +996,7 @@ struct kernel_ethtool_ts_info {
 struct ethtool_ops {
 	u32     cap_link_lanes_supported:1;
 	u32     cap_rss_ctx_supported:1;
-	u32	cap_rss_sym_xor_supported:1;
+	u32	supported_input_xfrm:8;
 	u32	rxfh_per_ctx_key:1;
 	u32	cap_rss_rxnfc_adds:1;
 	u32	rxfh_indir_space;

reorder the fields, please, so the 8b one is aligned to a byte

#4 lore raw

Re: [PATCH net-next v2 1/2] ethtool: Symmetric OR-XOR RSS hash

Quoted 12 lines · Jakub Kicinski

include/linux/ethtool.h struct kernel_ethtool_ts_info { · line 1002

Quoted 9 lines · On Wed, 5 Feb 2025 15:53:40 +0200 Gal Pressman wrote:
include/linux/ethtool.h +1 -1
@@ -997,7 +996,7 @@ struct kernel_ethtool_ts_info {
 struct ethtool_ops {
 	u32     cap_link_lanes_supported:1;
 	u32     cap_rss_ctx_supported:1;
-	u32	cap_rss_sym_xor_supported:1;
+	u32	supported_input_xfrm:8;
 	u32	rxfh_per_ctx_key:1;
 	u32	cap_rss_rxnfc_adds:1;
 	u32	rxfh_indir_space;

reorder the fields, please, so the 8b one is aligned to a byte

Will do, thanks!

#5 lore raw

PATCH v2 2/2 net/mlx5e: Symmetric OR-XOR RSS hash control

In reply to Gal Pressman

Allow control over the symmetric RSS hash, which was previously set to enabled by default by the driver.

Symmetric OR-XOR RSS can now be queried and controlled using the 'ethtool -x/X' command.

---
 .../net/ethernet/mellanox/mlx5/core/en/rss.c    | 13 +++++++++++--
 .../net/ethernet/mellanox/mlx5/core/en/rss.h    |  4 ++--
 .../net/ethernet/mellanox/mlx5/core/en/rx_res.c | 11 ++++++-----
 .../net/ethernet/mellanox/mlx5/core/en/rx_res.h |  5 +++--
 .../net/ethernet/mellanox/mlx5/core/en/tir.c    |  2 +-
 .../net/ethernet/mellanox/mlx5/core/en/tir.h    |  1 +
 .../ethernet/mellanox/mlx5/core/en_ethtool.c    | 17 ++++++++++++++---
 7 files changed, 38 insertions(+), 15 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/rss.c +11 -2
index 5f742f896600..71a2d0835974 100644
@@ -156,6 +156,7 @@ static void mlx5e_rss_params_init(struct mlx5e_rss *rss)
 {
 	enum mlx5_traffic_types tt;
 
+	rss->hash.symmetric = true;
 	rss->hash.hfunc = ETH_RSS_HASH_TOP;
 	netdev_rss_key_fill(rss->hash.toeplitz_hash_key,
 			    sizeof(rss->hash.toeplitz_hash_key));
@@ -551,7 +552,7 @@ int mlx5e_rss_packet_merge_set_param(struct mlx5e_rss *rss,
 	return final_err;
 }
 
-int mlx5e_rss_get_rxfh(struct mlx5e_rss *rss, u32 *indir, u8 *key, u8 *hfunc)
+int mlx5e_rss_get_rxfh(struct mlx5e_rss *rss, u32 *indir, u8 *key, u8 *hfunc, bool *symmetric)
 {
 	if (indir)
 		memcpy(indir, rss->indir.table,
@@ -564,11 +565,14 @@ int mlx5e_rss_get_rxfh(struct mlx5e_rss *rss, u32 *indir, u8 *key, u8 *hfunc)
 	if (hfunc)
 		*hfunc = rss->hash.hfunc;
 
+	if (symmetric)
+		*symmetric = rss->hash.symmetric;
+
 	return 0;
 }
 
 int mlx5e_rss_set_rxfh(struct mlx5e_rss *rss, const u32 *indir,
-		       const u8 *key, const u8 *hfunc,
+		       const u8 *key, const u8 *hfunc, const bool *symmetric,
 		       u32 *rqns, u32 *vhca_ids, unsigned int num_rqns)
 {
 	bool changed_indir = false;
@@ -608,6 +612,11 @@ int mlx5e_rss_set_rxfh(struct mlx5e_rss *rss, const u32 *indir,
 		       rss->indir.actual_table_size * sizeof(*rss->indir.table));
 	}
 
+	if (symmetric) {
+		rss->hash.symmetric = *symmetric;
+		changed_hash = true;
+	}
+
 	if (changed_indir && rss->enabled) {
 		err = mlx5e_rss_apply(rss, rqns, vhca_ids, num_rqns);
 		if (err) {
drivers/net/ethernet/mellanox/mlx5/core/en/rss.h +2 -2
index d0df98963c8d..9e4f50f194db 100644
@@ -44,9 +44,9 @@ void mlx5e_rss_disable(struct mlx5e_rss *rss);
 
 int mlx5e_rss_packet_merge_set_param(struct mlx5e_rss *rss,
 				     struct mlx5e_packet_merge_param *pkt_merge_param);
-int mlx5e_rss_get_rxfh(struct mlx5e_rss *rss, u32 *indir, u8 *key, u8 *hfunc);
+int mlx5e_rss_get_rxfh(struct mlx5e_rss *rss, u32 *indir, u8 *key, u8 *hfunc, bool *symmetric);
 int mlx5e_rss_set_rxfh(struct mlx5e_rss *rss, const u32 *indir,
-		       const u8 *key, const u8 *hfunc,
+		       const u8 *key, const u8 *hfunc, const bool *symmetric,
 		       u32 *rqns, u32 *vhca_ids, unsigned int num_rqns);
 struct mlx5e_rss_params_hash mlx5e_rss_get_hash(struct mlx5e_rss *rss);
 u8 mlx5e_rss_get_hash_fields(struct mlx5e_rss *rss, enum mlx5_traffic_types tt);
drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.c +6 -5
index a86eade9a9e0..b64b814ee25c 100644
@@ -196,7 +196,7 @@ void mlx5e_rx_res_rss_set_indir_uniform(struct mlx5e_rx_res *res, unsigned int n
 }
 
 int mlx5e_rx_res_rss_get_rxfh(struct mlx5e_rx_res *res, u32 rss_idx,
-			      u32 *indir, u8 *key, u8 *hfunc)
+			      u32 *indir, u8 *key, u8 *hfunc, bool *symmetric)
 {
 	struct mlx5e_rss *rss;
 
@@ -207,11 +207,12 @@ int mlx5e_rx_res_rss_get_rxfh(struct mlx5e_rx_res *res, u32 rss_idx,
 	if (!rss)
 		return -ENOENT;
 
-	return mlx5e_rss_get_rxfh(rss, indir, key, hfunc);
+	return mlx5e_rss_get_rxfh(rss, indir, key, hfunc, symmetric);
 }
 
 int mlx5e_rx_res_rss_set_rxfh(struct mlx5e_rx_res *res, u32 rss_idx,
-			      const u32 *indir, const u8 *key, const u8 *hfunc)
+			      const u32 *indir, const u8 *key, const u8 *hfunc,
+			      const bool *symmetric)
 {
 	u32 *vhca_ids = get_vhca_ids(res, 0);
 	struct mlx5e_rss *rss;
@@ -223,8 +224,8 @@ int mlx5e_rx_res_rss_set_rxfh(struct mlx5e_rx_res *res, u32 rss_idx,
 	if (!rss)
 		return -ENOENT;
 
-	return mlx5e_rss_set_rxfh(rss, indir, key, hfunc, res->rss_rqns, vhca_ids,
-				  res->rss_nch);
+	return mlx5e_rss_set_rxfh(rss, indir, key, hfunc, symmetric,
+				  res->rss_rqns, vhca_ids, res->rss_nch);
 }
 
 int mlx5e_rx_res_rss_get_hash_fields(struct mlx5e_rx_res *res, u32 rss_idx,
drivers/net/ethernet/mellanox/mlx5/core/en/rx_res.h +3 -2
index 7b1a9f0f1874..c2f510a2282b 100644
@@ -44,9 +44,10 @@ void mlx5e_rx_res_xsk_update(struct mlx5e_rx_res *res, struct mlx5e_channels *ch
 /* Configuration API */
 void mlx5e_rx_res_rss_set_indir_uniform(struct mlx5e_rx_res *res, unsigned int nch);
 int mlx5e_rx_res_rss_get_rxfh(struct mlx5e_rx_res *res, u32 rss_idx,
-			      u32 *indir, u8 *key, u8 *hfunc);
+			      u32 *indir, u8 *key, u8 *hfunc, bool *symmetric);
 int mlx5e_rx_res_rss_set_rxfh(struct mlx5e_rx_res *res, u32 rss_idx,
-			      const u32 *indir, const u8 *key, const u8 *hfunc);
+			      const u32 *indir, const u8 *key, const u8 *hfunc,
+			      const bool *symmetric);
 
 int mlx5e_rx_res_rss_get_hash_fields(struct mlx5e_rx_res *res, u32 rss_idx,
 				     enum mlx5_traffic_types tt);
drivers/net/ethernet/mellanox/mlx5/core/en/tir.c +1 -1
index 11f724ad90db..19499072f67f 100644
@@ -124,7 +124,7 @@ void mlx5e_tir_builder_build_rss(struct mlx5e_tir_builder *builder,
 		const size_t len = MLX5_FLD_SZ_BYTES(tirc, rx_hash_toeplitz_key);
 		void *rss_key = MLX5_ADDR_OF(tirc, tirc, rx_hash_toeplitz_key);
 
-		MLX5_SET(tirc, tirc, rx_hash_symmetric, 1);
+		MLX5_SET(tirc, tirc, rx_hash_symmetric, rss_hash->symmetric);
 		memcpy(rss_key, rss_hash->toeplitz_hash_key, len);
 	}
 
drivers/net/ethernet/mellanox/mlx5/core/en/tir.h +1 -0
index 857a84bcd53a..e8df3aaf6562 100644
@@ -9,6 +9,7 @@
 struct mlx5e_rss_params_hash {
 	u8 hfunc;
 	u8 toeplitz_hash_key[40];
+	bool symmetric;
 };
 
 struct mlx5e_rss_params_traffic_type {
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +14 -3
index cae39198b4db..2c88b65853f8 100644
@@ -1458,18 +1458,27 @@ static int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *
 {
 	struct mlx5e_priv *priv = netdev_priv(netdev);
 	u32 rss_context = rxfh->rss_context;
+	bool symmetric;
 	int err;
 
 	mutex_lock(&priv->state_lock);
 	err = mlx5e_rx_res_rss_get_rxfh(priv->rx_res, rss_context,
-					rxfh->indir, rxfh->key, &rxfh->hfunc);
+					rxfh->indir, rxfh->key, &rxfh->hfunc, &symmetric);
 	mutex_unlock(&priv->state_lock);
-	return err;
+
+	if (err)
+		return err;
+
+	if (symmetric)
+		rxfh->input_xfrm = RXH_XFRM_SYM_OR_XOR;
+
+	return 0;
 }
 
 static int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
 			  struct netlink_ext_ack *extack)
 {
+	bool symmetric = rxfh->input_xfrm == RXH_XFRM_SYM_OR_XOR;
 	struct mlx5e_priv *priv = netdev_priv(dev);
 	u32 *rss_context = &rxfh->rss_context;
 	u8 hfunc = rxfh->hfunc;
@@ -1504,7 +1513,8 @@ static int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxf
 
 	err = mlx5e_rx_res_rss_set_rxfh(priv->rx_res, *rss_context,
 					rxfh->indir, rxfh->key,
-					hfunc == ETH_RSS_HASH_NO_CHANGE ? NULL : &hfunc);
+					hfunc == ETH_RSS_HASH_NO_CHANGE ? NULL : &hfunc,
+					rxfh->input_xfrm == RXH_XFRM_NO_CHANGE ? NULL : &symmetric);
 
 unlock:
 	mutex_unlock(&priv->state_lock);
@@ -2613,6 +2623,7 @@ const struct ethtool_ops mlx5e_ethtool_ops = {
 				     ETHTOOL_COALESCE_MAX_FRAMES |
 				     ETHTOOL_COALESCE_USE_ADAPTIVE |
 				     ETHTOOL_COALESCE_USE_CQE,
+	.supported_input_xfrm = RXH_XFRM_SYM_OR_XOR,
 	.get_drvinfo       = mlx5e_get_drvinfo,
 	.get_link          = ethtool_op_get_link,
 	.get_link_ext_state  = mlx5e_get_link_ext_state,
Signature · 1 line
2.40.1
maintainer
#6 lore raw
In reply to Gal Pressman
Quoted 7 lines · On Wed, 5 Feb 2025 15:53:39 +0200 Gal Pressman wrote:

Add support for a new type of input_xfrm: Symmetric OR-XOR. Symmetric OR-XOR performs hash as follows:
(SRC_IP | DST_IP, SRC_IP ^ DST_IP, SRC_PORT | DST_PORT, SRC_PORT ^ DST_PORT)

Configuration is done through ethtool -x/X command.
For mlx5, the default is already symmetric hash, this patch now exposes this to userspace and allows enabling/disabling of the feature.

Please add a selftest (hw-only is fine, netdevsim can't do flow hashing).

Signature · 1 line
pw-bot: cr
#7 lore raw
Quoted 11 lines · Jakub Kicinski
Quoted 7 lines · On Wed, 5 Feb 2025 15:53:39 +0200 Gal Pressman wrote:

Add support for a new type of input_xfrm: Symmetric OR-XOR. Symmetric OR-XOR performs hash as follows:
(SRC_IP | DST_IP, SRC_IP ^ DST_IP, SRC_PORT | DST_PORT, SRC_PORT ^ DST_PORT)

Configuration is done through ethtool -x/X command.
For mlx5, the default is already symmetric hash, this patch now exposes this to userspace and allows enabling/disabling of the feature.

Please add a selftest (hw-only is fine, netdevsim can't do flow hashing).

I don't understand the rationale, the new input_xfrm field didn't deserve a selftest, why does a new value to the field does?

Testing this would require new userspace ethtool (which has not been submitted yet), I don't think it's wise to implement a test before the user interface/output is merged.

I assume you want an additional case in rss_ctx.py?

maintainer
#8 lore raw
Quoted 2 lines · On Sun, 9 Feb 2025 09:59:22 +0200 Gal Pressman wrote:

I don't understand the rationale, the new input_xfrm field didn't deserve a selftest, why does a new value to the field does?

Ahmed and Sudheer added ETHTOOL_MSG_RSS_GET as part of their work. Everyone pays off a little bit of technical debt to get their feature in.

I don't appreciate your reaction. Please stop acting as if nVidia was a victim of some grand conspiracy within netdev.

Quoted 3 lines

Testing this would require new userspace ethtool (which has not been submitted yet), I don't think it's wise to implement a test before the user interface/output is merged.

No it doesn't. You can call netlink directly from Python or C.

Quoted 1 line

I assume you want an additional case in rss_ctx.py?

No, separate test.

#9 lore raw
Quoted 7 lines · Jakub Kicinski
Quoted 2 lines · On Sun, 9 Feb 2025 09:59:22 +0200 Gal Pressman wrote:

I don't understand the rationale, the new input_xfrm field didn't deserve a selftest, why does a new value to the field does?

Ahmed and Sudheer added ETHTOOL_MSG_RSS_GET as part of their work. Everyone pays off a little bit of technical debt to get their feature in.

I agree with the idea that extensions to ethtool uapi should be accompanied by conversion to netlink.

I don't see a connection to testing. If a maintainer has certain expectations about which changes require tests, it should be documented and enforced so it's not up to the maintainer's mood. FWIW, I don't believe kernel contributions should be blocked by lack of a test.

Quoted 3 lines

I don't appreciate your reaction. Please stop acting as if nVidia was a victim of some grand conspiracy within netdev.

I don't know what you're talking about, you've mistaken me for someone else..

Quoted 10 lines
Quoted 4 lines

Testing this would require new userspace ethtool (which has not been submitted yet), I don't think it's wise to implement a test before the user interface/output is merged.

No it doesn't. You can call netlink directly from Python or C.

Quoted 1 line

I assume you want an additional case in rss_ctx.py?

No, separate test.

Will address in v3.

#10 lore raw
Quoted 9 lines · Gal Pressman
Quoted 7 lines · Jakub Kicinski
Quoted 2 lines · On Sun, 9 Feb 2025 09:59:22 +0200 Gal Pressman wrote:

I don't understand the rationale, the new input_xfrm field didn't deserve a selftest, why does a new value to the field does?

Ahmed and Sudheer added ETHTOOL_MSG_RSS_GET as part of their work. Everyone pays off a little bit of technical debt to get their feature in.

Quoted 11 lines

I agree with the idea that extensions to ethtool uapi should be accompanied by conversion to netlink.

I don't see a connection to testing. If a maintainer has certain expectations about which changes require tests, it should be documented and enforced so it's not up to the maintainer's mood. FWIW, I don't believe kernel contributions should be blocked by lack of a test.

Quoted 3 lines

I don't appreciate your reaction. Please stop acting as if nVidia was a victim of some grand conspiracy within netdev.

The main problem is the tone in theses responses, we appreciate your reviews and comments, but sometimes the responses and comments are a bit too hostile.

Quoted 4 lines

I don't know what you're talking about, you've mistaken me for someone else..

Misunderstanding ? ..

Gal's response was technical, objective and free from any "I'm a victim" complaints, so I get why he's confused.

I understand that there's some friction going on with a few nVidia WIP features, but there's no reasons for comments and reactions to not remain in the technical realm.

Anyway I am happy to discuss all open issues and misunderstandings offline. All we need is to just align expectations and work towards a shared plan and a maintainer vs contributor friendly policy.

LKM.