mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
To: stable@vger.kernel.org
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [REGRESSION] net: stmmac: v6.1.y clears xstats.pcpu_stats in __stmmac_open()
Date: Mon, 16 Nov 2026 14:10:57 +0900	[thread overview]
Message-ID: <2caa5a50-d3c8-4195-889d-52667dd95974@socionext.com> (raw)

Hi,

A regression appears to have been introduced in the v6.1.y stable series
after the per-CPU stmmac statistics backport.

Since v6.1.191, DMA interrupt handlers were converted by

     commit 52002cae02db ("net: stmmac: protect updates of 64-bit statistics counters")

from:
     priv->xstats.rxq_stats[chan]
     priv->xstats.txq_stats[chan]
to:
     this_cpu_ptr(priv->xstats.pcpu_stats)

where pcpu_stats is allocated during probe():

     priv->xstats.pcpu_stats =
             devm_netdev_alloc_pcpu_stats(...);

However, __stmmac_open() still contains:

     memset(&priv->xstats, 0,
            sizeof(struct stmmac_extra_stats));

which clears the pcpu_stats pointer allocated during probe.

As a result:

     probe()
         -> allocate xstats.pcpu_stats
     __stmmac_open()
         -> memset(&priv->xstats, ...)
         -> xstats.pcpu_stats = NULL
     dma_interrupt
         -> this_cpu_ptr(priv->xstats.pcpu_stats)

which appears to leave xstats.pcpu_stats cleared after allocation
during probe().

v6.6 and later do not appear to be affected because the xstats
memset was already removed by

     commit 2eb85b750512 ("net: stmmac: don't clear network statistics in .ndo_open()").

before the per-CPU statistics conversion was introduced.

Has anyone else observed this issue?

Thanks,

---
Best Regards
Kunihiko Hayashi

                 reply	other threads:[~2026-11-16  5:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=2caa5a50-d3c8-4195-889d-52667dd95974@socionext.com \
    --to=hayashi.kunihiko@socionext.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®