From: Vlad Yasevich <vyasevic@redhat.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: Re: [RFC PATCH net-next 3/3] bridge: Implement IFF_UNICAST_FLT
Date: Thu, 07 Mar 2013 10:08:34 -0500 [thread overview]
Message-ID: <5138AD72.8080104@redhat.com> (raw)
In-Reply-To: <51380542.4020601@gmail.com>
On 03/06/2013 10:10 PM, John Fastabend wrote:
> On 03/06/2013 06:31 PM, Vlad Yasevich wrote:
>> Implement IFF_UNICAST_FLT on the bridge. Unicast addresses added
>> to the bridge device are synched to the uplink devices. This
>> allows for uplink devices to change while preserving mac assignment.
>>
>> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>> ---
>
> [...]
>
>> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
>> index b0812c9..ef7b51e 100644
>> --- a/net/bridge/br_fdb.c
>> +++ b/net/bridge/br_fdb.c
>> @@ -677,6 +677,9 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr
>> *tb[],
>> struct net_port_vlans *pv;
>> unsigned short vid = VLAN_N_VID;
>>
>> + if ((ndm->ndm_flags & NTF_SELF) && (dev->priv_flags & IFF_EBRIDGE))
>> + return ndo_dflt_fdb_add(ndm, tb, dev, addr, nlh_flags);
>> +
>> if (!(ndm->ndm_state & (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE))) {
>> pr_info("bridge: RTM_NEWNEIGH with invalid state %#x\n",
>> ndm->ndm_state);
>> return -EINVAL;
>> @@ -774,6 +777,9 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr
>> *tb[],
>> struct net_port_vlans *pv;
>> unsigned short vid = VLAN_N_VID;
>>
>> + if ((ndm->ndm_flags & NTF_SELF) && (dev->priv_flags & IFF_EBRIDGE))
>> + return ndo_dflt_fdb_del(ndm, tb, dev, addr);
>> +
>> if (tb[NDA_VLAN]) {
>> if (nla_len(tb[NDA_VLAN]) != sizeof(unsigned short)) {
>> pr_info("bridge: RTM_NEWNEIGH with invalid vlan\n");
>>
>
> How is this different then calling the fdb op from rtnetlink.c when the
> NTF_SELF bit is set after your previous patch
>
> net: generic fdb support for drivers without ndo_fdb_<op>
>
> the generic routine gets called if a specific op is not supplied via
> ndo ops anyways right?
>
> Also I suspect if the driver supplies a specific ndo_fdb_<op> we should
> use it over the generic one.
>
> What am I missing?
The bridge provides the ndo_fdb_<add|del>, so it will be used. The
bridge op assumes that the dev passed to it is a port. This code adds
support for when dev is the bridge.
In fact this patch is counting that rtnetlink will call into the bridge
and lets bridge do the work.
-vlad
>
> Thanks,
> John
>
next prev parent reply other threads:[~2013-03-07 15:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 2:31 [RFC PATCH net-next 0/3] Allow bridge to function in non-promisc mode Vlad Yasevich
2013-03-07 2:31 ` [RFC PATCH net-next 1/3] bridge: Add mac_management sysfs interface Vlad Yasevich
2013-03-07 2:35 ` Vlad Yasevich
2013-03-07 2:31 ` [RFC PATCH net-next 2/3] bridge: Allow an ability to designate an uplink port Vlad Yasevich
2013-03-07 2:31 ` [RFC PATCH net-next 3/3] bridge: Implement IFF_UNICAST_FLT Vlad Yasevich
2013-03-07 3:10 ` John Fastabend
2013-03-07 15:08 ` Vlad Yasevich [this message]
2013-03-07 7:19 ` [RFC PATCH net-next 0/3] Allow bridge to function in non-promisc mode Stephen Hemminger
2013-03-07 15:35 ` Vlad Yasevich
2013-03-07 17:13 ` Stephen Hemminger
2013-03-07 17:21 ` Vlad Yasevich
2013-03-07 17:38 ` Vlad Yasevich
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=5138AD72.8080104@redhat.com \
--to=vyasevic@redhat.com \
--cc=bridge@lists.linux-foundation.org \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.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 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).