From: Simon Horman <horms@kernel.org>
To: Mohsin Bashir <mohsin.bashr@gmail.com>
Cc: netdev@vger.kernel.org, alexanderduyck@fb.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kernel-team@meta.com, kuba@kernel.org,
linux-kernel@vger.kernel.org, pabeni@redhat.com, sdf@fomichev.me,
vadim.fedorenko@linux.dev
Subject: Re: [PATCH net 2/2] eth: fbnic: Lock the tx_dropped update
Date: Mon, 4 Aug 2025 12:12:51 +0100 [thread overview]
Message-ID: <20250804111251.GS8494@horms.kernel.org> (raw)
In-Reply-To: <20250802024636.679317-3-mohsin.bashr@gmail.com>
On Fri, Aug 01, 2025 at 07:46:36PM -0700, Mohsin Bashir wrote:
> Wrap copying of drop stats on TX path from fbd->hw_stats by the
> hw_stats_lock. Currently, it is being performed outside the lock and
> another thread accessing fbd->hw_stats can lead to inconsistencies.
>
> Fixes: 5f8bd2ce8269 ("eth: fbnic: add support for TMI stats")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Thanks,
I note that hw_stats_lock is documented as protecting hw_stats.
And that it is already used for that purpose elsewhere in
fbnic_get_stats64().
I do wonder if some refactoring could allow only locking
hw_stats_lock once in fbnic_get_stats64(). But that line of thought
doesn't effect the correctness of this patch.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2025-08-04 11:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-02 2:46 [PATCH net 0/2] eth: fbnic: Fix drop stats support Mohsin Bashir
2025-08-02 2:46 ` [PATCH net 1/2] eth: fbnic: Fix tx_dropped reporting Mohsin Bashir
2025-08-04 11:14 ` Simon Horman
2025-08-02 2:46 ` [PATCH net 2/2] eth: fbnic: Lock the tx_dropped update Mohsin Bashir
2025-08-04 11:12 ` Simon Horman [this message]
2025-08-05 23:20 ` [PATCH net 0/2] eth: fbnic: Fix drop stats support patchwork-bot+netdevbpf
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=20250804111251.GS8494@horms.kernel.org \
--to=horms@kernel.org \
--cc=alexanderduyck@fb.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mohsin.bashr@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=vadim.fedorenko@linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).