* [net-next] ice: expose non_eop_descs to ethtool
@ 2024-12-16 23:48 Jon Maxwell
2024-12-17 14:48 ` [Intel-wired-lan] " Alexander Lobakin
0 siblings, 1 reply; 4+ messages in thread
From: Jon Maxwell @ 2024-12-16 23:48 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: przemyslaw.kitszel, andrew+netdev, davem, edumazet, kuba, pabeni,
intel-wired-lan, netdev, linux-kernel, jmaxwell37
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(+)
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 */
--
2.47.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [net-next] ice: expose non_eop_descs to ethtool
2024-12-16 23:48 [net-next] ice: expose non_eop_descs to ethtool Jon Maxwell
@ 2024-12-17 14:48 ` Alexander Lobakin
2024-12-17 22:13 ` Jonathan Maxwell
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Lobakin @ 2024-12-17 14:48 UTC (permalink / raw)
To: Jon Maxwell
Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem,
edumazet, kuba, pabeni, intel-wired-lan, netdev, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [net-next] ice: expose non_eop_descs to ethtool
2024-12-17 14:48 ` [Intel-wired-lan] " Alexander Lobakin
@ 2024-12-17 22:13 ` Jonathan Maxwell
2024-12-18 15:51 ` Alexander Lobakin
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Maxwell @ 2024-12-17 22:13 UTC (permalink / raw)
To: Alexander Lobakin
Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem,
edumazet, kuba, pabeni, intel-wired-lan, netdev, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [net-next] ice: expose non_eop_descs to ethtool
2024-12-17 22:13 ` Jonathan Maxwell
@ 2024-12-18 15:51 ` Alexander Lobakin
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Lobakin @ 2024-12-18 15:51 UTC (permalink / raw)
To: Jonathan Maxwell
Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, davem,
edumazet, kuba, pabeni, intel-wired-lan, netdev, linux-kernel
From: Jonathan Maxwell <jmaxwell37@gmail.com>
Date: Wed, 18 Dec 2024 09:13:00 +1100
> 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.
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.
>
> Regards
>
> Jon
Thanks,
Olek
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-18 15:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-16 23:48 [net-next] ice: expose non_eop_descs to ethtool Jon Maxwell
2024-12-17 14:48 ` [Intel-wired-lan] " Alexander Lobakin
2024-12-17 22:13 ` Jonathan Maxwell
2024-12-18 15:51 ` Alexander Lobakin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).