Re: [PATCH v2 1/3] net: bcmgenet: switch to use 64bit statistics
From: Zak Kemble
Date: Mon May 19 2025 - 07:39:12 EST
Thanks, v3 is here
https://lore.kernel.org/all/20250519113257.1031-1-zakkemble@xxxxxxxxx/
On Sat, 17 May 2025 at 01:52, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Thu, 15 May 2025 15:51:40 +0100 Zak Kemble wrote:
> > @@ -2315,7 +2358,7 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
> > if (unlikely(!(dma_flag & DMA_EOP) || !(dma_flag & DMA_SOP))) {
> > netif_err(priv, rx_status, dev,
> > "dropping fragmented packet!\n");
> > - ring->errors++;
> > + BCMGENET_STATS64_INC(stats, fragmented_errors);
>
> Please refrain from adding new counters in the conversion patch.
>
> > dev_kfree_skb_any(skb);
> > goto next;
> > }
>
> > @@ -3402,6 +3455,7 @@ static void bcmgenet_dump_tx_queue(struct bcmgenet_tx_ring *ring)
> > static void bcmgenet_timeout(struct net_device *dev, unsigned int txqueue)
> > {
> > struct bcmgenet_priv *priv = netdev_priv(dev);
> > + struct bcmgenet_tx_stats64 *stats = &priv->tx_rings[txqueue].stats64;
> > u32 int1_enable = 0;
> > unsigned int q;
>
> Please maintain the coding style of declaring variables from longest
> line to shortest. If there are dependencies the init should happen
> in the body of the function.
>
> > -static struct net_device_stats *bcmgenet_get_stats(struct net_device *dev)
> > +static void bcmgenet_get_stats64(struct net_device *dev,
> > + struct rtnl_link_stats64 *stats)
>
> the indent is way off here, in general please try to fit in 80chars
> unless the readability suffers.
> --
> pw-bot: cr