From: netdev-bot+sashiko@kernel.org
To: linusw@kernel.org
Cc: ulli.kroll@googlemail.com, andrew+netdev@lunn.ch,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
mirq-linux@rere.qmqm.pl, mhun512@gmail.com, edumazet@kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v8 15/19] net: ethernet: cortina: Serialize TX completion statistics
Date: Mon, 16 Nov 2026 14:45:50 +0000 [thread overview]
Message-ID: <179484035038.3136.14929259935888158241@kernel.org> (raw)
In-Reply-To: <20261112-gemini-ethernet-fixes-3-v8-15-f55bd43e02d3@kernel.org>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The comment on geth->irq_lock still describes it as a lock for
IRQ-related registers.
--
net: ethernet: cortina: Serialize TX completion statistics
This commit takes geth->irq_lock around the ir_stats_syncp writer section
in gmac_clean_txq(), so the TX completion counters are serialized against
the MIB and RX overrun writers. It also switches the tx_frag_stats update
to the irqsave variants of the u64_stats writer helpers.
> diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
> index 5a87d88607cdb..cc26ff16a0a36 100644
> --- a/drivers/net/ethernet/cortina/gemini.c
> +++ b/drivers/net/ethernet/cortina/gemini.c
[ ... ]
> @@ -716,18 +717,21 @@ static void gmac_clean_txq(struct net_device *netdev, struct gmac_txq *txq,
[ ... ]
> + spin_lock_irqsave(&geth->irq_lock, flags);
> u64_stats_update_begin(&port->ir_stats_syncp);
> port->stats.tx_errors += errs;
> port->stats.tx_packets += pkts;
> port->stats.tx_bytes += bytes;
> port->tx_hw_csummed += hwchksum;
> u64_stats_update_end(&port->ir_stats_syncp);
> + spin_unlock_irqrestore(&geth->irq_lock, flags);
[Severity: Low]
This isn't a bug, but should the comment on irq_lock in struct
gemini_ethernet be updated as well? It still says:
spinlock_t irq_lock; /* Locks IRQ-related registers */
This new critical section in gmac_clean_txq() does not touch any registers.
It only serializes the software counters under ir_stats_syncp against the
writers in gmac_update_hw_stats() and gmac_irq(). After this patch, irq_lock
is also the lock every ir_stats_syncp writer has to hold, and the struct
comment does not mention that.
A related issue predates this patch and was not introduced by it. The
reader in gmac_get_stats64() says:
/* Racing with MIB and TX completion interrupts */
gmac_clean_txq() is only called from gmac_start_xmit() and
gmac_cleanup_txqs(), never from an interrupt handler. Could that comment be
corrected at the same time?
>
> txq->cptr = c;
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-gemini-ethernet-fixes-3-v8-0-f55bd43e02d3%40kernel.org
next prev parent reply other threads:[~2026-11-16 14:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 13:30 [PATCH net-next v8 00/19] net: ethernet: cortina: Fix Gemini RX/TX buffer management Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 01/19] net: ethernet: cortina: Keep shared free queue parent-owned Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 02/19] net: ethernet: cortina: Keep ports bound for shared IRQ Linus Walleij
2026-11-16 14:45 ` netdev-bot+sashiko
2026-11-12 13:30 ` [PATCH net-next v8 03/19] net: ethernet: cortina: Drain free queue IRQ before resize Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 04/19] net: ethernet: cortina: Normalize free queue pointers on rebuild Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 05/19] net: ethernet: cortina: Correct free queue DMA mappings Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 06/19] net: ethernet: cortina: Index free queue fragments with XArray Linus Walleij
2026-11-16 14:45 ` netdev-bot+sashiko
2026-11-12 13:30 ` [PATCH net-next v8 07/19] net: ethernet: cortina: Preserve in-flight free queue pages Linus Walleij
2026-11-16 14:45 ` netdev-bot+sashiko
2026-11-12 13:30 ` [PATCH net-next v8 08/19] net: ethernet: cortina: Rotate free queue page allocation Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 09/19] net: ethernet: cortina: Recycle claimed free queue pages Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 10/19] net: ethernet: cortina: Separate RX buffer capacity from free queue size Linus Walleij
2026-11-16 14:45 ` netdev-bot+sashiko
2026-11-12 13:30 ` [PATCH net-next v8 11/19] net: ethernet: cortina: Validate RX fragment lengths Linus Walleij
2026-11-16 14:45 ` netdev-bot+sashiko
2026-11-12 13:30 ` [PATCH net-next v8 12/19] net: ethernet: cortina: Account RX buffer size in truesize Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 13/19] net: ethernet: cortina: Release partial RX frames on stop Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 14/19] net: ethernet: cortina: Scale Gemini RX queues to system memory Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 15/19] net: ethernet: cortina: Serialize TX completion statistics Linus Walleij
2026-11-16 14:45 ` netdev-bot+sashiko [this message]
2026-11-12 13:30 ` [PATCH net-next v8 16/19] net: ethernet: cortina: Scope RX statistics updates Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 17/19] net: ethernet: cortina: Drain RX coalescing timer on stop Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 18/19] net: ethernet: cortina: Reject TX rings smaller than retained pointers Linus Walleij
2026-11-12 13:30 ` [PATCH net-next v8 19/19] net: ethernet: cortina: Fix ethtool statistics reads Linus Walleij
2026-11-16 14:45 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179484035038.3136.14929259935888158241@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=mhun512@gmail.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ulli.kroll@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox