[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5138AD72.8080104@redhat.com>
Date: Thu, 07 Mar 2013 10:08:34 -0500
From: Vlad Yasevich <vyasevic@...hat.com>
To: John Fastabend <john.fastabend@...il.com>
CC: netdev@...r.kernel.org, bridge@...ts.linux-foundation.org
Subject: Re: [RFC PATCH net-next 3/3] bridge: Implement IFF_UNICAST_FLT
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@...hat.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
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists