All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevic@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: john.r.fastabend@intel.com, netdev@vger.kernel.org,
	bridge@lists.linux-foundation.org, jhs@mojatatu.com,
	Stephen Hemminger <stephen@networkplumber.org>,
	shemminger@vyatta.com
Subject: Re: [Bridge] [PATCH 3/7] bridge: Add addresses from static fdbs to bridge address list
Date: Thu, 27 Feb 2014 08:08:05 -0500	[thread overview]
Message-ID: <530F38B5.5090803@redhat.com> (raw)
In-Reply-To: <20140227075336.GF16484@redhat.com>

On 02/27/2014 02:53 AM, Michael S. Tsirkin wrote:
> On Wed, Feb 26, 2014 at 12:35:08PM -0500, Vlad Yasevich wrote:
>> On 02/26/2014 11:57 AM, Stephen Hemminger wrote:
>>> On Wed, 26 Feb 2014 10:18:21 -0500
>>> Vlad Yasevich <vyasevic@redhat.com> wrote:
>>>
>>>> When a static fdb entry is created, add the mac address to the bridge
>>>> address list.  This list is used to program the proper port's
>>>> address list.
>>>>
>>>> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>>>
>>> I don't like this level of bookkeeping it starts to mix
>>> layers between the bridge network interface as entity for talking to the
>>> local host, and forwarding table entries.
>>
>> Actually this is one of the reasons this isn't done through the
>> br->dev->uc.  Forwarding table entries are still per-port.
>>
>>>
>>> Many times static entries are used as alternative to flooding in
>>> environments which don't trust STP.
>>
>> Ok, and how would this be problematic?  If one wants to turn off
>> promisc in this environment, then receive filters needs to be properly
>> programmed.
>>
>>>
>>> Plus, it looks like another major source of bugs.
>>>
>>
>> Any new code is a potential source of issues.  Are you saying
>> No to any new code in bridge?
>>
>> -vlad
> 
> I'm guessing Stephen merely worries about
> multiple data structures that need to stay in
> sync, and asks that you revisit
> using private hw address list in the bridge.
> 
> What's the issue with walking fdb exactly?
> You say
>  1)  I tried using the fdb table itself as main repository, but
>       this caused difficulties in synchronizing this table with
>       the interface filters later on.
> 
> I'm guessing you refer to writing addresses out to ports
> directly when walking the hash being impossible
> since this datastructure uses rcu and spinlocks?
> Fair enough but the entries you care about
> seem to only be modified under RTNL so just
> copy them out to a temporary list.
> This might be less efficient, but will be simpler I think.
> 

There are 2 ways to populate the the ports uc list.
  1) We can use dev_uc_add() directly.  The issue here is
     how to know if a given entry has been written to port.
     I've played with this is and we end completely replicating
     the netdev_hw_addr functionality in fdb to support the Patch7
     (0 flooding ports).
  2) We can use dev_uc_sync() which is what this series does.
     This api needs to keep track of sync counts so that things get
     properly deleted.  For that a temporary list will not work
     since you'd be re-creating it every time.

Now, I think I've come up with a way to remove the private address list
and use bridge->dev->uc, but that requires that we implement fdb-based
filtering for local addresses.

The idea is to implement learning on the bridge device xmit path.  This
will support things like vlans on top of the bridge that change their
mac, or even stack bridge configs that exist in the wild.
My guess, however, is that Stephen would have an even bigger issue with
this. ;)

-vlad

WARNING: multiple messages have this Message-ID (diff)
From: Vlad Yasevich <vyasevic@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: john.r.fastabend@intel.com, netdev@vger.kernel.org,
	bridge@lists.linux-foundation.org, jhs@mojatatu.com,
	Stephen Hemminger <stephen@networkplumber.org>,
	shemminger@vyatta.com
Subject: Re: [PATCH 3/7] bridge: Add addresses from static fdbs to bridge address list
Date: Thu, 27 Feb 2014 08:08:05 -0500	[thread overview]
Message-ID: <530F38B5.5090803@redhat.com> (raw)
In-Reply-To: <20140227075336.GF16484@redhat.com>

On 02/27/2014 02:53 AM, Michael S. Tsirkin wrote:
> On Wed, Feb 26, 2014 at 12:35:08PM -0500, Vlad Yasevich wrote:
>> On 02/26/2014 11:57 AM, Stephen Hemminger wrote:
>>> On Wed, 26 Feb 2014 10:18:21 -0500
>>> Vlad Yasevich <vyasevic@redhat.com> wrote:
>>>
>>>> When a static fdb entry is created, add the mac address to the bridge
>>>> address list.  This list is used to program the proper port's
>>>> address list.
>>>>
>>>> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>>>
>>> I don't like this level of bookkeeping it starts to mix
>>> layers between the bridge network interface as entity for talking to the
>>> local host, and forwarding table entries.
>>
>> Actually this is one of the reasons this isn't done through the
>> br->dev->uc.  Forwarding table entries are still per-port.
>>
>>>
>>> Many times static entries are used as alternative to flooding in
>>> environments which don't trust STP.
>>
>> Ok, and how would this be problematic?  If one wants to turn off
>> promisc in this environment, then receive filters needs to be properly
>> programmed.
>>
>>>
>>> Plus, it looks like another major source of bugs.
>>>
>>
>> Any new code is a potential source of issues.  Are you saying
>> No to any new code in bridge?
>>
>> -vlad
> 
> I'm guessing Stephen merely worries about
> multiple data structures that need to stay in
> sync, and asks that you revisit
> using private hw address list in the bridge.
> 
> What's the issue with walking fdb exactly?
> You say
>  1)  I tried using the fdb table itself as main repository, but
>       this caused difficulties in synchronizing this table with
>       the interface filters later on.
> 
> I'm guessing you refer to writing addresses out to ports
> directly when walking the hash being impossible
> since this datastructure uses rcu and spinlocks?
> Fair enough but the entries you care about
> seem to only be modified under RTNL so just
> copy them out to a temporary list.
> This might be less efficient, but will be simpler I think.
> 

There are 2 ways to populate the the ports uc list.
  1) We can use dev_uc_add() directly.  The issue here is
     how to know if a given entry has been written to port.
     I've played with this is and we end completely replicating
     the netdev_hw_addr functionality in fdb to support the Patch7
     (0 flooding ports).
  2) We can use dev_uc_sync() which is what this series does.
     This api needs to keep track of sync counts so that things get
     properly deleted.  For that a temporary list will not work
     since you'd be re-creating it every time.

Now, I think I've come up with a way to remove the private address list
and use bridge->dev->uc, but that requires that we implement fdb-based
filtering for local addresses.

The idea is to implement learning on the bridge device xmit path.  This
will support things like vlans on top of the bridge that change their
mac, or even stack bridge configs that exist in the wild.
My guess, however, is that Stephen would have an even bigger issue with
this. ;)

-vlad

  reply	other threads:[~2014-02-27 13:08 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 15:18 [Bridge] [PATCH RFC 0/7] Non-promisc bidge ports support Vlad Yasevich
2014-02-26 15:18 ` Vlad Yasevich
2014-02-26 15:18 ` [Bridge] [PATCH 1/7] bridge: Turn flag change macro into a function Vlad Yasevich
2014-02-26 15:18   ` Vlad Yasevich
2014-02-26 15:29   ` [Bridge] " Michael S. Tsirkin
2014-02-26 15:29     ` Michael S. Tsirkin
2014-02-26 15:36     ` [Bridge] " Vlad Yasevich
2014-02-26 15:36       ` Vlad Yasevich
2014-02-26 15:18 ` [Bridge] [PATCH 2/7] bridge: Keep track of ports capable of flooding Vlad Yasevich
2014-02-26 15:18   ` Vlad Yasevich
2014-02-26 15:41   ` [Bridge] " Michael S. Tsirkin
2014-02-26 15:41     ` Michael S. Tsirkin
2014-02-26 15:41     ` [Bridge] " Vlad Yasevich
2014-02-26 15:41       ` Vlad Yasevich
2014-02-26 15:53       ` [Bridge] " Michael S. Tsirkin
2014-02-26 15:53         ` Michael S. Tsirkin
2014-02-27 11:59   ` [Bridge] " Toshiaki Makita
2014-02-27 11:59     ` Toshiaki Makita
2014-02-27 12:54     ` [Bridge] " Vlad Yasevich
2014-02-27 12:54       ` Vlad Yasevich
2014-02-26 15:18 ` [Bridge] [PATCH 3/7] bridge: Add addresses from static fdbs to bridge address list Vlad Yasevich
2014-02-26 15:18   ` Vlad Yasevich
2014-02-26 15:46   ` [Bridge] " Michael S. Tsirkin
2014-02-26 15:46     ` Michael S. Tsirkin
2014-02-26 15:43     ` [Bridge] " Vlad Yasevich
2014-02-26 15:43       ` Vlad Yasevich
2014-02-26 16:23   ` [Bridge] " Michael S. Tsirkin
2014-02-26 16:23     ` Michael S. Tsirkin
2014-02-26 17:25     ` [Bridge] " Vlad Yasevich
2014-02-26 17:25       ` Vlad Yasevich
2014-02-26 17:33       ` [Bridge] " Michael S. Tsirkin
2014-02-26 17:33         ` Michael S. Tsirkin
2014-02-26 16:57   ` [Bridge] " Stephen Hemminger
2014-02-26 16:57     ` Stephen Hemminger
2014-02-26 17:35     ` [Bridge] " Vlad Yasevich
2014-02-26 17:35       ` Vlad Yasevich
2014-02-27  7:53       ` [Bridge] " Michael S. Tsirkin
2014-02-27  7:53         ` Michael S. Tsirkin
2014-02-27 13:08         ` Vlad Yasevich [this message]
2014-02-27 13:08           ` Vlad Yasevich
2014-02-27 13:38           ` [Bridge] " Michael S. Tsirkin
2014-02-27 13:38             ` Michael S. Tsirkin
2014-02-26 15:18 ` [Bridge] [PATCH 4/7] bridge: Automatically manage port promiscuous mode Vlad Yasevich
2014-02-26 15:18   ` Vlad Yasevich
2014-02-26 15:51   ` [Bridge] " Michael S. Tsirkin
2014-02-26 15:51     ` Michael S. Tsirkin
2014-02-26 16:02     ` [Bridge] " Vlad Yasevich
2014-02-26 16:02       ` Vlad Yasevich
2014-02-26 16:58   ` [Bridge] " Stephen Hemminger
2014-02-26 16:58     ` Stephen Hemminger
2014-02-26 17:32     ` [Bridge] " Michael S. Tsirkin
2014-02-26 17:32       ` Michael S. Tsirkin
2014-02-26 15:18 ` [Bridge] [PATCH 5/7] bridge: Correctly manage promiscuity when user requested it Vlad Yasevich
2014-02-26 15:18   ` Vlad Yasevich
2014-02-26 15:18 ` [Bridge] [PATCH 6/7] bridge: Manage promisc mode when vlans are configured on top of a bridge Vlad Yasevich
2014-02-26 15:18   ` Vlad Yasevich
2014-02-26 16:00   ` [Bridge] " Michael S. Tsirkin
2014-02-26 16:00     ` Michael S. Tsirkin
2014-02-26 16:05     ` [Bridge] " Vlad Yasevich
2014-02-26 16:05       ` Vlad Yasevich
2014-02-26 16:25       ` [Bridge] " Michael S. Tsirkin
2014-02-26 16:25         ` Michael S. Tsirkin
2014-02-27 12:06   ` [Bridge] " Toshiaki Makita
2014-02-27 12:06     ` Toshiaki Makita
2014-02-27 13:17     ` [Bridge] " Vlad Yasevich
2014-02-27 13:17       ` Vlad Yasevich
2014-02-28 19:34       ` [Bridge] " Vlad Yasevich
2014-02-28 19:34         ` Vlad Yasevich
2014-03-01 14:57         ` [Bridge] " Toshiaki Makita
2014-03-01 14:57           ` Toshiaki Makita
2014-03-03 12:12           ` [Bridge] " Vlad Yasevich
2014-03-03 12:12             ` Vlad Yasevich
2014-02-26 15:18 ` [Bridge] [PATCH 7/7] bridge: Support promisc management when all ports are non-flooding Vlad Yasevich
2014-02-26 15:18   ` Vlad Yasevich
2014-02-26 15:57   ` [Bridge] " Michael S. Tsirkin
2014-02-26 15:57     ` Michael S. Tsirkin
2014-02-27  3:46     ` [Bridge] " Vlad Yasevich
2014-02-27  3:46       ` Vlad Yasevich
2014-02-27  7:29       ` [Bridge] " Michael S. Tsirkin
2014-02-27  7:29         ` Michael S. Tsirkin
2014-02-26 16:01   ` [Bridge] " Michael S. Tsirkin
2014-02-26 16:01     ` Michael S. Tsirkin
2014-02-26 16:34 ` [Bridge] [PATCH RFC 0/7] Non-promisc bidge ports support Michael S. Tsirkin
2014-02-26 16:34   ` Michael S. Tsirkin
2014-02-26 23:59 ` [Bridge] " Jamal Hadi Salim
2014-02-26 23:59   ` Jamal Hadi Salim
2014-02-27  3:37   ` [Bridge] " Vlad Yasevich
2014-02-27  3:37     ` Vlad Yasevich
2014-02-27  8:54     ` [Bridge] " Amidu Sila
2014-02-27  7:20   ` Michael S. Tsirkin
2014-02-27  7:20     ` Michael S. Tsirkin

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=530F38B5.5090803@redhat.com \
    --to=vyasevic@redhat.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=jhs@mojatatu.com \
    --cc=john.r.fastabend@intel.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=stephen@networkplumber.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.