From: Shlomo Pongartz <shlomop@mellanox•com>
To: <netdev@vger•kernel.org>
Subject: ndo_get_stats and rtnl_netlink
Date: Sun, 9 Sep 2012 18:23:16 +0300 [thread overview]
Message-ID: <504CB464.6010207@mellanox.com> (raw)
Hi,
Just realized that dev_get_stats which calls into a netdevice
ndo_get_stats64/ndo_get_stats can be
called with or without RTNL lock protection. If called from
rtnl_fill_ifinfo e.g as of invocation of
"ip link show <interface>, there IS locking, however if called from
dev_seq_printf_stats e.g as of
invocation of reading the /sys/class/net/<interface>/statistics/
entries, etc more cases -- no locking.
This turned to be problematic when implementing the ethtool
"set_channels" directive which
changes the number of **rings**, since we stepped on a bug where the
rings data structure was
changed by the ethtool flow in the same time a statistics call was done
into the driver, etc.
What would be the way to continue here, per driver lock sounds non
generic...
Regards
Shlomo Pongratz
next reply other threads:[~2012-09-09 15:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-09 15:23 Shlomo Pongartz [this message]
2012-09-10 9:09 ` ndo_get_stats and rtnl_netlink Eric Dumazet
2012-09-10 19:10 ` Or Gerlitz
2012-09-10 19:15 ` Eric Dumazet
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=504CB464.6010207@mellanox.com \
--to=shlomop@mellanox$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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