Skip to contentSkip to conversation

net/mlx5e: Again mutually exclude RX-FCS and RX-port-timestamp

PATCH Applied Will Mortensen 4 participants 5 messages Oct 6, 2023 – Oct 10, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5e: Again mutually exclude RX-FCS and RX-port-timestamp

Commit 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change") seems to have accidentally inverted the logic added in commit 0bc73ad46a76 ("net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp").

The impact of this is a little unclear since it seems the FCS scattered with RX-FCS is (usually?) correct regardless.

Fixes 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change")
Cc Adham Faris <[email protected]>
Cc Aya Levin <[email protected]>
Cc Tariq Toukan <[email protected]>
Cc Moshe Shemesh <[email protected]>
Cc Saeed Mahameed <[email protected]>

---
For what it's worth, regardless of this change the PCMR register behaves unexpectedly in our testing on NICs where rx_ts_over_crc_cap is 1 (i.e. where rx_ts_over_crc is supported), such as ConnectX-7 running firmware 28.37.1014. For example, fcs_chk is always 0, and rx_ts_over_crc can never be set to 1 after being set to 0. On ConnectX-5, where rx_ts_over_crc_cap is 0, fcs_chk behaves as expected.

We'll probably be opening a support case about that after we test more, but I mention it here because it makes FCS-related testing confusing.

 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +2 -1
index a2ae791538ed..acb40770cf0c 100644
@@ -3952,13 +3952,14 @@ static int set_feature_rx_fcs(struct net_device *netdev, bool enable)
 	struct mlx5e_channels *chs = &priv->channels;
 	struct mlx5e_params new_params;
 	int err;
+	bool rx_ts_over_crc = !enable;
 
 	mutex_lock(&priv->state_lock);
 
 	new_params = chs->params;
 	new_params.scatter_fcs_en = enable;
 	err = mlx5e_safe_switch_params(priv, &new_params, mlx5e_set_rx_port_ts_wrap,
-				       &new_params.scatter_fcs_en, true);
+				       &rx_ts_over_crc, true);
 	mutex_unlock(&priv->state_lock);
 	return err;
 }
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Will Mortensen

Commit 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change") seems to have accidentally inverted the logic added in commit 0bc73ad46a76 ("net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp").

The impact of this is a little unclear since it seems the FCS scattered with RX-FCS is (usually?) correct regardless.

Thanks for your patch.

Quoted 17 lines
Fixes 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change")
Cc Adham Faris <[email protected]>
Cc Aya Levin <[email protected]>
Cc Tariq Toukan <[email protected]>
Cc Moshe Shemesh <[email protected]>
Cc Saeed Mahameed <[email protected]>

---
For what it's worth, regardless of this change the PCMR register behaves unexpectedly in our testing on NICs where rx_ts_over_crc_cap is 1 (i.e. where rx_ts_over_crc is supported), such as ConnectX-7 running firmware 28.37.1014. For example, fcs_chk is always 0, and rx_ts_over_crc can never be set to 1 after being set to 0. On ConnectX-5, where rx_ts_over_crc_cap is 0, fcs_chk behaves as expected.

Quoted 3 lines

We'll probably be opening a support case about that after we test more, but I mention it here because it makes FCS-related testing confusing.

Please open the case and we'll analyze.

drivers/net/ethernet/mellanox/mlx5/core/en_main.c static int set_feature_rx_fcs(struct net_device *netdev, bool enable) · line 3955

Quoted 12 lines
  drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -0
index a2ae791538ed..acb40770cf0c 100644
@@ -3952,13 +3952,14 @@ static int set_feature_rx_fcs(struct net_device *netdev, bool enable)
  	struct mlx5e_channels *chs = &priv->channels;
  	struct mlx5e_params new_params;
  	int err;
+	bool rx_ts_over_crc = !enable;

nit: Please maintain the reserved Christmas tree.

drivers/net/ethernet/mellanox/mlx5/core/en_main.c static int set_feature_rx_fcs(struct net_device *netdev, bool enable) · line 3965

Quoted 11 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -1
  	mutex_lock(&priv->state_lock);
 
  	new_params = chs->params;
  	new_params.scatter_fcs_en = enable;
  	err = mlx5e_safe_switch_params(priv, &new_params, mlx5e_set_rx_port_ts_wrap,
-				       &new_params.scatter_fcs_en, true);
+				       &rx_ts_over_crc, true);
  	mutex_unlock(&priv->state_lock);
  	return err;
  }

Regards,
Tariq

maintainer
#2 lore raw
Quoted 54 lines · Tariq Toukan
Quoted 8 lines · Will Mortensen

Commit 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change") seems to have accidentally inverted the logic added in commit 0bc73ad46a76 ("net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp").

The impact of this is a little unclear since it seems the FCS scattered with RX-FCS is (usually?) correct regardless.

Thanks for your patch.

Quoted 17 lines
Fixes 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change")
Cc Adham Faris <[email protected]>
Cc Aya Levin <[email protected]>
Cc Tariq Toukan <[email protected]>
Cc Moshe Shemesh <[email protected]>
Cc Saeed Mahameed <[email protected]>

---
For what it's worth, regardless of this change the PCMR register behaves unexpectedly in our testing on NICs where rx_ts_over_crc_cap is 1 (i.e. where rx_ts_over_crc is supported), such as ConnectX-7 running firmware 28.37.1014. For example, fcs_chk is always 0, and rx_ts_over_crc can never be set to 1 after being set to 0. On ConnectX-5, where rx_ts_over_crc_cap is 0, fcs_chk behaves as expected.

Quoted 3 lines

We'll probably be opening a support case about that after we test more, but I mention it here because it makes FCS-related testing confusing.

Please open the case and we'll analyze.

drivers/net/ethernet/mellanox/mlx5/core/en_main.c static int set_feature_rx_fcs(struct net_device *netdev, bool enable) · line 3955

Quoted 12 lines
  drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -0
index a2ae791538ed..acb40770cf0c 100644
@@ -3952,13 +3952,14 @@ static int set_feature_rx_fcs(struct net_device *netdev, bool enable)
  	struct mlx5e_channels *chs = &priv->channels;
  	struct mlx5e_params new_params;
  	int err;
+	bool rx_ts_over_crc = !enable;

nit: Please maintain the reserved Christmas tree.

Quoted 3 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 -0
  	mutex_lock(&priv->state_lock);
 
Quoted 10 lines

drivers/net/ethernet/mellanox/mlx5/core/en_main.c static int set_feature_rx_fcs(struct net_device *netdev, bool enable) · line 3965

Quoted 8 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -1
  	new_params = chs->params;
  	new_params.scatter_fcs_en = enable;
  	err = mlx5e_safe_switch_params(priv, &new_params, mlx5e_set_rx_port_ts_wrap,
-				       &new_params.scatter_fcs_en, true);
+				       &rx_ts_over_crc, true);
  	mutex_unlock(&priv->state_lock);
  	return err;
  }

@Tariq: do you prefer we will take this patch directly, or do you prefer send it with a later PR?

Thanks,

Paolo

#3 lore raw
Quoted 66 lines · Paolo Abeni
Quoted 54 lines · Tariq Toukan
Quoted 8 lines · Will Mortensen

Commit 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change") seems to have accidentally inverted the logic added in commit 0bc73ad46a76 ("net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp").

The impact of this is a little unclear since it seems the FCS scattered with RX-FCS is (usually?) correct regardless.

Thanks for your patch.

Quoted 17 lines
Fixes 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change")
Cc Adham Faris <[email protected]>
Cc Aya Levin <[email protected]>
Cc Tariq Toukan <[email protected]>
Cc Moshe Shemesh <[email protected]>
Cc Saeed Mahameed <[email protected]>

---
For what it's worth, regardless of this change the PCMR register behaves unexpectedly in our testing on NICs where rx_ts_over_crc_cap is 1 (i.e. where rx_ts_over_crc is supported), such as ConnectX-7 running firmware 28.37.1014. For example, fcs_chk is always 0, and rx_ts_over_crc can never be set to 1 after being set to 0. On ConnectX-5, where rx_ts_over_crc_cap is 0, fcs_chk behaves as expected.

Quoted 3 lines

We'll probably be opening a support case about that after we test more, but I mention it here because it makes FCS-related testing confusing.

Please open the case and we'll analyze.

drivers/net/ethernet/mellanox/mlx5/core/en_main.c static int set_feature_rx_fcs(struct net_device *netdev, bool enable) · line 3955

Quoted 12 lines
   drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -0
index a2ae791538ed..acb40770cf0c 100644
@@ -3952,13 +3952,14 @@ static int set_feature_rx_fcs(struct net_device *netdev, bool enable)
   	struct mlx5e_channels *chs = &priv->channels;
   	struct mlx5e_params new_params;
   	int err;
+	bool rx_ts_over_crc = !enable;

nit: Please maintain the reserved Christmas tree.

Quoted 3 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 -0
   	mutex_lock(&priv->state_lock);
 
Quoted 10 lines

drivers/net/ethernet/mellanox/mlx5/core/en_main.c static int set_feature_rx_fcs(struct net_device *netdev, bool enable) · line 3965

Quoted 8 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 -1
   	new_params = chs->params;
   	new_params.scatter_fcs_en = enable;
   	err = mlx5e_safe_switch_params(priv, &new_params, mlx5e_set_rx_port_ts_wrap,
-				       &new_params.scatter_fcs_en, true);
+				       &rx_ts_over_crc, true);
   	mutex_unlock(&priv->state_lock);
   	return err;
   }
Quoted 7 lines

@Tariq: do you prefer we will take this patch directly, or do you prefer send it with a later PR?

Thanks,

Paolo

Please take it.

Thanks,
Tariq

#4 lore raw
In reply to Will Mortensen
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 9 lines · On Thu, 5 Oct 2023 22:37:06 -0700 you wrote:

Commit 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change") seems to have accidentally inverted the logic added in commit 0bc73ad46a76 ("net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp").

The impact of this is a little unclear since it seems the FCS scattered with RX-FCS is (usually?) correct regardless.

[...]

Here is the summary with links:
- net/mlx5e: Again mutually exclude RX-FCS and RX-port-timestamp

    https://git.kernel.org/netdev/net/c/da6192ca72d5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html