diff mbox series

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

Message ID 20231006053706.514618-1-will@extrahop.com (mailing list archive)
State Accepted
Commit da6192ca72d5ad913d109d43dc896290ad05d98f
Delegated to: Netdev Maintainers
Headers show
Series net/mlx5e: Again mutually exclude RX-FCS and RX-port-timestamp | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1362 this patch: 1362
netdev/cc_maintainers warning 6 maintainers not CCed: linux-rdma@vger.kernel.org pabeni@redhat.com leon@kernel.org davem@davemloft.net edumazet@google.com kuba@kernel.org
netdev/build_clang fail Errors and warnings before: 17 this patch: 17
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn fail Errors and warnings before: 17 this patch: 17
netdev/checkpatch warning WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: 1e66220948df ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change")'
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Will Mortensen Oct. 6, 2023, 5:37 a.m. UTC
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")
Tested-by: Charlotte Tan <charlotte@extrahop.com>
Reviewed-by: Charlotte Tan <charlotte@extrahop.com>
Cc: Adham Faris <afaris@nvidia.com>
Cc: Aya Levin <ayal@nvidia.com>
Cc: Tariq Toukan <tariqt@nvidia.com>
Cc: Moshe Shemesh <moshe@nvidia.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Will Mortensen <will@extrahop.com>
---
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(-)

Comments

Tariq Toukan Oct. 10, 2023, 6:31 a.m. UTC | #1
On 06/10/2023 8:37, Will Mortensen 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.
> 

Thanks for your patch.

> Fixes: 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change")
> Tested-by: Charlotte Tan <charlotte@extrahop.com>
> Reviewed-by: Charlotte Tan <charlotte@extrahop.com>
> Cc: Adham Faris <afaris@nvidia.com>
> Cc: Aya Levin <ayal@nvidia.com>
> Cc: Tariq Toukan <tariqt@nvidia.com>
> Cc: Moshe Shemesh <moshe@nvidia.com>
> Cc: Saeed Mahameed <saeedm@nvidia.com>
> Signed-off-by: Will Mortensen <will@extrahop.com>
> ---
> 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.
> 

Please open the case and we'll analyze.

>   drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index a2ae791538ed..acb40770cf0c 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -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.

>   
>   	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;
>   }

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

Regards,
Tariq
Paolo Abeni Oct. 10, 2023, 8:52 a.m. UTC | #2
On Tue, 2023-10-10 at 09:31 +0300, Tariq Toukan wrote:
> 
> On 06/10/2023 8:37, Will Mortensen 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.
> > 
> 
> Thanks for your patch.
> 
> > Fixes: 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change")
> > Tested-by: Charlotte Tan <charlotte@extrahop.com>
> > Reviewed-by: Charlotte Tan <charlotte@extrahop.com>
> > Cc: Adham Faris <afaris@nvidia.com>
> > Cc: Aya Levin <ayal@nvidia.com>
> > Cc: Tariq Toukan <tariqt@nvidia.com>
> > Cc: Moshe Shemesh <moshe@nvidia.com>
> > Cc: Saeed Mahameed <saeedm@nvidia.com>
> > Signed-off-by: Will Mortensen <will@extrahop.com>
> > ---
> > 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.
> > 
> 
> Please open the case and we'll analyze.
> 
> >   drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > index a2ae791538ed..acb40770cf0c 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> > @@ -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.
> 
> >   
> >   	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;
> >   }
> 
> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

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

Thanks,

Paolo
Tariq Toukan Oct. 10, 2023, 10:50 a.m. UTC | #3
On 10/10/2023 11:52, Paolo Abeni wrote:
> On Tue, 2023-10-10 at 09:31 +0300, Tariq Toukan wrote:
>>
>> On 06/10/2023 8:37, Will Mortensen 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.
>>>
>>
>> Thanks for your patch.
>>
>>> Fixes: 1e66220948df8 ("net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change")
>>> Tested-by: Charlotte Tan <charlotte@extrahop.com>
>>> Reviewed-by: Charlotte Tan <charlotte@extrahop.com>
>>> Cc: Adham Faris <afaris@nvidia.com>
>>> Cc: Aya Levin <ayal@nvidia.com>
>>> Cc: Tariq Toukan <tariqt@nvidia.com>
>>> Cc: Moshe Shemesh <moshe@nvidia.com>
>>> Cc: Saeed Mahameed <saeedm@nvidia.com>
>>> Signed-off-by: Will Mortensen <will@extrahop.com>
>>> ---
>>> 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.
>>>
>>
>> Please open the case and we'll analyze.
>>
>>>    drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
>>> index a2ae791538ed..acb40770cf0c 100644
>>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
>>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
>>> @@ -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.
>>
>>>    
>>>    	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;
>>>    }
>>
>> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
> 
> @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
patchwork-bot+netdevbpf@kernel.org Oct. 10, 2023, 1:30 p.m. UTC | #4
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index a2ae791538ed..acb40770cf0c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -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;
 }