netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 07/14] bridge: add some comments for NETDEV_RELEASE
  2012-08-09 15:00 [PATCH v3 0/14] some netpoll and netconsole fixes Cong Wang
@ 2012-08-09 15:00 ` Cong Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Cong Wang @ 2012-08-09 15:00 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, David Miller, Stephen Hemminger

Add comments on why we don't notify NETDEV_RELEASE.

Cc: David Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
 net/bridge/br_if.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 171fd6b..bf47d4f 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -427,6 +427,9 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
 	if (!p || p->br != br)
 		return -EINVAL;
 
+	/* We don't notify NETDEV_RELEASE event, as this will
+	 * stop netconsole on the bridge.
+	 */
 	del_nbp(p);
 
 	spin_lock_bh(&br->lock);
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 07/14] bridge: add some comments for NETDEV_RELEASE
@ 2012-08-09 19:44 Stephen Hemminger
  2012-08-10  2:38 ` Cong Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2012-08-09 19:44 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, David Miller, Stephen Hemminger

If you are going to add an explanation, then I would prefer a more complete one. Something like:
"Since more than one interface can be attached to a bridge, there still maybe an alternate path for netconsole to use; therefore there is no reason for a NETDEV_RELEASE event."

But my opinion it really isn't necessary to document what isn't done in the code, only what is done. The purpose of comments is to explain the wider impacts of the code.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 07/14] bridge: add some comments for NETDEV_RELEASE
  2012-08-09 19:44 [PATCH 07/14] bridge: add some comments for NETDEV_RELEASE Stephen Hemminger
@ 2012-08-10  2:38 ` Cong Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Cong Wang @ 2012-08-10  2:38 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, David Miller, Stephen Hemminger

On Thu, 2012-08-09 at 09:44 -1000, Stephen Hemminger wrote:
> If you are going to add an explanation, then I would prefer a more complete one. Something like:
> "Since more than one interface can be attached to a bridge, there still maybe an alternate path for netconsole to use; therefore there is no reason for a NETDEV_RELEASE event."

Yeah, this is better.

> 
> But my opinion it really isn't necessary to document what isn't done in the code, only what is done. The purpose of comments is to explain the wider impacts of the code.

The reason why I add it is to remind people like me who forgot the
reason behind. ;)

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 07/14] bridge: add some comments for NETDEV_RELEASE
  2012-08-10  7:10 [PATCH v4 00/14] some netpoll and netconsole fixes Cong Wang
@ 2012-08-10  7:10 ` Cong Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Cong Wang @ 2012-08-10  7:10 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, David Miller, Stephen Hemminger

Add comments on why we don't notify NETDEV_RELEASE.

Cc: David Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
 net/bridge/br_if.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 171fd6b..1c8fdc3 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -427,6 +427,10 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
 	if (!p || p->br != br)
 		return -EINVAL;
 
+	/* Since more than one interface can be attached to a bridge,
+	 * there still maybe an alternate path for netconsole to use;
+	 * therefore there is no reason for a NETDEV_RELEASE event.
+	 */
 	del_nbp(p);
 
 	spin_lock_bh(&br->lock);
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-10  7:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-09 19:44 [PATCH 07/14] bridge: add some comments for NETDEV_RELEASE Stephen Hemminger
2012-08-10  2:38 ` Cong Wang
  -- strict thread matches above, loose matches on Subject: below --
2012-08-10  7:10 [PATCH v4 00/14] some netpoll and netconsole fixes Cong Wang
2012-08-10  7:10 ` [PATCH 07/14] bridge: add some comments for NETDEV_RELEASE Cong Wang
2012-08-09 15:00 [PATCH v3 0/14] some netpoll and netconsole fixes Cong Wang
2012-08-09 15:00 ` [PATCH 07/14] bridge: add some comments for NETDEV_RELEASE Cong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).