mbox series

[net-next,0/2] net: cadence: macb: Modernize statistics reporting

Message ID 20250214212703.2618652-1-sean.anderson@linux.dev (mailing list archive)
Headers show
Series net: cadence: macb: Modernize statistics reporting | expand

Message

Sean Anderson Feb. 14, 2025, 9:27 p.m. UTC
Implement the modern interfaces for statistics reporting.


Sean Anderson (2):
  net: cadence: macb: Convert to get_stats64
  net: cadence: macb: Report standard stats

 drivers/net/ethernet/cadence/macb.h      | 130 ++++++++--------
 drivers/net/ethernet/cadence/macb_main.c | 190 ++++++++++++++++++++---
 2 files changed, 235 insertions(+), 85 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 19, 2025, 2:10 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 14 Feb 2025 16:27:01 -0500 you wrote:
> Implement the modern interfaces for statistics reporting.
> 
> 
> Sean Anderson (2):
>   net: cadence: macb: Convert to get_stats64
>   net: cadence: macb: Report standard stats
> 
> [...]

Here is the summary with links:
  - [net-next,1/2] net: cadence: macb: Convert to get_stats64
    https://git.kernel.org/netdev/net-next/c/75696dd0fd72
  - [net-next,2/2] net: cadence: macb: Report standard stats
    https://git.kernel.org/netdev/net-next/c/f6af690a295a

You are awesome, thank you!
Sean Anderson Feb. 20, 2025, 4:01 p.m. UTC | #2
On 2/18/25 21:10, patchwork-bot+netdevbpf@kernel.org wrote:
> Hello:
> 
> This series was applied to netdev/net-next.git (main)
> by Jakub Kicinski <kuba@kernel.org>:
> 
> On Fri, 14 Feb 2025 16:27:01 -0500 you wrote:
>> Implement the modern interfaces for statistics reporting.
>> 
>> 
>> Sean Anderson (2):
>>   net: cadence: macb: Convert to get_stats64
>>   net: cadence: macb: Report standard stats
>> 
>> [...]
> 
> Here is the summary with links:
>   - [net-next,1/2] net: cadence: macb: Convert to get_stats64
>     https://git.kernel.org/netdev/net-next/c/75696dd0fd72
>   - [net-next,2/2] net: cadence: macb: Report standard stats
>     https://git.kernel.org/netdev/net-next/c/f6af690a295a
> 
> You are awesome, thank you!

I think this should be deferred until v2 of [1] is applied, to make
backporting the fix easier.

--Sean

[1] lore.kernel.org/netdev/20250218195036.37137-1-sean.anderson@linux.dev
Jakub Kicinski Feb. 20, 2025, 4:59 p.m. UTC | #3
On Thu, 20 Feb 2025 11:01:10 -0500 Sean Anderson wrote:
> > Here is the summary with links:
> >   - [net-next,1/2] net: cadence: macb: Convert to get_stats64
> >     https://git.kernel.org/netdev/net-next/c/75696dd0fd72
> >   - [net-next,2/2] net: cadence: macb: Report standard stats
> >     https://git.kernel.org/netdev/net-next/c/f6af690a295a
> > 
> > You are awesome, thank you!  
> 
> I think this should be deferred until v2 of [1] is applied, to make
> backporting the fix easier.

ETOOLATE :) networking trees don't rebase
Sean Anderson Feb. 20, 2025, 5:25 p.m. UTC | #4
On 2/20/25 11:59, Jakub Kicinski wrote:
> On Thu, 20 Feb 2025 11:01:10 -0500 Sean Anderson wrote:
>> > Here is the summary with links:
>> >   - [net-next,1/2] net: cadence: macb: Convert to get_stats64
>> >     https://git.kernel.org/netdev/net-next/c/75696dd0fd72
>> >   - [net-next,2/2] net: cadence: macb: Report standard stats
>> >     https://git.kernel.org/netdev/net-next/c/f6af690a295a
>> > 
>> > You are awesome, thank you!  
>> 
>> I think this should be deferred until v2 of [1] is applied, to make
>> backporting the fix easier.
> 
> ETOOLATE :) networking trees don't rebase

Well, I was expecting a revert and then I would resend this series once
the linked patch was applied.

I guess I can send another patch adding locking?

--Sean
Jakub Kicinski Feb. 20, 2025, 6:18 p.m. UTC | #5
On Thu, 20 Feb 2025 12:25:09 -0500 Sean Anderson wrote:
> >> I think this should be deferred until v2 of [1] is applied, to make
> >> backporting the fix easier.  
> > 
> > ETOOLATE :) networking trees don't rebase  
> 
> Well, I was expecting a revert and then I would resend this series once
> the linked patch was applied.
> 
> I guess I can send another patch adding locking?

Assuming the fix is applied to net:
Will the trees conflict?
If no - will the code in net still work (just lacking lock protection)?

If there is a conflict you can share a resolution with me and I'll slap
it on as part of the merge.
Sean Anderson Feb. 20, 2025, 6:22 p.m. UTC | #6
On 2/20/25 13:18, Jakub Kicinski wrote:
> On Thu, 20 Feb 2025 12:25:09 -0500 Sean Anderson wrote:
>> >> I think this should be deferred until v2 of [1] is applied, to make
>> >> backporting the fix easier.  
>> > 
>> > ETOOLATE :) networking trees don't rebase  
>> 
>> Well, I was expecting a revert and then I would resend this series once
>> the linked patch was applied.
>> 
>> I guess I can send another patch adding locking?
> 
> Assuming the fix is applied to net:
> Will the trees conflict?

Yes.

> If no - will the code in net still work (just lacking lock protection)?
> 
> If there is a conflict you can share a resolution with me and I'll slap
> it on as part of the merge.

OK, what's the best way to create that? git rerere?

--Sean
Jakub Kicinski Feb. 20, 2025, 6:32 p.m. UTC | #7
On Thu, 20 Feb 2025 13:22:29 -0500 Sean Anderson wrote:
> > If no - will the code in net still work (just lacking lock protection)?
> > 
> > If there is a conflict you can share a resolution with me and I'll slap
> > it on as part of the merge.  
> 
> OK, what's the best way to create that? git rerere?

rerere image or a three way diff will work
Sean Anderson Feb. 20, 2025, 6:42 p.m. UTC | #8
On 2/20/25 13:32, Jakub Kicinski wrote:
> On Thu, 20 Feb 2025 13:22:29 -0500 Sean Anderson wrote:
>> > If no - will the code in net still work (just lacking lock protection)?
>> > 
>> > If there is a conflict you can share a resolution with me and I'll slap
>> > it on as part of the merge.  
>> 
>> OK, what's the best way to create that? git rerere?
> 
> rerere image or a three way diff will work

--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -3098,16 +3098,9 @@
 {
 	struct gem_stats *hwstat = &bp->hw_stats.gem;
 
-<<<<<<<
-	if (!netif_running(bp->dev))
-		return nstat;
-
 	spin_lock_irq(&bp->stats_lock);
-	gem_update_stats(bp);
-=======
 	if (netif_running(bp->dev))
 		gem_update_stats(bp);
->>>>>>>
 
 	nstat->rx_errors = (hwstat->rx_frame_check_sequence_errors +
 			    hwstat->rx_alignment_errors +
@@ -3136,12 +3129,7 @@
 	nstat->tx_aborted_errors = hwstat->tx_excessive_collisions;
 	nstat->tx_carrier_errors = hwstat->tx_carrier_sense_errors;
 	nstat->tx_fifo_errors = hwstat->tx_underrun;
-<<<<<<<
-=======
 	spin_unlock_irq(&bp->stats_lock);
-
-	return nstat;
->>>>>>>
 }
 
 static void gem_get_ethtool_stats(struct net_device *dev,
@@ -3240,11 +3228,8 @@
 	nstat->tx_carrier_errors = hwstat->tx_carrier_errors;
 	nstat->tx_fifo_errors = hwstat->tx_underruns;
 	/* Don't know about heartbeat or window errors... */
-<<<<<<<
 	spin_unlock_irq(&bp->stats_lock);
-=======
 }
->>>>>>>
 
 static void macb_get_pause_stats(struct net_device *dev,
 				 struct ethtool_pause_stats *pause_stats)
Jakub Kicinski Feb. 20, 2025, 6:50 p.m. UTC | #9
On Thu, 20 Feb 2025 13:42:25 -0500 Sean Anderson wrote:
> On 2/20/25 13:32, Jakub Kicinski wrote:
> > On Thu, 20 Feb 2025 13:22:29 -0500 Sean Anderson wrote:  
> >> OK, what's the best way to create that? git rerere?  
> > 
> > rerere image or a three way diff will work  
> 
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c

That should work, thanks!