Patchwork [v2,1/1] core:Change a wrong explain about dev_get_by_name

login
register
mail settings
Submitter Tingwei Liu
Date March 25, 2013, 4:10 a.m.
Message ID <CA+qZnSTm8kdmrzQLc03Jyk81cBtEpCNHqsT1fFCQ_vstzYcOiw@mail.gmail.com>
Download mbox | patch
Permalink /patch/230572/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Tingwei Liu - March 25, 2013, 4:10 a.m.
From: Tingwei Liu <tingw.liu@gmail.com>
Date: Mon, 25 Mar 2013 11:09:59 +0800
Subject: [PATCH] Change a wrong explain about dev_get_by_name

a long time ago by the  commit.

 commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
 Author: Linus Torvalds <torvalds@ppc970.osdl.org>
 Date:   Sat Apr 16 15:20:36 2005 -0700

    Linux-2.6.12-rc2

    Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

When function "list_netdevice" get write lock "dev_base_lock" only
disable soft interrupt. So dev_get_by_name get read lock
"dev_base_lock", can not called on interrupt context.


Signed-off-by: Tingwei Liu <tingw.liu@gmail.com>
---
Changes from v1:
- add change log
- add the commnet

 net/core/dev.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

--
1.6.0.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov - March 25, 2013, 3:44 p.m.
Hello.

On 25-03-2013 8:10, tingwei liu wrote:

> From: Tingwei Liu <tingw.liu@gmail.com>
> Date: Mon, 25 Mar 2013 11:09:59 +0800
> Subject: [PATCH] Change a wrong explain about dev_get_by_name

> a long time ago by the  commit.

    Did you mean "before the commit"?

>   commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
>   Author: Linus Torvalds <torvalds@ppc970.osdl.org>
>   Date:   Sat Apr 16 15:20:36 2005 -0700

>      Linux-2.6.12-rc2

>      Initial git repository build. I'm not bothering with the full history,
>      even though we have it. We can create a separate "historical" git
>      archive of that later if we want to, and in the meantime it's about
>      3.2GB when imported into git - space that would just make the early
>      git days unnecessarily complicated, when we don't have a lot of good
>      infrastructure for it.

>      Let it rip!

> When function "list_netdevice" get write lock "dev_base_lock" only
> disable soft interrupt. So dev_get_by_name get read lock
> "dev_base_lock", can not called on interrupt context.

> Signed-off-by: Tingwei Liu <tingw.liu@gmail.com>
> ---
> Changes from v1:
> - add change log
> - add the commnet
>
>   net/core/dev.c |    8 ++++----
>   1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index d540ced..20c5c7c 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -700,10 +700,10 @@ EXPORT_SYMBOL(dev_get_by_name_rcu);
>   *     @name: name to find
>   *
>   *     Find an interface by name. This can be called from any
> - *     context and does its own locking. The returned handle has
> - *     the usage count incremented and the caller must use dev_put() to
> - *     release it when it is no longer needed. %NULL is returned if no
> - *     matching device is found.
> + *     context except hard irq context and does its own locking.
> + *     The returned handle has the usage count incremented and the
> + *     caller must use dev_put() to release it when it is no longer
> + *     needed. %NULL is returned if no matching device is found.

    It seems your patch has all the tabs replaced by spaces.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - March 25, 2013, 4:09 p.m.
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Mon, 25 Mar 2013 19:44:10 +0400

>    It seems your patch has all the tabs replaced by spaces.

I think this patch should simply be aborted.  It hasn't addressed any
of Eric Dumazet's concerns, the patch submitter can't even keep the
patch from being corrupted by his email client, and the patch is of
near zero value as far as I'm concerned especially considering how
much work and effort is going into hand holding this patch submitter.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index d540ced..20c5c7c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -700,10 +700,10 @@  EXPORT_SYMBOL(dev_get_by_name_rcu);
  *     @name: name to find
  *
  *     Find an interface by name. This can be called from any
- *     context and does its own locking. The returned handle has
- *     the usage count incremented and the caller must use dev_put() to
- *     release it when it is no longer needed. %NULL is returned if no
- *     matching device is found.
+ *     context except hard irq context and does its own locking.
+ *     The returned handle has the usage count incremented and the
+ *     caller must use dev_put() to release it when it is no longer
+ *     needed. %NULL is returned if no matching device is found.
  */

 struct net_device *dev_get_by_name(struct net *net, const char *name)