* [PATCH 0/1] bridge: turn off carrier when the bridge is created
@ 2015-03-10 7:09 Zhu Yanjun
2015-03-10 7:09 ` [PATCH 1/1] " Zhu Yanjun
0 siblings, 1 reply; 7+ messages in thread
From: Zhu Yanjun @ 2015-03-10 7:09 UTC (permalink / raw)
To: netdev, davem
V2:
From Stephen,
"This is intentional. If there are no active ports in bridge, then
we want to tell applications that packets will go nowhere."
V1:
I made this test on ubuntu 14.04 with kernel 3,19-rc7:
1. brctl addbr br0
2. ifconfig br0 up
3. ifconfig br0 (br0's status is with 'RUNNING')
4. brctl addif br0 eth0
5. brctl delif br0 eth0
6. ifconfig br0 (br0's status is without 'RUNNING')
When there is no sub-interface, the flag "RUNNING" is missing after the last sub-interface is removed.
As such, should we keep "RUNNING" flag after the last sub-interface is removed?
Zhu Yanjun (1):
bridge: turn off carrier when the bridge is created
net/bridge/br_device.c | 4 ++++
1 file changed, 4 insertions(+)
--
1.9.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/1] bridge: turn off carrier when the bridge is created
2015-03-10 7:09 [PATCH 0/1] bridge: turn off carrier when the bridge is created Zhu Yanjun
@ 2015-03-10 7:09 ` Zhu Yanjun
2015-03-11 2:39 ` yzhu1
0 siblings, 1 reply; 7+ messages in thread
From: Zhu Yanjun @ 2015-03-10 7:09 UTC (permalink / raw)
To: netdev, davem
When a bridge interface is created, there is no any sub interface
in it. In this case, the packets should not go to this bridge interface.
As such, carrier is turned off.
CC: David Ahern <dsahern@gmail.com>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Zhu Yanjun <Yanjun.Zhu@windriver.com>
---
net/bridge/br_device.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index ffd379d..fcc4794 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -394,4 +394,8 @@ void br_dev_setup(struct net_device *dev)
br_netfilter_rtable_init(br);
br_stp_timer_init(br);
br_multicast_init(br);
+
+ /* Shutdown bridge to avoid packets */
+ if (netif_carrier_ok(dev))
+ netif_carrier_off(dev);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] bridge: turn off carrier when the bridge is created
2015-03-10 7:09 ` [PATCH 1/1] " Zhu Yanjun
@ 2015-03-11 2:39 ` yzhu1
2015-03-11 4:03 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: yzhu1 @ 2015-03-11 2:39 UTC (permalink / raw)
To: netdev, davem, Stephen Hemminger, dsahern
Hi, Stephen && David
Any comment?
Best Regards!
Zhu Yanjun
On 03/10/2015 03:09 PM, Zhu Yanjun wrote:
> When a bridge interface is created, there is no any sub interface
> in it. In this case, the packets should not go to this bridge interface.
> As such, carrier is turned off.
>
> CC: David Ahern <dsahern@gmail.com>
> Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: Zhu Yanjun <Yanjun.Zhu@windriver.com>
> ---
> net/bridge/br_device.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
> index ffd379d..fcc4794 100644
> --- a/net/bridge/br_device.c
> +++ b/net/bridge/br_device.c
> @@ -394,4 +394,8 @@ void br_dev_setup(struct net_device *dev)
> br_netfilter_rtable_init(br);
> br_stp_timer_init(br);
> br_multicast_init(br);
> +
> + /* Shutdown bridge to avoid packets */
> + if (netif_carrier_ok(dev))
> + netif_carrier_off(dev);
> }
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] bridge: turn off carrier when the bridge is created
2015-03-11 2:39 ` yzhu1
@ 2015-03-11 4:03 ` David Miller
2015-03-11 5:26 ` Stephen Hemminger
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2015-03-11 4:03 UTC (permalink / raw)
To: Yanjun.Zhu; +Cc: netdev, stephen, dsahern
From: yzhu1 <Yanjun.Zhu@windriver.com>
Date: Wed, 11 Mar 2015 10:39:53 +0800
> Hi, Stephen && David
>
> Any comment?
Asking Stephen to look at this more times will not make him respond
any faster. I see your posting, he sees it, everyone sees it.
If he's too busy to look into this, that's just the state of affairs
right now and you just need to be patient.
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] bridge: turn off carrier when the bridge is created
2015-03-11 4:03 ` David Miller
@ 2015-03-11 5:26 ` Stephen Hemminger
2015-03-11 5:29 ` David Miller
2015-03-11 6:16 ` yzhu1
0 siblings, 2 replies; 7+ messages in thread
From: Stephen Hemminger @ 2015-03-11 5:26 UTC (permalink / raw)
To: David Miller; +Cc: Yanjun.Zhu, netdev, dsahern
On Wed, 11 Mar 2015 00:03:50 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:
> From: yzhu1 <Yanjun.Zhu@windriver.com>
> Date: Wed, 11 Mar 2015 10:39:53 +0800
>
> > Hi, Stephen && David
> >
> > Any comment?
>
> Asking Stephen to look at this more times will not make him respond
> any faster. I see your posting, he sees it, everyone sees it.
>
> If he's too busy to look into this, that's just the state of affairs
> right now and you just need to be patient.
>
> Thanks.
This was discussed and changed long ago (before git was used).
Initially in 2.5 the bridge carrier was changed to work as you have
described but this broke some user. Therefore it was decided that the
best thing to do was keep the carrier always on for the bridge.
You might be able to find the commit by using one of the kernel
ancient history git trees. Kernel archeology is fun but
too time consuming for me to bother with.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] bridge: turn off carrier when the bridge is created
2015-03-11 5:26 ` Stephen Hemminger
@ 2015-03-11 5:29 ` David Miller
2015-03-11 6:16 ` yzhu1
1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2015-03-11 5:29 UTC (permalink / raw)
To: stephen; +Cc: Yanjun.Zhu, netdev, dsahern
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 10 Mar 2015 22:26:34 -0700
> This was discussed and changed long ago (before git was used).
> Initially in 2.5 the bridge carrier was changed to work as you have
> described but this broke some user. Therefore it was decided that the
> best thing to do was keep the carrier always on for the bridge.
>
> You might be able to find the commit by using one of the kernel
> ancient history git trees. Kernel archeology is fun but
> too time consuming for me to bother with.
And for that reason we are probably stuck with the current behavior.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] bridge: turn off carrier when the bridge is created
2015-03-11 5:26 ` Stephen Hemminger
2015-03-11 5:29 ` David Miller
@ 2015-03-11 6:16 ` yzhu1
1 sibling, 0 replies; 7+ messages in thread
From: yzhu1 @ 2015-03-11 6:16 UTC (permalink / raw)
To: Stephen Hemminger, David Miller; +Cc: netdev, dsahern
On 03/11/2015 01:26 PM, Stephen Hemminger wrote:
> On Wed, 11 Mar 2015 00:03:50 -0400 (EDT)
> David Miller <davem@davemloft.net> wrote:
>
>> From: yzhu1 <Yanjun.Zhu@windriver.com>
>> Date: Wed, 11 Mar 2015 10:39:53 +0800
>>
>>> Hi, Stephen && David
>>>
>>> Any comment?
>> Asking Stephen to look at this more times will not make him respond
>> any faster. I see your posting, he sees it, everyone sees it.
>>
>> If he's too busy to look into this, that's just the state of affairs
>> right now and you just need to be patient.
>>
>> Thanks.
> This was discussed and changed long ago (before git was used).
> Initially in 2.5 the bridge carrier was changed to work as you have
> described but this broke some user. Therefore it was decided that the
> best thing to do was keep the carrier always on for the bridge.
>
> You might be able to find the commit by using one of the kernel
> ancient history git trees. Kernel archeology is fun but
> too time consuming for me to bother with.
>
>
Thanks for your explanations.
Best Regards!
Zhu Yanjun
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-03-11 6:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10 7:09 [PATCH 0/1] bridge: turn off carrier when the bridge is created Zhu Yanjun
2015-03-10 7:09 ` [PATCH 1/1] " Zhu Yanjun
2015-03-11 2:39 ` yzhu1
2015-03-11 4:03 ` David Miller
2015-03-11 5:26 ` Stephen Hemminger
2015-03-11 5:29 ` David Miller
2015-03-11 6:16 ` yzhu1
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).