Re: [PATCH net] net: Fix inconsistent rtnl_lock usage on dev_get_stats().

2017-01-07 Thread David Miller
From: Eric Dumazet Date: Fri, 06 Jan 2017 12:13:23 -0800 > Well, there are cases where RTNL is quite contended, but supervisions > like to get /proc/net/devices or various sysfs attributes > (netstat_show() can be called very very often > for /sys/class/net/*/statistics/*) in a reasonable amount

Re: [PATCH net] net: Fix inconsistent rtnl_lock usage on dev_get_stats().

2017-01-06 Thread Eric Dumazet
On Fri, 2017-01-06 at 13:01 -0500, David Miller wrote: > From: Eric Dumazet > Date: Fri, 06 Jan 2017 09:32:56 -0800 > > > This makes no sense to me. > > > > RTNL is absolutely not needed to get device stats. > > > > We try to not add RTNL, especially when not required. > > > > Sure, RTNETLINK

Re: [PATCH net] net: Fix inconsistent rtnl_lock usage on dev_get_stats().

2017-01-06 Thread Michael Chan
On Fri, Jan 6, 2017 at 10:01 AM, David Miller wrote: > From: Eric Dumazet > Date: Fri, 06 Jan 2017 09:32:56 -0800 > >> This makes no sense to me. >> >> RTNL is absolutely not needed to get device stats. >> >> We try to not add RTNL, especially when not required. >> >> Sure, RTNETLINK dumps curren

Re: [PATCH net] net: Fix inconsistent rtnl_lock usage on dev_get_stats().

2017-01-06 Thread David Miller
From: Eric Dumazet Date: Fri, 06 Jan 2017 09:32:56 -0800 > This makes no sense to me. > > RTNL is absolutely not needed to get device stats. > > We try to not add RTNL, especially when not required. > > Sure, RTNETLINK dumps currently hold RTNL, but we had various attempts > in the past to get

Re: [PATCH net] net: Fix inconsistent rtnl_lock usage on dev_get_stats().

2017-01-06 Thread Eric Dumazet
On Thu, 2017-01-05 at 23:21 -0500, Michael Chan wrote: > Some callers take rtnl_lock() before calling dev_get_stats() and some > don't. Most network drivers expect the ndo_get_stats64() to be called > under rtnl_lock() to avoid race conditions with device close or ethtool > reconfigurations. Fix

[PATCH net] net: Fix inconsistent rtnl_lock usage on dev_get_stats().

2017-01-05 Thread Michael Chan
Some callers take rtnl_lock() before calling dev_get_stats() and some don't. Most network drivers expect the ndo_get_stats64() to be called under rtnl_lock() to avoid race conditions with device close or ethtool reconfigurations. Fix it so that all callers take rtnl_lock(). Rename the original d