On Mon, 13 Jul 2020 14:42:26 +0300 Igor Russkikh wrote: > From: Dmitry Bogdanov <dbogda...@marvell.com> > > This patch adds additional per-queue stats, these could > be useful for debugging and diagnostics. > > Signed-off-by: Dmitry Bogdanov <dbogda...@marvell.com> > Signed-off-by: Mark Starovoytov <mstarovoi...@marvell.com> > Signed-off-by: Igor Russkikh <irussk...@marvell.com>
> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h > b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h > index 2c96f20f6289..c31d4642d280 100644 > --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h > +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h > @@ -1,7 +1,8 @@ > /* SPDX-License-Identifier: GPL-2.0-only */ > -/* > - * aQuantia Corporation Network Driver > - * Copyright (C) 2014-2019 aQuantia Corporation. All rights reserved > +/* Atlantic Network Driver > + * > + * Copyright (C) 2014-2019 aQuantia Corporation > + * Copyright (C) 2019-2020 Marvell International Ltd. > */ > > /* File aq_ring.h: Declaration of functions for Rx/Tx rings. */ > @@ -93,6 +94,10 @@ struct aq_ring_stats_rx_s { > u64 bytes; > u64 lro_packets; > u64 jumbo_packets; > + u64 alloc_fails; > + u64 skb_alloc_fails; > + u64 polls; > + u64 irqs; > u64 pg_losts; > u64 pg_flips; > u64 pg_reuses; > @@ -44,6 +45,7 @@ static int aq_vec_poll(struct napi_struct *napi, int budget) > } else { > for (i = 0U, ring = self->ring[0]; > self->tx_rings > i; ++i, ring = self->ring[i]) { > + ring[AQ_VEC_RX_ID].stats.rx.polls++; You need to use the u64_stats_update_* infrastructure or make these stats smaller than u64, cause on non-64bit machines where the stats will be updated 32bit-by-32bit meaning readers can see a half-updated counter.. > if (self->aq_hw_ops->hw_ring_tx_head_update) { > err = self->aq_hw_ops->hw_ring_tx_head_update( > self->aq_hw, > @@ -314,6 +316,7 @@ irqreturn_t aq_vec_isr(int irq, void *private) > err = -EINVAL; > goto err_exit; > } > + self->ring[0][AQ_VEC_RX_ID].stats.rx.irqs++; Why do you need this? Every IRQ has a firing counter in /proc/interrupts. > napi_schedule(&self->napi); > > err_exit: