]> www.infradead.org Git - users/jedix/linux-maple.git/commit
eth: fbnic: add locking support for hw stats
authorMohsin Bashir <mohsin.bashr@gmail.com>
Thu, 10 Apr 2025 07:08:55 +0000 (00:08 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 15 Apr 2025 09:23:13 +0000 (11:23 +0200)
commit9f61eb2d185b06d49ef8c25af994d6fc571433cc
tree998850f6851911c409d4776613ba31bfb85c2178
parent24e31e4747698dc50d408f0082d7eb9b9520d2f6
eth: fbnic: add locking support for hw stats

This patch adds lock protection for the hardware statistics for fbnic.
The hardware statistics access via ndo_get_stats64 is not protected by
the rtnl_lock(). Since these stats can be accessed from different places
in the code such as service task, ethtool, Q-API, and net_device_ops, a
lock-less approach can lead to races.

Note that this patch is not a fix rather, just a prep for the subsequent
changes in this series.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250410070859.4160768-2-mohsin.bashr@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic.h
drivers/net/ethernet/meta/fbnic/fbnic_hw_stats.c
drivers/net/ethernet/meta/fbnic/fbnic_pci.c