Re: [PATCH net-next 0/2] net: cadence: macb: Modernize statistics reporting
From: Sean Anderson
Date: Thu Feb 20 2025 - 13:42:44 EST
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)