diff mbox series

[net] docs: net: fix documentation on .ndo_get_stats

Message ID 20201231034524.1570729-1-kuba@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] docs: net: fix documentation on .ndo_get_stats | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success No Fixes tags, but series doesn't touch code
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers warning 2 maintainers not CCed: corbet@lwn.net linux-doc@vger.kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Jakub Kicinski Dec. 31, 2020, 3:45 a.m. UTC
Fix calling context.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 Documentation/networking/netdevices.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Vladimir Oltean Jan. 4, 2021, 10:42 a.m. UTC | #1
On Wed, Dec 30, 2020 at 07:45:24PM -0800, Jakub Kicinski wrote:
> Fix calling context.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  Documentation/networking/netdevices.rst | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/networking/netdevices.rst b/Documentation/networking/netdevices.rst
> index 5a85fcc80c76..a80676f5477d 100644
> --- a/Documentation/networking/netdevices.rst
> +++ b/Documentation/networking/netdevices.rst
> @@ -64,8 +64,8 @@ struct net_device synchronization rules
>  	Context: process
>  
>  ndo_get_stats:
> -	Synchronization: dev_base_lock rwlock.
> -	Context: nominally process, but don't sleep inside an rwlock
> +	Synchronization: rtnl_lock() semaphore, or RCU.
> +	Context: atomic
>  
>  ndo_start_xmit:
>  	Synchronization: __netif_tx_lock spinlock.
> -- 
> 2.26.2
> 

And what happened to dev_base_lock? Did it suddenly go away?
Jakub Kicinski Jan. 4, 2021, 5:53 p.m. UTC | #2
On Mon, 4 Jan 2021 12:42:27 +0200 Vladimir Oltean wrote:
> On Wed, Dec 30, 2020 at 07:45:24PM -0800, Jakub Kicinski wrote:
> > Fix calling context.
> > 
> > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > ---
> >  Documentation/networking/netdevices.rst | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Documentation/networking/netdevices.rst b/Documentation/networking/netdevices.rst
> > index 5a85fcc80c76..a80676f5477d 100644
> > --- a/Documentation/networking/netdevices.rst
> > +++ b/Documentation/networking/netdevices.rst
> > @@ -64,8 +64,8 @@ struct net_device synchronization rules
> >  	Context: process
> >  
> >  ndo_get_stats:
> > -	Synchronization: dev_base_lock rwlock.
> > -	Context: nominally process, but don't sleep inside an rwlock
> > +	Synchronization: rtnl_lock() semaphore, or RCU.
> > +	Context: atomic
> >  
> >  ndo_start_xmit:
> >  	Synchronization: __netif_tx_lock spinlock.
> 
> And what happened to dev_base_lock? Did it suddenly go away?

I thought all callers switched to RCU. You investigated this in depth,
did I miss something? I'm sending this correction because I have a
series which adds to other sections of this file and this jumped out 
to me as incorrect.
Vladimir Oltean Jan. 5, 2021, 1:03 a.m. UTC | #3
On Mon, Jan 04, 2021 at 09:53:09AM -0800, Jakub Kicinski wrote:
> On Mon, 4 Jan 2021 12:42:27 +0200 Vladimir Oltean wrote:
> > On Wed, Dec 30, 2020 at 07:45:24PM -0800, Jakub Kicinski wrote:
> > > Fix calling context.
> > >
> > > Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> > > ---
> > >  Documentation/networking/netdevices.rst | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/Documentation/networking/netdevices.rst b/Documentation/networking/netdevices.rst
> > > index 5a85fcc80c76..a80676f5477d 100644
> > > --- a/Documentation/networking/netdevices.rst
> > > +++ b/Documentation/networking/netdevices.rst
> > > @@ -64,8 +64,8 @@ struct net_device synchronization rules
> > >  	Context: process
> > >
> > >  ndo_get_stats:
> > > -	Synchronization: dev_base_lock rwlock.
> > > -	Context: nominally process, but don't sleep inside an rwlock
> > > +	Synchronization: rtnl_lock() semaphore, or RCU.
> > > +	Context: atomic
> > >
> > >  ndo_start_xmit:
> > >  	Synchronization: __netif_tx_lock spinlock.
> >
> > And what happened to dev_base_lock? Did it suddenly go away?
>
> I thought all callers switched to RCU. You investigated this in depth,
> did I miss something? I'm sending this correction because I have a
> series which adds to other sections of this file and this jumped out
> to me as incorrect.

Well, there's netstat_show from net/core/net-sysfs.c still. I couldn't
figure why that lock exists, it doesn't seem to protect something in
particular.
Jakub Kicinski Jan. 5, 2021, 1:18 a.m. UTC | #4
On Tue, 5 Jan 2021 03:03:27 +0200 Vladimir Oltean wrote:
> On Mon, Jan 04, 2021 at 09:53:09AM -0800, Jakub Kicinski wrote:
> > On Mon, 4 Jan 2021 12:42:27 +0200 Vladimir Oltean wrote:  
> > > And what happened to dev_base_lock? Did it suddenly go away?  
> >
> > I thought all callers switched to RCU. You investigated this in depth,
> > did I miss something? I'm sending this correction because I have a
> > series which adds to other sections of this file and this jumped out
> > to me as incorrect.  
> 
> Well, there's netstat_show from net/core/net-sysfs.c still. I couldn't
> figure why that lock exists, it doesn't seem to protect something in
> particular.

Ah, thanks for pointing that out, in that case I should just add RCU
to the list of locks that may be held.
diff mbox series

Patch

diff --git a/Documentation/networking/netdevices.rst b/Documentation/networking/netdevices.rst
index 5a85fcc80c76..a80676f5477d 100644
--- a/Documentation/networking/netdevices.rst
+++ b/Documentation/networking/netdevices.rst
@@ -64,8 +64,8 @@  struct net_device synchronization rules
 	Context: process
 
 ndo_get_stats:
-	Synchronization: dev_base_lock rwlock.
-	Context: nominally process, but don't sleep inside an rwlock
+	Synchronization: rtnl_lock() semaphore, or RCU.
+	Context: atomic
 
 ndo_start_xmit:
 	Synchronization: __netif_tx_lock spinlock.