[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <63d66bfd-c082-4bc3-9797-5c91b972cb1c@intel.com>
Date: Tue, 26 Aug 2025 16:33:15 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, <davem@...emloft.net>
CC: <netdev@...r.kernel.org>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<andrew+netdev@...n.ch>, <horms@...nel.org>, <mohsin.bashr@...il.com>,
<vadim.fedorenko@...ux.dev>
Subject: Re: [PATCH net-next v2 3/6] eth: fbnic: Reset MAC stats
On 8/25/2025 1:02 PM, Jakub Kicinski wrote:
> From: Mohsin Bashir <mohsin.bashr@...il.com>
>
> Reset the MAC stats as part of the hardware stats reset to ensure
> consistency. Currently, hardware stats are reset during device bring-up
> and upon experiencing PCI errors; however, MAC stats are being skipped
> during these resets.
>
> When fbnic_reset_hw_stats() is called upon recovering from PCI error,
> MAC stats are accessed outside the rtnl_lock. The only other access to
> MAC stats is via the ethtool API, which is protected by rtnl_lock. This
> can result in concurrent access to MAC stats and a potential race. Protect
> the fbnic_reset_hw_stats() call in __fbnic_pm_attach() with rtnl_lock to
> avoid this.
>
> Note that fbnic_reset_hw_mac_stats() is called outside the hardware
> stats lock which protects access to the fbnic_hw_stats. This is intentional
> because MAC stats are fetched from the device outside this lock and are
> exclusively read via the ethtool API.
>
> Signed-off-by: Mohsin Bashir <mohsin.bashr@...il.com>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)
Powered by blists - more mailing lists