public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH iwl-net 0/2] ice: fix representor stats in switchdev mode
@ 2026-02-12  7:53 Petr Oros
  2026-02-12  7:53 ` [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors Petr Oros
  2026-02-12  7:53 ` [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats Petr Oros
  0 siblings, 2 replies; 11+ messages in thread
From: Petr Oros @ 2026-02-12  7:53 UTC (permalink / raw)
  To: netdev
  Cc: Petr Oros, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Michal Swiatkowski, Wojciech Drewek, Simon Horman,
	intel-wired-lan, linux-kernel

Port representor statistics in switchdev mode are completely broken due
to two independent bugs:

1) ice_repr_ready_vf() has inverted logic — it returns "not ready" when
   the VF is actually ready, causing all ethtool and ndo_get_stats64
   callbacks to bail out early.

2) Even with the readiness check fixed, ice_update_vsi_stats() always
   returns early for VF VSIs because ICE_VSI_DOWN is permanently set.
   The stats counters are never updated from hardware.

Patch 1 fixes the inverted readiness check.
Patch 2 switches to ice_update_eth_stats() which reads the GLV_*
hardware counters directly, matching what ice_get_vf_stats() already
does for VF stats in legacy mode.

Petr Oros (2):
  ice: fix inverted ready check for VF representors
  ice: use ice_update_eth_stats() for representor stats

 drivers/net/ethernet/intel/ice/ice_ethtool.c | 14 +++++++++++---
 drivers/net/ethernet/intel/ice/ice_repr.c    |  5 +++--
 2 files changed, 14 insertions(+), 5 deletions(-)

--
2.52.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors
  2026-02-12  7:53 [PATCH iwl-net 0/2] ice: fix representor stats in switchdev mode Petr Oros
@ 2026-02-12  7:53 ` Petr Oros
  2026-02-12  8:24   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2026-02-12  9:47   ` Michal Swiatkowski
  2026-02-12  7:53 ` [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats Petr Oros
  1 sibling, 2 replies; 11+ messages in thread
From: Petr Oros @ 2026-02-12  7:53 UTC (permalink / raw)
  To: netdev
  Cc: Petr Oros, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Michal Swiatkowski, Wojciech Drewek, Simon Horman,
	intel-wired-lan, linux-kernel

Commit 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")
refactored the VF readiness check into a generic repr->ops.ready()
callback but implemented ice_repr_ready_vf() with inverted logic:

  return !ice_check_vf_ready_for_cfg(repr->vf);

ice_check_vf_ready_for_cfg() returns 0 on success, so the negation
makes ready() return non-zero when the VF is ready. All callers treat
non-zero as "not ready, skip", causing ndo_get_stats64, get_drvinfo,
get_strings and get_ethtool_stats to always bail out in switchdev mode.

Remove the erroneous negation. The SF variant ice_repr_ready_sf() is
already correct (returns !active, i.e. non-zero when not active).

Fixes: 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")
Signed-off-by: Petr Oros <poros@redhat.com>
---
 drivers/net/ethernet/intel/ice/ice_repr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c
index cb08746556a670..2a84f656405828 100644
--- a/drivers/net/ethernet/intel/ice/ice_repr.c
+++ b/drivers/net/ethernet/intel/ice/ice_repr.c
@@ -315,7 +315,7 @@ ice_repr_reg_netdev(struct net_device *netdev, const struct net_device_ops *ops)
 
 static int ice_repr_ready_vf(struct ice_repr *repr)
 {
-	return !ice_check_vf_ready_for_cfg(repr->vf);
+	return ice_check_vf_ready_for_cfg(repr->vf);
 }
 
 static int ice_repr_ready_sf(struct ice_repr *repr)
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats
  2026-02-12  7:53 [PATCH iwl-net 0/2] ice: fix representor stats in switchdev mode Petr Oros
  2026-02-12  7:53 ` [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors Petr Oros
@ 2026-02-12  7:53 ` Petr Oros
  2026-02-12  8:24   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2026-03-19  9:12   ` Holda, Patryk
  1 sibling, 2 replies; 11+ messages in thread
From: Petr Oros @ 2026-02-12  7:53 UTC (permalink / raw)
  To: netdev
  Cc: Petr Oros, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Michal Swiatkowski, Wojciech Drewek, Simon Horman,
	intel-wired-lan, linux-kernel

ice_repr_get_stats64() and __ice_get_ethtool_stats() call
ice_update_vsi_stats() on the VF's src_vsi. This always returns early
because ICE_VSI_DOWN is permanently set for VF VSIs — ice_up() is never
called on them since queues are managed by iavf through virtchnl.

In __ice_get_ethtool_stats() the original code called
ice_update_vsi_stats() for all VSIs including representors, iterated
over ice_gstrings_vsi_stats[] to populate the data, and then bailed out
with an early return before the per-queue ring stats section. That early
return was necessary because representor VSIs have no rings on the PF
side — the rings belong to the VF driver (iavf), so accessing per-queue
stats would be invalid.

Move the representor handling to the top of __ice_get_ethtool_stats()
and call ice_update_eth_stats() directly to read the hardware GLV_*
counters. This matches ice_get_vf_stats() which already uses
ice_update_eth_stats() for the same VF VSI in legacy mode. Apply the
same fix to ice_repr_get_stats64().

Note that ice_gstrings_vsi_stats[] contains five software ring counters
(rx_buf_failed, rx_page_failed, tx_linearize, tx_busy, tx_restart) that
are always zero for representors since the PF never processes packets on
VF rings. This is pre-existing behavior unchanged by this patch.

Fixes: 7aae80cef7ba ("ice: add port representor ethtool ops and stats")
Signed-off-by: Petr Oros <poros@redhat.com>
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 14 +++++++++++---
 drivers/net/ethernet/intel/ice/ice_repr.c    |  3 ++-
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 3565a5d96c6d18..0b8775621f1567 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -1926,6 +1926,17 @@ __ice_get_ethtool_stats(struct net_device *netdev,
 	int i = 0;
 	char *p;
 
+	if (ice_is_port_repr_netdev(netdev)) {
+		ice_update_eth_stats(vsi);
+
+		for (j = 0; j < ICE_VSI_STATS_LEN; j++) {
+			p = (char *)vsi + ice_gstrings_vsi_stats[j].stat_offset;
+			data[i++] = (ice_gstrings_vsi_stats[j].sizeof_stat ==
+				     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
+		}
+		return;
+	}
+
 	ice_update_pf_stats(pf);
 	ice_update_vsi_stats(vsi);
 
@@ -1935,9 +1946,6 @@ __ice_get_ethtool_stats(struct net_device *netdev,
 			     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
 	}
 
-	if (ice_is_port_repr_netdev(netdev))
-		return;
-
 	/* populate per queue stats */
 	rcu_read_lock();
 
diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c
index 2a84f656405828..f1e82ba155cff2 100644
--- a/drivers/net/ethernet/intel/ice/ice_repr.c
+++ b/drivers/net/ethernet/intel/ice/ice_repr.c
@@ -2,6 +2,7 @@
 /* Copyright (C) 2019-2021, Intel Corporation. */
 
 #include "ice.h"
+#include "ice_lib.h"
 #include "ice_eswitch.h"
 #include "devlink/devlink.h"
 #include "devlink/port.h"
@@ -67,7 +68,7 @@ ice_repr_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
 		return;
 	vsi = repr->src_vsi;
 
-	ice_update_vsi_stats(vsi);
+	ice_update_eth_stats(vsi);
 	eth_stats = &vsi->eth_stats;
 
 	stats->tx_packets = eth_stats->tx_unicast + eth_stats->tx_broadcast +
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors
  2026-02-12  7:53 ` [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors Petr Oros
@ 2026-02-12  8:24   ` Loktionov, Aleksandr
  2026-02-12  9:47   ` Michal Swiatkowski
  1 sibling, 0 replies; 11+ messages in thread
From: Loktionov, Aleksandr @ 2026-02-12  8:24 UTC (permalink / raw)
  To: Oros, Petr, netdev@vger.kernel.org
  Cc: Drewek, Wojciech, Kitszel, Przemyslaw, Eric Dumazet,
	linux-kernel@vger.kernel.org, Andrew Lunn, Nguyen, Anthony L,
	Simon Horman, Michal Swiatkowski, Jakub Kicinski, Paolo Abeni,
	David S. Miller, intel-wired-lan@lists.osuosl.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Petr Oros
> Sent: Thursday, February 12, 2026 8:53 AM
> To: netdev@vger.kernel.org
> Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Eric Dumazet <edumazet@google.com>;
> linux-kernel@vger.kernel.org; Andrew Lunn <andrew+netdev@lunn.ch>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Simon Horman
> <horms@kernel.org>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Jakub Kicinski
> <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S. Miller
> <davem@davemloft.net>; intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH iwl-net 1/2] ice: fix inverted ready
> check for VF representors
> 
> Commit 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")
> refactored the VF readiness check into a generic repr->ops.ready()
> callback but implemented ice_repr_ready_vf() with inverted logic:
> 
>   return !ice_check_vf_ready_for_cfg(repr->vf);
> 
> ice_check_vf_ready_for_cfg() returns 0 on success, so the negation
> makes ready() return non-zero when the VF is ready. All callers treat
> non-zero as "not ready, skip", causing ndo_get_stats64, get_drvinfo,
> get_strings and get_ethtool_stats to always bail out in switchdev
> mode.
> 
> Remove the erroneous negation. The SF variant ice_repr_ready_sf() is
> already correct (returns !active, i.e. non-zero when not active).
> 
> Fixes: 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_repr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c
> b/drivers/net/ethernet/intel/ice/ice_repr.c
> index cb08746556a670..2a84f656405828 100644
> --- a/drivers/net/ethernet/intel/ice/ice_repr.c
> +++ b/drivers/net/ethernet/intel/ice/ice_repr.c
> @@ -315,7 +315,7 @@ ice_repr_reg_netdev(struct net_device *netdev,
> const struct net_device_ops *ops)
> 
>  static int ice_repr_ready_vf(struct ice_repr *repr)  {
> -	return !ice_check_vf_ready_for_cfg(repr->vf);
> +	return ice_check_vf_ready_for_cfg(repr->vf);
>  }
> 
>  static int ice_repr_ready_sf(struct ice_repr *repr)
> --
> 2.52.0

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats
  2026-02-12  7:53 ` [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats Petr Oros
@ 2026-02-12  8:24   ` Loktionov, Aleksandr
  2026-03-19  9:27     ` Holda, Patryk
  2026-03-19 10:37     ` Holda, Patryk
  2026-03-19  9:12   ` Holda, Patryk
  1 sibling, 2 replies; 11+ messages in thread
From: Loktionov, Aleksandr @ 2026-02-12  8:24 UTC (permalink / raw)
  To: Oros, Petr, netdev@vger.kernel.org
  Cc: Drewek, Wojciech, Kitszel, Przemyslaw, Eric Dumazet,
	linux-kernel@vger.kernel.org, Andrew Lunn, Nguyen, Anthony L,
	Simon Horman, Michal Swiatkowski, Jakub Kicinski, Paolo Abeni,
	David S. Miller, intel-wired-lan@lists.osuosl.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Petr Oros
> Sent: Thursday, February 12, 2026 8:53 AM
> To: netdev@vger.kernel.org
> Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Eric Dumazet <edumazet@google.com>;
> linux-kernel@vger.kernel.org; Andrew Lunn <andrew+netdev@lunn.ch>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Simon Horman
> <horms@kernel.org>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Jakub Kicinski
> <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S. Miller
> <davem@davemloft.net>; intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use
> ice_update_eth_stats() for representor stats
> 
> ice_repr_get_stats64() and __ice_get_ethtool_stats() call
> ice_update_vsi_stats() on the VF's src_vsi. This always returns early
> because ICE_VSI_DOWN is permanently set for VF VSIs — ice_up() is
> never called on them since queues are managed by iavf through
> virtchnl.
> 
> In __ice_get_ethtool_stats() the original code called
> ice_update_vsi_stats() for all VSIs including representors, iterated
> over ice_gstrings_vsi_stats[] to populate the data, and then bailed
> out with an early return before the per-queue ring stats section. That
> early return was necessary because representor VSIs have no rings on
> the PF side — the rings belong to the VF driver (iavf), so accessing
> per-queue stats would be invalid.
> 
> Move the representor handling to the top of __ice_get_ethtool_stats()
> and call ice_update_eth_stats() directly to read the hardware GLV_*
> counters. This matches ice_get_vf_stats() which already uses
> ice_update_eth_stats() for the same VF VSI in legacy mode. Apply the
> same fix to ice_repr_get_stats64().
> 
> Note that ice_gstrings_vsi_stats[] contains five software ring
> counters (rx_buf_failed, rx_page_failed, tx_linearize, tx_busy,
> tx_restart) that are always zero for representors since the PF never
> processes packets on VF rings. This is pre-existing behavior unchanged
> by this patch.
> 
> Fixes: 7aae80cef7ba ("ice: add port representor ethtool ops and
> stats")
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_ethtool.c | 14 +++++++++++---
>  drivers/net/ethernet/intel/ice/ice_repr.c    |  3 ++-
>  2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> index 3565a5d96c6d18..0b8775621f1567 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> @@ -1926,6 +1926,17 @@ __ice_get_ethtool_stats(struct net_device
> *netdev,
>  	int i = 0;
>  	char *p;
> 
> +	if (ice_is_port_repr_netdev(netdev)) {
> +		ice_update_eth_stats(vsi);
> +
> +		for (j = 0; j < ICE_VSI_STATS_LEN; j++) {
> +			p = (char *)vsi +
> ice_gstrings_vsi_stats[j].stat_offset;
> +			data[i++] =
> (ice_gstrings_vsi_stats[j].sizeof_stat ==
> +				     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
> +		}
> +		return;
> +	}
> +
>  	ice_update_pf_stats(pf);
>  	ice_update_vsi_stats(vsi);
> 
> @@ -1935,9 +1946,6 @@ __ice_get_ethtool_stats(struct net_device
> *netdev,
>  			     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
>  	}
> 
> -	if (ice_is_port_repr_netdev(netdev))
> -		return;
> -
>  	/* populate per queue stats */
>  	rcu_read_lock();
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c
> b/drivers/net/ethernet/intel/ice/ice_repr.c
> index 2a84f656405828..f1e82ba155cff2 100644
> --- a/drivers/net/ethernet/intel/ice/ice_repr.c
> +++ b/drivers/net/ethernet/intel/ice/ice_repr.c
> @@ -2,6 +2,7 @@
>  /* Copyright (C) 2019-2021, Intel Corporation. */
> 
>  #include "ice.h"
> +#include "ice_lib.h"
>  #include "ice_eswitch.h"
>  #include "devlink/devlink.h"
>  #include "devlink/port.h"
> @@ -67,7 +68,7 @@ ice_repr_get_stats64(struct net_device *netdev,
> struct rtnl_link_stats64 *stats)
>  		return;
>  	vsi = repr->src_vsi;
> 
> -	ice_update_vsi_stats(vsi);
> +	ice_update_eth_stats(vsi);
>  	eth_stats = &vsi->eth_stats;
> 
>  	stats->tx_packets = eth_stats->tx_unicast + eth_stats-
> >tx_broadcast +
> --
> 2.52.0


Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors
  2026-02-12  7:53 ` [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors Petr Oros
  2026-02-12  8:24   ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2026-02-12  9:47   ` Michal Swiatkowski
  2026-03-19  9:10     ` [Intel-wired-lan] " Holda, Patryk
  2026-03-19 10:38     ` Holda, Patryk
  1 sibling, 2 replies; 11+ messages in thread
From: Michal Swiatkowski @ 2026-02-12  9:47 UTC (permalink / raw)
  To: Petr Oros
  Cc: netdev, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Michal Swiatkowski, Wojciech Drewek, Simon Horman,
	intel-wired-lan, linux-kernel

On Thu, Feb 12, 2026 at 08:53:10AM +0100, Petr Oros wrote:
> Commit 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")
> refactored the VF readiness check into a generic repr->ops.ready()
> callback but implemented ice_repr_ready_vf() with inverted logic:
> 
>   return !ice_check_vf_ready_for_cfg(repr->vf);
> 
> ice_check_vf_ready_for_cfg() returns 0 on success, so the negation
> makes ready() return non-zero when the VF is ready. All callers treat
> non-zero as "not ready, skip", causing ndo_get_stats64, get_drvinfo,
> get_strings and get_ethtool_stats to always bail out in switchdev mode.
> 
> Remove the erroneous negation. The SF variant ice_repr_ready_sf() is
> already correct (returns !active, i.e. non-zero when not active).
> 
> Fixes: 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_repr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c
> index cb08746556a670..2a84f656405828 100644
> --- a/drivers/net/ethernet/intel/ice/ice_repr.c
> +++ b/drivers/net/ethernet/intel/ice/ice_repr.c
> @@ -315,7 +315,7 @@ ice_repr_reg_netdev(struct net_device *netdev, const struct net_device_ops *ops)
>  
>  static int ice_repr_ready_vf(struct ice_repr *repr)
>  {
> -	return !ice_check_vf_ready_for_cfg(repr->vf);
> +	return ice_check_vf_ready_for_cfg(repr->vf);
>  }
>  
>  static int ice_repr_ready_sf(struct ice_repr *repr)
> -- 
> 2.52.0
> 

Thanks for fixing
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors
  2026-02-12  9:47   ` Michal Swiatkowski
@ 2026-03-19  9:10     ` Holda, Patryk
  2026-03-19 10:38     ` Holda, Patryk
  1 sibling, 0 replies; 11+ messages in thread
From: Holda, Patryk @ 2026-03-19  9:10 UTC (permalink / raw)
  To: Michal Swiatkowski, Oros, Petr
  Cc: netdev@vger.kernel.org, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Drewek, Wojciech, Simon Horman,
	intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org






________________________________________
From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> on behalf of Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Sent: Thursday, February 12, 2026 10:47
To: Oros, Petr <poros@redhat.com>
Cc: netdev@vger.kernel.org <netdev@vger.kernel.org>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Michal Swiatkowski <michal.swiatkowski@linux.intel.com>; Drewek, Wojciech <wojciech.drewek@intel.com>; Simon Horman <horms@kernel.org>; intel-wired-lan@lists.osuosl.org <intel-wired-lan@lists.osuosl.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors


On Thu, Feb 12, 2026 at 08:53:10AM +0100, Petr Oros wrote:

> Commit 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")

> refactored the VF readiness check into a generic repr->ops.ready()

> callback but implemented ice_repr_ready_vf() with inverted logic:

>

>   return !ice_check_vf_ready_for_cfg(repr->vf);

>

> ice_check_vf_ready_for_cfg() returns 0 on success, so the negation

> makes ready() return non-zero when the VF is ready. All callers treat

> non-zero as "not ready, skip", causing ndo_get_stats64, get_drvinfo,

> get_strings and get_ethtool_stats to always bail out in switchdev mode.

>

> Remove the erroneous negation. The SF variant ice_repr_ready_sf() is

> already correct (returns !active, i.e. non-zero when not active).

>

> Fixes: 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")

> Signed-off-by: Petr Oros <poros@redhat.com>

> ---

>  drivers/net/ethernet/intel/ice/ice_repr.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c

> index cb08746556a670..2a84f656405828 100644

> --- a/drivers/net/ethernet/intel/ice/ice_repr.c

> +++ b/drivers/net/ethernet/intel/ice/ice_repr.c

> @@ -315,7 +315,7 @@ ice_repr_reg_netdev(struct net_device *netdev, const struct net_device_ops *ops)


>  static int ice_repr_ready_vf(struct ice_repr *repr)

>  {

> -     return !ice_check_vf_ready_for_cfg(repr->vf);

> +     return ice_check_vf_ready_for_cfg(repr->vf);

>  }


>  static int ice_repr_ready_sf(struct ice_repr *repr)

> --

> 2.52.0

>



Thanks for fixing

Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>


Tested-by: Patryk Holda <patryk.holda@intel.com>
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats
  2026-02-12  7:53 ` [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats Petr Oros
  2026-02-12  8:24   ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2026-03-19  9:12   ` Holda, Patryk
  1 sibling, 0 replies; 11+ messages in thread
From: Holda, Patryk @ 2026-03-19  9:12 UTC (permalink / raw)
  To: Oros, Petr, netdev@vger.kernel.org
  Cc: Drewek, Wojciech, Kitszel, Przemyslaw, Eric Dumazet,
	linux-kernel@vger.kernel.org, Andrew Lunn, Nguyen, Anthony L,
	Simon Horman, Michal Swiatkowski, Jakub Kicinski, Paolo Abeni,
	David S. Miller, intel-wired-lan@lists.osuosl.org

________________________________________
From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> on behalf of Petr Oros <poros@redhat.com>
Sent: Thursday, February 12, 2026 08:53
To: netdev@vger.kernel.org <netdev@vger.kernel.org>
Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Eric Dumazet <edumazet@google.com>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; Andrew Lunn <andrew+netdev@lunn.ch>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Simon Horman <horms@kernel.org>; Michal Swiatkowski <michal.swiatkowski@linux.intel.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S. Miller <davem@davemloft.net>; intel-wired-lan@lists.osuosl.org <intel-wired-lan@lists.osuosl.org>
Subject: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats


ice_repr_get_stats64() and __ice_get_ethtool_stats() call

ice_update_vsi_stats() on the VF's src_vsi. This always returns early

because ICE_VSI_DOWN is permanently set for VF VSIs — ice_up() is never

called on them since queues are managed by iavf through virtchnl.



In __ice_get_ethtool_stats() the original code called

ice_update_vsi_stats() for all VSIs including representors, iterated

over ice_gstrings_vsi_stats[] to populate the data, and then bailed out

with an early return before the per-queue ring stats section. That early

return was necessary because representor VSIs have no rings on the PF

side — the rings belong to the VF driver (iavf), so accessing per-queue

stats would be invalid.



Move the representor handling to the top of __ice_get_ethtool_stats()

and call ice_update_eth_stats() directly to read the hardware GLV_*

counters. This matches ice_get_vf_stats() which already uses

ice_update_eth_stats() for the same VF VSI in legacy mode. Apply the

same fix to ice_repr_get_stats64().



Note that ice_gstrings_vsi_stats[] contains five software ring counters

(rx_buf_failed, rx_page_failed, tx_linearize, tx_busy, tx_restart) that

are always zero for representors since the PF never processes packets on

VF rings. This is pre-existing behavior unchanged by this patch.



Fixes: 7aae80cef7ba ("ice: add port representor ethtool ops and stats")

Signed-off-by: Petr Oros <poros@redhat.com>

---

 drivers/net/ethernet/intel/ice/ice_ethtool.c | 14 +++++++++++---

 drivers/net/ethernet/intel/ice/ice_repr.c    |  3 ++-

 2 files changed, 13 insertions(+), 4 deletions(-)



diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c

index 3565a5d96c6d18..0b8775621f1567 100644

--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c

+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c

@@ -1926,6 +1926,17 @@ __ice_get_ethtool_stats(struct net_device *netdev,

         int i = 0;

         char *p;

 

+       if (ice_is_port_repr_netdev(netdev)) {

+               ice_update_eth_stats(vsi);

+

+               for (j = 0; j < ICE_VSI_STATS_LEN; j++) {

+                       p = (char *)vsi + ice_gstrings_vsi_stats[j].stat_offset;

+                       data[i++] = (ice_gstrings_vsi_stats[j].sizeof_stat ==

+                                    sizeof(u64)) ? *(u64 *)p : *(u32 *)p;

+               }

+               return;

+       }

+

         ice_update_pf_stats(pf);

         ice_update_vsi_stats(vsi);

 

@@ -1935,9 +1946,6 @@ __ice_get_ethtool_stats(struct net_device *netdev,

                              sizeof(u64)) ? *(u64 *)p : *(u32 *)p;

         }

 

-       if (ice_is_port_repr_netdev(netdev))

-               return;

-

         /* populate per queue stats */

         rcu_read_lock();

 

diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c

index 2a84f656405828..f1e82ba155cff2 100644

--- a/drivers/net/ethernet/intel/ice/ice_repr.c

+++ b/drivers/net/ethernet/intel/ice/ice_repr.c

@@ -2,6 +2,7 @@

 /* Copyright (C) 2019-2021, Intel Corporation. */

 

 #include "ice.h"

+#include "ice_lib.h"

 #include "ice_eswitch.h"

 #include "devlink/devlink.h"

 #include "devlink/port.h"

@@ -67,7 +68,7 @@ ice_repr_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)

                 return;

         vsi = repr->src_vsi;

 

-       ice_update_vsi_stats(vsi);

+       ice_update_eth_stats(vsi);

         eth_stats = &vsi->eth_stats;

 

         stats->tx_packets = eth_stats->tx_unicast + eth_stats->tx_broadcast +

--

2.52.0



Tested-by: Patryk Holda <patryk.holda@intel.com>
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats
  2026-02-12  8:24   ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2026-03-19  9:27     ` Holda, Patryk
  2026-03-19 10:37     ` Holda, Patryk
  1 sibling, 0 replies; 11+ messages in thread
From: Holda, Patryk @ 2026-03-19  9:27 UTC (permalink / raw)
  To: Loktionov, Aleksandr, Oros, Petr, netdev@vger.kernel.org
  Cc: Drewek, Wojciech, Kitszel, Przemyslaw, Eric Dumazet,
	linux-kernel@vger.kernel.org, Andrew Lunn, Nguyen, Anthony L,
	Simon Horman, Michal Swiatkowski, Jakub Kicinski, Paolo Abeni,
	David S. Miller, intel-wired-lan@lists.osuosl.org




________________________________________
From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> on behalf of Loktionov, Aleksandr <aleksandr.loktionov@intel.com>
Sent: Thursday, February 12, 2026 09:24
To: Oros, Petr <poros@redhat.com>; netdev@vger.kernel.org <netdev@vger.kernel.org>
Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; Eric Dumazet <edumazet@google.com>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; Andrew Lunn <andrew+netdev@lunn.ch>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Simon Horman <horms@kernel.org>; Michal Swiatkowski <michal.swiatkowski@linux.intel.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S. Miller <davem@davemloft.net>; intel-wired-lan@lists.osuosl.org <intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Petr Oros
> Sent: Thursday, February 12, 2026 8:53 AM
> To: netdev@vger.kernel.org
> Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Eric Dumazet <edumazet@google.com>;
> linux-kernel@vger.kernel.org; Andrew Lunn <andrew+netdev@lunn.ch>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Simon Horman
> <horms@kernel.org>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Jakub Kicinski
> <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S. Miller
> <davem@davemloft.net>; intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use
> ice_update_eth_stats() for representor stats
> 
> ice_repr_get_stats64() and __ice_get_ethtool_stats() call
> ice_update_vsi_stats() on the VF's src_vsi. This always returns early
> because ICE_VSI_DOWN is permanently set for VF VSIs — ice_up() is
> never called on them since queues are managed by iavf through
> virtchnl.
> 
> In __ice_get_ethtool_stats() the original code called
> ice_update_vsi_stats() for all VSIs including representors, iterated
> over ice_gstrings_vsi_stats[] to populate the data, and then bailed
> out with an early return before the per-queue ring stats section. That
> early return was necessary because representor VSIs have no rings on
> the PF side — the rings belong to the VF driver (iavf), so accessing
> per-queue stats would be invalid.
> 
> Move the representor handling to the top of __ice_get_ethtool_stats()
> and call ice_update_eth_stats() directly to read the hardware GLV_*
> counters. This matches ice_get_vf_stats() which already uses
> ice_update_eth_stats() for the same VF VSI in legacy mode. Apply the
> same fix to ice_repr_get_stats64().
> 
> Note that ice_gstrings_vsi_stats[] contains five software ring
> counters (rx_buf_failed, rx_page_failed, tx_linearize, tx_busy,
> tx_restart) that are always zero for representors since the PF never
> processes packets on VF rings. This is pre-existing behavior unchanged
> by this patch.
> 
> Fixes: 7aae80cef7ba ("ice: add port representor ethtool ops and
> stats")
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_ethtool.c | 14 +++++++++++---
>  drivers/net/ethernet/intel/ice/ice_repr.c    |  3 ++-
>  2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> index 3565a5d96c6d18..0b8775621f1567 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> @@ -1926,6 +1926,17 @@ __ice_get_ethtool_stats(struct net_device
> *netdev,
>        int i = 0;
>        char *p;
> 
> +     if (ice_is_port_repr_netdev(netdev)) {
> +             ice_update_eth_stats(vsi);
> +
> +             for (j = 0; j < ICE_VSI_STATS_LEN; j++) {
> +                     p = (char *)vsi +
> ice_gstrings_vsi_stats[j].stat_offset;
> +                     data[i++] =
> (ice_gstrings_vsi_stats[j].sizeof_stat ==
> +                                  sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
> +             }
> +             return;
> +     }
> +
>        ice_update_pf_stats(pf);
>        ice_update_vsi_stats(vsi);
> 
> @@ -1935,9 +1946,6 @@ __ice_get_ethtool_stats(struct net_device
> *netdev,
>                             sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
>        }
> 
> -     if (ice_is_port_repr_netdev(netdev))
> -             return;
> -
>        /* populate per queue stats */
>        rcu_read_lock();
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c
> b/drivers/net/ethernet/intel/ice/ice_repr.c
> index 2a84f656405828..f1e82ba155cff2 100644
> --- a/drivers/net/ethernet/intel/ice/ice_repr.c
> +++ b/drivers/net/ethernet/intel/ice/ice_repr.c
> @@ -2,6 +2,7 @@
>  /* Copyright (C) 2019-2021, Intel Corporation. */
> 
>  #include "ice.h"
> +#include "ice_lib.h"
>  #include "ice_eswitch.h"
>  #include "devlink/devlink.h"
>  #include "devlink/port.h"
> @@ -67,7 +68,7 @@ ice_repr_get_stats64(struct net_device *netdev,
> struct rtnl_link_stats64 *stats)
>                return;
>        vsi = repr->src_vsi;
> 
> -     ice_update_vsi_stats(vsi);
> +     ice_update_eth_stats(vsi);
>        eth_stats = &vsi->eth_stats;
> 
>        stats->tx_packets = eth_stats->tx_unicast + eth_stats-
> >tx_broadcast +
> --
> 2.52.0


Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>



Tested-by: Patryk Holda <patryk.holda@intel.com>
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats
  2026-02-12  8:24   ` [Intel-wired-lan] " Loktionov, Aleksandr
  2026-03-19  9:27     ` Holda, Patryk
@ 2026-03-19 10:37     ` Holda, Patryk
  1 sibling, 0 replies; 11+ messages in thread
From: Holda, Patryk @ 2026-03-19 10:37 UTC (permalink / raw)
  To: Loktionov, Aleksandr, Oros, Petr, netdev@vger.kernel.org
  Cc: Drewek, Wojciech, Kitszel, Przemyslaw, Eric Dumazet,
	linux-kernel@vger.kernel.org, Andrew Lunn, Nguyen, Anthony L,
	Simon Horman, Michal Swiatkowski, Jakub Kicinski, Paolo Abeni,
	David S. Miller, intel-wired-lan@lists.osuosl.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Loktionov, Aleksandr
> Sent: Thursday, February 12, 2026 9:25 AM
> To: Oros, Petr <poros@redhat.com>; netdev@vger.kernel.org
> Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Eric Dumazet <edumazet@google.com>;
> linux-kernel@vger.kernel.org; Andrew Lunn <andrew+netdev@lunn.ch>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Simon Horman
> <horms@kernel.org>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Jakub Kicinski <kuba@kernel.org>;
> Paolo Abeni <pabeni@redhat.com>; David S. Miller
> <davem@davemloft.net>; intel-wired-lan@lists.osuosl.org
> Subject: Re: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use
> ice_update_eth_stats() for representor stats
> 
> 
> 
> > -----Original Message-----
> > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> > Of Petr Oros
> > Sent: Thursday, February 12, 2026 8:53 AM
> > To: netdev@vger.kernel.org
> > Cc: Drewek, Wojciech <wojciech.drewek@intel.com>; Kitszel, Przemyslaw
> > <przemyslaw.kitszel@intel.com>; Eric Dumazet <edumazet@google.com>;
> > linux-kernel@vger.kernel.org; Andrew Lunn <andrew+netdev@lunn.ch>;
> > Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Simon Horman
> > <horms@kernel.org>; Michal Swiatkowski
> > <michal.swiatkowski@linux.intel.com>; Jakub Kicinski
> > <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; David S. Miller
> > <davem@davemloft.net>; intel-wired-lan@lists.osuosl.org
> > Subject: [Intel-wired-lan] [PATCH iwl-net 2/2] ice: use
> > ice_update_eth_stats() for representor stats
> >
> > ice_repr_get_stats64() and __ice_get_ethtool_stats() call
> > ice_update_vsi_stats() on the VF's src_vsi. This always returns early
> > because ICE_VSI_DOWN is permanently set for VF VSIs — ice_up() is
> > never called on them since queues are managed by iavf through
> > virtchnl.
> >
> > In __ice_get_ethtool_stats() the original code called
> > ice_update_vsi_stats() for all VSIs including representors, iterated
> > over ice_gstrings_vsi_stats[] to populate the data, and then bailed
> > out with an early return before the per-queue ring stats section. That
> > early return was necessary because representor VSIs have no rings on
> > the PF side — the rings belong to the VF driver (iavf), so accessing
> > per-queue stats would be invalid.
> >
> > Move the representor handling to the top of __ice_get_ethtool_stats()
> > and call ice_update_eth_stats() directly to read the hardware GLV_*
> > counters. This matches ice_get_vf_stats() which already uses
> > ice_update_eth_stats() for the same VF VSI in legacy mode. Apply the
> > same fix to ice_repr_get_stats64().
> >
> > Note that ice_gstrings_vsi_stats[] contains five software ring
> > counters (rx_buf_failed, rx_page_failed, tx_linearize, tx_busy,
> > tx_restart) that are always zero for representors since the PF never
> > processes packets on VF rings. This is pre-existing behavior unchanged
> > by this patch.
> >
> > Fixes: 7aae80cef7ba ("ice: add port representor ethtool ops and
> > stats")
> > Signed-off-by: Petr Oros <poros@redhat.com>
> > ---
> >  drivers/net/ethernet/intel/ice/ice_ethtool.c | 14 +++++++++++---
> >  drivers/net/ethernet/intel/ice/ice_repr.c    |  3 ++-
> >  2 files changed, 13 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> > b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> > index 3565a5d96c6d18..0b8775621f1567 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> > @@ -1926,6 +1926,17 @@ __ice_get_ethtool_stats(struct net_device
> > *netdev,
> >  	int i = 0;
> >  	char *p;
> >
> > +	if (ice_is_port_repr_netdev(netdev)) {
> > +		ice_update_eth_stats(vsi);
> > +
> > +		for (j = 0; j < ICE_VSI_STATS_LEN; j++) {
> > +			p = (char *)vsi +
> > ice_gstrings_vsi_stats[j].stat_offset;
> > +			data[i++] =
> > (ice_gstrings_vsi_stats[j].sizeof_stat ==
> > +				     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
> > +		}
> > +		return;
> > +	}
> > +
> >  	ice_update_pf_stats(pf);
> >  	ice_update_vsi_stats(vsi);
> >
> > @@ -1935,9 +1946,6 @@ __ice_get_ethtool_stats(struct net_device
> > *netdev,
> >  			     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
> >  	}
> >
> > -	if (ice_is_port_repr_netdev(netdev))
> > -		return;
> > -
> >  	/* populate per queue stats */
> >  	rcu_read_lock();
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c
> > b/drivers/net/ethernet/intel/ice/ice_repr.c
> > index 2a84f656405828..f1e82ba155cff2 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_repr.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_repr.c
> > @@ -2,6 +2,7 @@
> >  /* Copyright (C) 2019-2021, Intel Corporation. */
> >
> >  #include "ice.h"
> > +#include "ice_lib.h"
> >  #include "ice_eswitch.h"
> >  #include "devlink/devlink.h"
> >  #include "devlink/port.h"
> > @@ -67,7 +68,7 @@ ice_repr_get_stats64(struct net_device *netdev,
> > struct rtnl_link_stats64 *stats)
> >  		return;
> >  	vsi = repr->src_vsi;
> >
> > -	ice_update_vsi_stats(vsi);
> > +	ice_update_eth_stats(vsi);
> >  	eth_stats = &vsi->eth_stats;
> >
> >  	stats->tx_packets = eth_stats->tx_unicast + eth_stats-
> > >tx_broadcast +
> > --
> > 2.52.0
> 
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

Tested-by: Patryk Holda <patryk.holda@intel.com> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors
  2026-02-12  9:47   ` Michal Swiatkowski
  2026-03-19  9:10     ` [Intel-wired-lan] " Holda, Patryk
@ 2026-03-19 10:38     ` Holda, Patryk
  1 sibling, 0 replies; 11+ messages in thread
From: Holda, Patryk @ 2026-03-19 10:38 UTC (permalink / raw)
  To: Michal Swiatkowski, Oros, Petr
  Cc: netdev@vger.kernel.org, Nguyen, Anthony L, Kitszel, Przemyslaw,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Drewek, Wojciech, Simon Horman,
	intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Michal Swiatkowski
> Sent: Thursday, February 12, 2026 10:47 AM
> To: Oros, Petr <poros@redhat.com>
> Cc: netdev@vger.kernel.org; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Drewek, Wojciech
> <wojciech.drewek@intel.com>; Simon Horman <horms@kernel.org>; intel-
> wired-lan@lists.osuosl.org; linux-kernel@vger.kernel.org
> Subject: Re: [Intel-wired-lan] [PATCH iwl-net 1/2] ice: fix inverted ready check
> for VF representors
> 
> On Thu, Feb 12, 2026 at 08:53:10AM +0100, Petr Oros wrote:
> > Commit 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")
> > refactored the VF readiness check into a generic repr->ops.ready()
> > callback but implemented ice_repr_ready_vf() with inverted logic:
> >
> >   return !ice_check_vf_ready_for_cfg(repr->vf);
> >
> > ice_check_vf_ready_for_cfg() returns 0 on success, so the negation
> > makes ready() return non-zero when the VF is ready. All callers treat
> > non-zero as "not ready, skip", causing ndo_get_stats64, get_drvinfo,
> > get_strings and get_ethtool_stats to always bail out in switchdev mode.
> >
> > Remove the erroneous negation. The SF variant ice_repr_ready_sf() is
> > already correct (returns !active, i.e. non-zero when not active).
> >
> > Fixes: 0f00a897c9fcbd ("ice: check if SF is ready in ethtool ops")
> > Signed-off-by: Petr Oros <poros@redhat.com>
> > ---
> >  drivers/net/ethernet/intel/ice/ice_repr.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c
> > b/drivers/net/ethernet/intel/ice/ice_repr.c
> > index cb08746556a670..2a84f656405828 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_repr.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_repr.c
> > @@ -315,7 +315,7 @@ ice_repr_reg_netdev(struct net_device *netdev,
> > const struct net_device_ops *ops)
> >
> >  static int ice_repr_ready_vf(struct ice_repr *repr)  {
> > -	return !ice_check_vf_ready_for_cfg(repr->vf);
> > +	return ice_check_vf_ready_for_cfg(repr->vf);
> >  }
> >
> >  static int ice_repr_ready_sf(struct ice_repr *repr)
> > --
> > 2.52.0
> >
> 
> Thanks for fixing
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

Tested-by: Patryk Holda <patryk.holda@intel.com> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-03-19 10:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12  7:53 [PATCH iwl-net 0/2] ice: fix representor stats in switchdev mode Petr Oros
2026-02-12  7:53 ` [PATCH iwl-net 1/2] ice: fix inverted ready check for VF representors Petr Oros
2026-02-12  8:24   ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-02-12  9:47   ` Michal Swiatkowski
2026-03-19  9:10     ` [Intel-wired-lan] " Holda, Patryk
2026-03-19 10:38     ` Holda, Patryk
2026-02-12  7:53 ` [PATCH iwl-net 2/2] ice: use ice_update_eth_stats() for representor stats Petr Oros
2026-02-12  8:24   ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-03-19  9:27     ` Holda, Patryk
2026-03-19 10:37     ` Holda, Patryk
2026-03-19  9:12   ` Holda, Patryk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox