diff mbox series

[iwl-next,v1] i40e: Clear stats after deleting tc

Message ID 20230724094319.57359-1-jedrzej.jagielski@intel.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [iwl-next,v1] i40e: Clear stats after deleting tc | 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: 1342 this patch: 1342
netdev/cc_maintainers warning 5 maintainers not CCed: kuba@kernel.org jesse.brandeburg@intel.com davem@davemloft.net pabeni@redhat.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 1365 this patch: 1365
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 No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1365 this patch: 1365
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jedrzej Jagielski July 24, 2023, 9:43 a.m. UTC
From: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>

There was an issue with ethtool stats that
have not been cleared after tc had been deleted.

Fix this by resetting stats after deleting tc
by calling i40e_vsi_reset_stats() function after
distroying qdisc.

Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Simon Horman July 25, 2023, 12:25 p.m. UTC | #1
On Mon, Jul 24, 2023 at 11:43:19AM +0200, Jedrzej Jagielski wrote:
> From: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
> 
> There was an issue with ethtool stats that
> have not been cleared after tc had been deleted.

I think it would be good to elaborate on what the issue is,
perhaps with an example. I think this should be added to
the patch description.

> Fix this by resetting stats after deleting tc
> by calling i40e_vsi_reset_stats() function after
> distroying qdisc.
> 
> Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 29ad1797adce..6f604bfe7437 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -5885,6 +5885,11 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
>  
>  	/* Update the netdev TC setup */
>  	i40e_vsi_config_netdev_tc(vsi, enabled_tc);
> +
> +	/* After distroying qdisc reset all stats of the vsi */

nit: distroying -> destroying

> +	if (!vsi->mqprio_qopt.qopt.hw)
> +		i40e_vsi_reset_stats(vsi);
> +
>  out:
>  	return ret;
>  }
Jedrzej Jagielski July 26, 2023, 9:23 a.m. UTC | #2
From: Simon Horman <simon.horman@corigine.com> 
Sent: Tue, 25 July 2023 14:25
>On Mon, Jul 24, 2023 at 11:43:19AM +0200, Jedrzej Jagielski wrote:
>> From: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
>> 
>> There was an issue with ethtool stats that
>> have not been cleared after tc had been deleted.
>
>I think it would be good to elaborate on what the issue is,
>perhaps with an example. I think this should be added to
>the patch description.

OK, I will provide more details

>
>> Fix this by resetting stats after deleting tc
>> by calling i40e_vsi_reset_stats() function after
>> distroying qdisc.
>> 
>> Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
>> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
>> ---
>>  drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
>> index 29ad1797adce..6f604bfe7437 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
>> @@ -5885,6 +5885,11 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
>>  
>>  	/* Update the netdev TC setup */
>>  	i40e_vsi_config_netdev_tc(vsi, enabled_tc);
>> +
>> +	/* After distroying qdisc reset all stats of the vsi */
>
>nit: distroying -> destroying

Thanks for catching that

>
>> +	if (!vsi->mqprio_qopt.qopt.hw)
>> +		i40e_vsi_reset_stats(vsi);
>> +
>>  out:
>>  	return ret;
>>  }
>
>-- 
>pw-bot: changes-requested
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 29ad1797adce..6f604bfe7437 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5885,6 +5885,11 @@  static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
 
 	/* Update the netdev TC setup */
 	i40e_vsi_config_netdev_tc(vsi, enabled_tc);
+
+	/* After distroying qdisc reset all stats of the vsi */
+	if (!vsi->mqprio_qopt.qopt.hw)
+		i40e_vsi_reset_stats(vsi);
+
 out:
 	return ret;
 }