diff mbox series

[net-next] ice: expose non_eop_descs to ethtool

Message ID 20241216234850.494198-1-jmaxwell37@gmail.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net-next] ice: expose non_eop_descs to ethtool | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
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: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 280 this patch: 280
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: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 28 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 182 this patch: 182
netdev/source_inline success Was 0 now: 0

Commit Message

Jonathan Maxwell Dec. 16, 2024, 11:48 p.m. UTC
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

Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
---
 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(+)

Comments

Alexander Lobakin Dec. 17, 2024, 2:48 p.m. UTC | #1
From: Jon Maxwell <jmaxwell37@gmail.com>
Date: Tue, 17 Dec 2024 10:48:50 +1100

> 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?

> 
> With this patch:
> 
> ethtool -S ens2f0np0 | grep non_eop_descs
>      non_eop_descs: 956719320
> 
> Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
> ---
>  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(+)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
> index 2f5d6f974185..8ff94400864e 100644
> --- a/drivers/net/ethernet/intel/ice/ice.h
> +++ b/drivers/net/ethernet/intel/ice/ice.h
> @@ -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;
>  
> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> index 3072634bf049..e85b664fa647 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> @@ -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 {
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 0ab35607e5d5..948c38c0770b 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -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 */

Thanks,
Olek
Jonathan Maxwell Dec. 17, 2024, 10:13 p.m. UTC | #2
On Wed, Dec 18, 2024 at 1:49 AM Alexander Lobakin
<aleksander.lobakin@intel.com> wrote:
>
> From: Jon Maxwell <jmaxwell37@gmail.com>
> Date: Tue, 17 Dec 2024 10:48:50 +1100
>
> > 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

> >
> > With this patch:
> >
> > ethtool -S ens2f0np0 | grep non_eop_descs
> >      non_eop_descs: 956719320
> >
> > Signed-off-by: Jon Maxwell <jmaxwell37@gmail.com>
> > ---
> >  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(+)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
> > index 2f5d6f974185..8ff94400864e 100644
> > --- a/drivers/net/ethernet/intel/ice/ice.h
> > +++ b/drivers/net/ethernet/intel/ice/ice.h
> > @@ -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;
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> > index 3072634bf049..e85b664fa647 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> > @@ -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 {
> > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> > index 0ab35607e5d5..948c38c0770b 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_main.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> > @@ -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 */
>
> Thanks,
> Olek
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index 2f5d6f974185..8ff94400864e 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -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;
 
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 3072634bf049..e85b664fa647 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -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 {
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 0ab35607e5d5..948c38c0770b 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -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 */