Skip to contentSkip to conversation

ice: expose non_eop_descs to ethtool

net-next Jon Maxwell 2 participants 4 messages Dec 16, 2024 – Dec 18, 2024

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

The ixgbe driver exposes non_eop_descs to ethtool. Do the same for ice.

With this patch:

ethtool -S ens2f0np0 | grep non_eop_descs

     non_eop_descs: 956719320
---
 drivers/net/ethernet/intel/ice/ice.h         | 1 +
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 1 +
 drivers/net/ethernet/intel/ice/ice_main.c    | 2 ++
 3 files changed, 4 insertions(+)
drivers/net/ethernet/intel/ice/ice.h +1 -0
index 2f5d6f974185..8ff94400864e 100644
@@ -345,6 +345,7 @@ struct ice_vsi {
 	u32 rx_buf_failed;
 	u32 rx_page_failed;
 	u16 num_q_vectors;
+	u64 non_eop_descs;
 	/* tell if only dynamic irq allocation is allowed */
 	bool irq_dyn_alloc;
 
drivers/net/ethernet/intel/ice/ice_ethtool.c +1 -0
index 3072634bf049..e85b664fa647 100644
@@ -65,6 +65,7 @@ static const struct ice_stats ice_gstrings_vsi_stats[] = {
 	ICE_VSI_STAT("tx_linearize", tx_linearize),
 	ICE_VSI_STAT("tx_busy", tx_busy),
 	ICE_VSI_STAT("tx_restart", tx_restart),
+	ICE_VSI_STAT("non_eop_descs", non_eop_descs),
 };
 
 enum ice_ethtool_test_id {
drivers/net/ethernet/intel/ice/ice_main.c +2 -0
index 0ab35607e5d5..948c38c0770b 100644
@@ -6896,6 +6896,7 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
 	vsi->tx_linearize = 0;
 	vsi->rx_buf_failed = 0;
 	vsi->rx_page_failed = 0;
+	vsi->non_eop_descs = 0;
 
 	rcu_read_lock();
 
@@ -6916,6 +6917,7 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
 		vsi_stats->rx_bytes += bytes;
 		vsi->rx_buf_failed += ring_stats->rx_stats.alloc_buf_failed;
 		vsi->rx_page_failed += ring_stats->rx_stats.alloc_page_failed;
+		vsi->non_eop_descs += ring_stats->rx_stats.non_eop_descs;
 	}
 
 	/* update XDP Tx rings counters */
Signature · 1 line
2.47.1
#1 lore raw

From: Jon Maxwell <[email protected]>
Date: Tue, 17 Dec 2024 10:48:50 +1100

Quoted 1 line

The ixgbe driver exposes non_eop_descs to ethtool. Do the same for ice.

Only due to that?
Why would we need it in the first place?

Quoted 50 lines

With this patch:

ethtool -S ens2f0np0 | grep non_eop_descs

     non_eop_descs: 956719320
---
 drivers/net/ethernet/intel/ice/ice.h         | 1 +
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 1 +
 drivers/net/ethernet/intel/ice/ice_main.c    | 2 ++
 3 files changed, 4 insertions(+)
drivers/net/ethernet/intel/ice/ice.h +1 -0
index 2f5d6f974185..8ff94400864e 100644
@@ -345,6 +345,7 @@ struct ice_vsi {
 	u32 rx_buf_failed;
 	u32 rx_page_failed;
 	u16 num_q_vectors;
+	u64 non_eop_descs;
 	/* tell if only dynamic irq allocation is allowed */
 	bool irq_dyn_alloc;
 
drivers/net/ethernet/intel/ice/ice_ethtool.c +1 -0
index 3072634bf049..e85b664fa647 100644
@@ -65,6 +65,7 @@ static const struct ice_stats ice_gstrings_vsi_stats[] = {
 	ICE_VSI_STAT("tx_linearize", tx_linearize),
 	ICE_VSI_STAT("tx_busy", tx_busy),
 	ICE_VSI_STAT("tx_restart", tx_restart),
+	ICE_VSI_STAT("non_eop_descs", non_eop_descs),
 };
 
 enum ice_ethtool_test_id {
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
index 0ab35607e5d5..948c38c0770b 100644
@@ -6896,6 +6896,7 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
 	vsi->tx_linearize = 0;
 	vsi->rx_buf_failed = 0;
 	vsi->rx_page_failed = 0;
+	vsi->non_eop_descs = 0;
 
 	rcu_read_lock();
 

drivers/net/ethernet/intel/ice/ice_main.c static void ice_update_vsi_ring_stats(struct ice_vsi *vsi) · line 6923

Quoted 7 lines
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
@@ -6916,6 +6917,7 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
 		vsi_stats->rx_bytes += bytes;
 		vsi->rx_buf_failed += ring_stats->rx_stats.alloc_buf_failed;
 		vsi->rx_page_failed += ring_stats->rx_stats.alloc_page_failed;
+		vsi->non_eop_descs += ring_stats->rx_stats.non_eop_descs;
 	}
 
 	/* update XDP Tx rings counters */

Thanks,
Olek

#2 lore raw
Quoted 9 lines · Alexander Lobakin

From: Jon Maxwell <[email protected]>
Date: Tue, 17 Dec 2024 10:48:50 +1100

Quoted 1 line

The ixgbe driver exposes non_eop_descs to ethtool. Do the same for ice.

Only due to that?
Why would we need it in the first place?

Not just that. We had a critical ice bug we were diagnosing and saw this counter in the Vmcore. When we set up a reproducer we needed to check that counter was incrementing. I added this patch to do that and thought that it may aid trouble-shooting in the future as well so I sent it upstream.

Regards

Jon

Quoted 60 lines
Quoted 50 lines

With this patch:

ethtool -S ens2f0np0 | grep non_eop_descs

     non_eop_descs: 956719320
---
 drivers/net/ethernet/intel/ice/ice.h         | 1 +
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 1 +
 drivers/net/ethernet/intel/ice/ice_main.c    | 2 ++
 3 files changed, 4 insertions(+)
drivers/net/ethernet/intel/ice/ice.h +1 -0
index 2f5d6f974185..8ff94400864e 100644
@@ -345,6 +345,7 @@ struct ice_vsi {
      u32 rx_buf_failed;
      u32 rx_page_failed;
      u16 num_q_vectors;
+     u64 non_eop_descs;
      /* tell if only dynamic irq allocation is allowed */
      bool irq_dyn_alloc;
 
drivers/net/ethernet/intel/ice/ice_ethtool.c +1 -0
index 3072634bf049..e85b664fa647 100644
@@ -65,6 +65,7 @@ static const struct ice_stats ice_gstrings_vsi_stats[] = {
      ICE_VSI_STAT("tx_linearize", tx_linearize),
      ICE_VSI_STAT("tx_busy", tx_busy),
      ICE_VSI_STAT("tx_restart", tx_restart),
+     ICE_VSI_STAT("non_eop_descs", non_eop_descs),
 };
 
 enum ice_ethtool_test_id {
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
index 0ab35607e5d5..948c38c0770b 100644
@@ -6896,6 +6896,7 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
      vsi->tx_linearize = 0;
      vsi->rx_buf_failed = 0;
      vsi->rx_page_failed = 0;
+     vsi->non_eop_descs = 0;
 
      rcu_read_lock();
 

drivers/net/ethernet/intel/ice/ice_main.c static void ice_update_vsi_ring_stats(struct ice_vsi *vsi) · line 6923

Quoted 7 lines
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
@@ -6916,6 +6917,7 @@ static void ice_update_vsi_ring_stats(struct ice_vsi *vsi)
              vsi_stats->rx_bytes += bytes;
              vsi->rx_buf_failed += ring_stats->rx_stats.alloc_buf_failed;
              vsi->rx_page_failed += ring_stats->rx_stats.alloc_page_failed;
+             vsi->non_eop_descs += ring_stats->rx_stats.non_eop_descs;
      }
 
      /* update XDP Tx rings counters */

Thanks,
Olek

#3 lore raw

From: Jonathan Maxwell <[email protected]>
Date: Wed, 18 Dec 2024 09:13:00 +1100

Quoted 8 lines
Quoted 6 lines · Alexander Lobakin

From: Jon Maxwell <[email protected]>
Date: Tue, 17 Dec 2024 10:48:50 +1100

Quoted 1 line

The ixgbe driver exposes non_eop_descs to ethtool. Do the same for ice.

Quoted 8 lines
Quoted 3 lines

Only due to that?
Why would we need it in the first place?

Not just that. We had a critical ice bug we were diagnosing and saw this counter in the Vmcore. When we set up a reproducer we needed to check that counter was incrementing. I added this patch to do that and thought that it may aid trouble-shooting in the future as well so I sent it upstream.

ethtool -S is slowly getting deprecated, I wouldn't encourage exporting more new stats. The best thing you could do is to add such field to the generic per-queue stats and implement them in ice.

Quoted 4 lines

Regards

Jon

Thanks,
Olek