All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	xen-devel@lists.xenproject.org, kvm@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	bridge@lists.linux-foundation.org
Subject: Re: [RFC v2 1/4] bridge: enable interfaces to opt out from becoming the root bridge
Date: Tue, 18 Feb 2014 13:02:29 -0800	[thread overview]
Message-ID: <CAB=NE6WwbOXNLO_Mn42i7y62pEsmDOWd35B621eiJk4iaE3Hfg@mail.gmail.com> (raw)
In-Reply-To: <20140216105754.63738163@nehalam.linuxnetplumber.net>

On Sun, Feb 16, 2014 at 10:57 AM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Fri, 14 Feb 2014 18:59:37 -0800
> "Luis R. Rodriguez" <mcgrof@do-not-panic.com> wrote:
>
>> From: "Luis R. Rodriguez" <mcgrof@suse.com>
>>
>> It doesn't make sense for some interfaces to become a root bridge
>> at any point in time. One example is virtual backend interfaces
>> which rely on other entities on the bridge for actual physical
>> connectivity. They only provide virtual access.
>>
>> Device drivers that know they should never become part of the
>> root bridge have been using a trick of setting their MAC address
>> to a high broadcast MAC address such as FE:FF:FF:FF:FF:FF. Instead
>> of using these hacks lets the interfaces annotate its intent and
>> generalizes a solution for multiple drivers, while letting the
>> drivers use a random MAC address or one prefixed with a proper OUI.
>> This sort of hack is used by both qemu and xen for their backend
>> interfaces.
>>
>> Cc: Stephen Hemminger <stephen@networkplumber.org>
>> Cc: bridge@lists.linux-foundation.org
>> Cc: netdev@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
>
> This is already supported in a more standard way via the root
> block flag.

Great! For documentation purposes the root_block flag is a sysfs
attribute, added via 3.8 through commit 1007dd1a. The respective
interface flag is IFLA_BRPORT_PROTECT and can be set via the iproute2
bridge utility or through sysfs:

mcgrof@garbanzo ~/linux (git::master)$ find /sys/ -name root_block
/sys/devices/pci0000:00/0000:00:04.0/0000:02:00.0/net/eth0/brport/root_block
/sys/devices/vif-3-0/net/vif3.0/brport/root_block
/sys/devices/virtual/net/vif3.0-emu/brport/root_block

mcgrof@garbanzo ~/devel/iproute2 (git::master)$ cat
/sys/devices/vif-3-0/net/vif3.0/brport/root_block
0
mcgrof@garbanzo ~/devel/iproute2 (git::master)$ sudo bridge link set
dev vif3.0 root_block on
mcgrof@garbanzo ~/devel/iproute2 (git::master)$ cat
/sys/devices/vif-3-0/net/vif3.0/brport/root_block
1

So if we'd want to avoid using the MAC address hack alternative to
skip a root port userspace would need to be updated to simply set this
attribute after adding the device to the bridge. Based on Zoltan's
feedback there seems to be use cases to not enable this always for all
xen-netback interfaces though as such we can just punt this to
userspace for the topologies that require this.

The original motivation for this series was to avoid the IPv6
duplicate address incurred by the MAC address hack for avoiding the
root bridge. Given that Zoltan also noted a use case whereby IPv4 and
IPv6 addresses can be assigned to the backend interfaces we should be
able to avoid the duplicate address situation for IPv6 by using a
proper random MAC address *once* userspace has been updated also to
use IFLA_BRPORT_PROTECT. New userspace can't and won't need to set
this flag for older kernels (older than 3.8) as root_block is not
implemented on those kernels and the MAC address hack would still be
used there. This strategy however does put a requirement on new
kernels to use new userspace as otherwise the MAC address workaround
would not be in place and root_block would not take effect.

  Luis

WARNING: multiple messages have this Message-ID (diff)
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	bridge@lists.linux-foundation.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [Bridge] [RFC v2 1/4] bridge: enable interfaces to opt out from becoming the root bridge
Date: Tue, 18 Feb 2014 13:02:29 -0800	[thread overview]
Message-ID: <CAB=NE6WwbOXNLO_Mn42i7y62pEsmDOWd35B621eiJk4iaE3Hfg@mail.gmail.com> (raw)
In-Reply-To: <20140216105754.63738163@nehalam.linuxnetplumber.net>

On Sun, Feb 16, 2014 at 10:57 AM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Fri, 14 Feb 2014 18:59:37 -0800
> "Luis R. Rodriguez" <mcgrof@do-not-panic.com> wrote:
>
>> From: "Luis R. Rodriguez" <mcgrof@suse.com>
>>
>> It doesn't make sense for some interfaces to become a root bridge
>> at any point in time. One example is virtual backend interfaces
>> which rely on other entities on the bridge for actual physical
>> connectivity. They only provide virtual access.
>>
>> Device drivers that know they should never become part of the
>> root bridge have been using a trick of setting their MAC address
>> to a high broadcast MAC address such as FE:FF:FF:FF:FF:FF. Instead
>> of using these hacks lets the interfaces annotate its intent and
>> generalizes a solution for multiple drivers, while letting the
>> drivers use a random MAC address or one prefixed with a proper OUI.
>> This sort of hack is used by both qemu and xen for their backend
>> interfaces.
>>
>> Cc: Stephen Hemminger <stephen@networkplumber.org>
>> Cc: bridge@lists.linux-foundation.org
>> Cc: netdev@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
>
> This is already supported in a more standard way via the root
> block flag.

Great! For documentation purposes the root_block flag is a sysfs
attribute, added via 3.8 through commit 1007dd1a. The respective
interface flag is IFLA_BRPORT_PROTECT and can be set via the iproute2
bridge utility or through sysfs:

mcgrof@garbanzo ~/linux (git::master)$ find /sys/ -name root_block
/sys/devices/pci0000:00/0000:00:04.0/0000:02:00.0/net/eth0/brport/root_block
/sys/devices/vif-3-0/net/vif3.0/brport/root_block
/sys/devices/virtual/net/vif3.0-emu/brport/root_block

mcgrof@garbanzo ~/devel/iproute2 (git::master)$ cat
/sys/devices/vif-3-0/net/vif3.0/brport/root_block
0
mcgrof@garbanzo ~/devel/iproute2 (git::master)$ sudo bridge link set
dev vif3.0 root_block on
mcgrof@garbanzo ~/devel/iproute2 (git::master)$ cat
/sys/devices/vif-3-0/net/vif3.0/brport/root_block
1

So if we'd want to avoid using the MAC address hack alternative to
skip a root port userspace would need to be updated to simply set this
attribute after adding the device to the bridge. Based on Zoltan's
feedback there seems to be use cases to not enable this always for all
xen-netback interfaces though as such we can just punt this to
userspace for the topologies that require this.

The original motivation for this series was to avoid the IPv6
duplicate address incurred by the MAC address hack for avoiding the
root bridge. Given that Zoltan also noted a use case whereby IPv4 and
IPv6 addresses can be assigned to the backend interfaces we should be
able to avoid the duplicate address situation for IPv6 by using a
proper random MAC address *once* userspace has been updated also to
use IFLA_BRPORT_PROTECT. New userspace can't and won't need to set
this flag for older kernels (older than 3.8) as root_block is not
implemented on those kernels and the MAC address hack would still be
used there. This strategy however does put a requirement on new
kernels to use new userspace as otherwise the MAC address workaround
would not be in place and root_block would not take effect.

  Luis

  parent reply	other threads:[~2014-02-18 21:02 UTC|newest]

Thread overview: 156+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-15  2:59 [RFC v2 0/4] net: bridge / ip optimizations for virtual net backends Luis R. Rodriguez
2014-02-15  2:59 ` [RFC v2 1/4] bridge: enable interfaces to opt out from becoming the root bridge Luis R. Rodriguez
2014-02-15  2:59 ` Luis R. Rodriguez
2014-02-15  2:59   ` [Bridge] " Luis R. Rodriguez
2014-02-15  2:59   ` Luis R. Rodriguez
2014-02-16 18:56   ` Ben Hutchings
2014-02-16 18:56     ` [Bridge] " Ben Hutchings
2014-02-16 18:56   ` Ben Hutchings
2014-02-16 18:57   ` Stephen Hemminger
2014-02-16 18:57   ` Stephen Hemminger
2014-02-16 18:57     ` [Bridge] " Stephen Hemminger
2014-02-16 18:57     ` Stephen Hemminger
2014-02-18 21:02     ` Luis R. Rodriguez
2014-02-18 21:02     ` Luis R. Rodriguez [this message]
2014-02-18 21:02       ` [Bridge] " Luis R. Rodriguez
2014-02-19  9:52       ` [Xen-devel] " Ian Campbell
2014-02-19  9:52         ` [Bridge] " Ian Campbell
2014-02-19  9:52         ` Ian Campbell
2014-02-19 14:35         ` Zoltan Kiss
2014-02-19 14:35         ` [Xen-devel] " Zoltan Kiss
2014-02-19 14:35           ` [Bridge] " Zoltan Kiss
2014-02-19 17:02           ` Luis R. Rodriguez
2014-02-19 17:02           ` [Xen-devel] " Luis R. Rodriguez
2014-02-19 17:02             ` [Bridge] " Luis R. Rodriguez
2014-02-19 17:08             ` Stephen Hemminger
2014-02-19 17:08             ` [Xen-devel] " Stephen Hemminger
2014-02-19 17:08               ` [Bridge] " Stephen Hemminger
2014-02-19 17:08               ` Stephen Hemminger
2014-02-19 17:59               ` Luis R. Rodriguez
2014-02-19 17:59               ` [Xen-devel] " Luis R. Rodriguez
2014-02-19 17:59                 ` [Bridge] " Luis R. Rodriguez
2014-02-19 17:59                 ` Luis R. Rodriguez
2014-02-20 17:19                 ` Stephen Hemminger
2014-02-20 17:19                 ` [Xen-devel] " Stephen Hemminger
2014-02-20 17:19                   ` [Bridge] " Stephen Hemminger
2014-02-20 17:19                   ` Stephen Hemminger
2014-02-20 20:24                   ` Luis R. Rodriguez
2014-02-20 20:24                   ` [Xen-devel] " Luis R. Rodriguez
2014-02-20 20:24                     ` [Bridge] " Luis R. Rodriguez
2014-02-20 20:24                     ` Luis R. Rodriguez
2014-02-21 13:02                     ` Zoltan Kiss
2014-02-21 13:02                     ` [Xen-devel] " Zoltan Kiss
2014-02-21 13:02                       ` [Bridge] " Zoltan Kiss
2014-02-21 16:01                       ` Luis R. Rodriguez
2014-02-21 16:01                       ` [Xen-devel] " Luis R. Rodriguez
2014-02-21 16:01                         ` [Bridge] " Luis R. Rodriguez
2014-02-21 16:01                         ` Luis R. Rodriguez
2014-02-22  1:38                         ` Luis R. Rodriguez
2014-02-22  1:38                           ` [Bridge] " Luis R. Rodriguez
2014-02-22  1:38                           ` Luis R. Rodriguez
2014-02-22  1:38                         ` Luis R. Rodriguez
2014-02-20 13:19             ` Zoltan Kiss
2014-02-20 13:19             ` [Xen-devel] " Zoltan Kiss
2014-02-20 13:19               ` [Bridge] " Zoltan Kiss
2014-02-20 20:01               ` Luis R. Rodriguez
2014-02-20 20:01               ` [Xen-devel] " Luis R. Rodriguez
2014-02-20 20:01                 ` [Bridge] " Luis R. Rodriguez
2014-02-20 20:01                 ` Luis R. Rodriguez
2014-02-21 13:02                 ` Zoltan Kiss
2014-02-21 13:02                   ` [Bridge] " Zoltan Kiss
2014-02-21 15:59                   ` Luis R. Rodriguez
2014-02-21 15:59                   ` [Xen-devel] " Luis R. Rodriguez
2014-02-21 15:59                     ` [Bridge] " Luis R. Rodriguez
2014-02-21 15:59                     ` Luis R. Rodriguez
2014-02-21 13:02                 ` Zoltan Kiss
2014-02-19  9:52       ` Ian Campbell
2014-02-17 17:52   ` Zoltan Kiss
2014-02-17 17:52   ` [Xen-devel] " Zoltan Kiss
2014-02-17 17:52     ` [Bridge] " Zoltan Kiss
2014-02-19 16:45     ` Luis R. Rodriguez
2014-02-19 16:45     ` [Xen-devel] " Luis R. Rodriguez
2014-02-19 16:45       ` [Bridge] " Luis R. Rodriguez
2014-02-19 16:45       ` Luis R. Rodriguez
2014-02-20 14:47       ` Zoltan Kiss
2014-02-20 14:47       ` [Xen-devel] " Zoltan Kiss
2014-02-20 14:47         ` [Bridge] " Zoltan Kiss
2014-02-20 20:28         ` Luis R. Rodriguez
2014-02-20 20:28         ` [Xen-devel] " Luis R. Rodriguez
2014-02-20 20:28           ` [Bridge] " Luis R. Rodriguez
2014-02-20 20:28           ` Luis R. Rodriguez
2014-02-15  2:59 ` [RFC v2 2/4] net: enables interface option to skip IP Luis R. Rodriguez
2014-02-15  2:59   ` Luis R. Rodriguez
2014-02-17 20:23   ` Dan Williams
2014-02-18 21:19     ` Luis R. Rodriguez
2014-02-18 21:42       ` Stephen Hemminger
2014-02-18 21:42       ` Stephen Hemminger
2014-02-19 17:13         ` Luis R. Rodriguez
2014-02-19 17:13         ` Luis R. Rodriguez
2014-02-19 16:45       ` Dan Williams
2014-02-19 16:45       ` Dan Williams
2014-02-19 17:20         ` Luis R. Rodriguez
2014-02-19 19:13           ` Zoltan Kiss
2014-02-19 19:13           ` Zoltan Kiss
2014-02-20 20:39             ` Luis R. Rodriguez
2014-02-21 13:02               ` Zoltan Kiss
2014-02-21 13:02               ` Zoltan Kiss
2014-02-22  1:40                 ` Luis R. Rodriguez
2014-02-22  1:40                 ` Luis R. Rodriguez
2014-02-20 20:39             ` Luis R. Rodriguez
2014-02-20  0:56           ` Dan Williams
2014-02-20  0:56           ` Dan Williams
2014-02-20  0:58             ` Hannes Frederic Sowa
2014-02-20  0:58             ` Hannes Frederic Sowa
2014-02-20  1:02               ` Dan Williams
2014-02-20  1:02               ` Dan Williams
2014-02-20 20:31             ` Luis R. Rodriguez
2014-02-20 20:31             ` Luis R. Rodriguez
2014-02-24 18:22               ` Dan Williams
2014-02-24 20:33                 ` Luis R. Rodriguez
2014-02-24 20:33                 ` Luis R. Rodriguez
2014-02-24 23:04                 ` David Miller
2014-02-24 23:04                 ` David Miller
2014-02-25  0:02                   ` Ben Hutchings
2014-02-25  0:12                     ` David Miller
2014-02-25  0:12                     ` David Miller
2014-02-25  2:01                       ` Ben Hutchings
2014-02-25  2:01                       ` Ben Hutchings
2014-02-25  2:23                         ` Hannes Frederic Sowa
2014-02-25  2:23                         ` Hannes Frederic Sowa
2014-02-25 19:50                       ` Paul Marks
2014-02-25 19:50                       ` Paul Marks
2014-02-25  0:02                   ` Ben Hutchings
2014-02-25 21:07                   ` Dan Williams
2014-02-25 21:07                   ` Dan Williams
2014-02-25 21:18                     ` David Miller
2014-02-25 21:18                     ` David Miller
2014-02-26  1:29                       ` Hannes Frederic Sowa
2014-02-26  1:29                       ` Hannes Frederic Sowa
2014-02-24 18:22               ` Dan Williams
2014-02-19 17:20         ` Luis R. Rodriguez
2014-02-18 21:19     ` Luis R. Rodriguez
2014-02-17 20:23   ` Dan Williams
2014-02-15  2:59 ` [RFC v2 3/4] xen-netback: use a random MAC address Luis R. Rodriguez
2014-02-15  2:59 ` Luis R. Rodriguez
2014-02-17 10:29   ` [Xen-devel] " David Vrabel
2014-02-18 11:22     ` Ian Campbell
2014-02-18 21:30       ` Luis R. Rodriguez
2014-02-18 21:30       ` Luis R. Rodriguez
2014-02-18 11:22     ` Ian Campbell
2014-02-17 10:29   ` David Vrabel
2014-02-15  2:59 ` [RFC v2 4/4] xen-netback: skip IPv4 and IPv6 interfaces Luis R. Rodriguez
2014-02-17 14:36   ` Zoltan Kiss
2014-02-17 14:36   ` [Xen-devel] " Zoltan Kiss
2014-02-18 20:16     ` Luis R. Rodriguez
2014-02-19  9:47       ` Ian Campbell
2014-02-19  9:47       ` Ian Campbell
2014-02-18 20:16     ` Luis R. Rodriguez
2014-02-15  2:59 ` Luis R. Rodriguez
2014-02-17 10:27 ` [Xen-devel] [RFC v2 0/4] net: bridge / ip optimizations for virtual net backends David Vrabel
2014-02-18 19:43   ` Luis R. Rodriguez
2014-02-18 19:43   ` [Xen-devel] " Luis R. Rodriguez
2014-02-19  9:48     ` Ian Campbell
2014-02-19  9:48     ` [Xen-devel] " Ian Campbell
2014-02-19 17:10       ` Luis R. Rodriguez
2014-02-19 17:10       ` [Xen-devel] " Luis R. Rodriguez
2014-02-17 10:27 ` David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB=NE6WwbOXNLO_Mn42i7y62pEsmDOWd35B621eiJk4iaE3Hfg@mail.gmail.com' \
    --to=mcgrof@do-not-panic.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.