From: Vlad Yasevich <vyasevic@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: john.r.fastabend@intel.com, netdev@vger.kernel.org,
shemminger@vyatta.com, bridge@lists.linux-foundation.org,
jhs@mojatatu.com
Subject: Re: [Bridge] [PATCH 3/7] bridge: Add addresses from static fdbs to bridge address list
Date: Wed, 26 Feb 2014 10:43:57 -0500 [thread overview]
Message-ID: <530E0BBD.9050404@redhat.com> (raw)
In-Reply-To: <20140226154655.GD15330@redhat.com>
On 02/26/2014 10:46 AM, Michael S. Tsirkin wrote:
>> +
>> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
>> index f072b34..e782c2e 100644
>> --- a/net/bridge/br_if.c
>> +++ b/net/bridge/br_if.c
>> @@ -144,7 +144,7 @@ static void del_nbp(struct net_bridge_port *p)
>>
>> br_ifinfo_notify(RTM_DELLINK, p);
>>
>> - list_del_rcu(&p->list);
>> + dev->priv_flags &= ~IFF_BRIDGE_PORT;
>>
>> if (p->flags & BR_FLOOD)
>> br_del_flood_port(p, br);
>> @@ -152,7 +152,7 @@ static void del_nbp(struct net_bridge_port *p)
>> nbp_vlan_flush(p);
>> br_fdb_delete_by_port(br, p, 1);
>>
>> - dev->priv_flags &= ~IFF_BRIDGE_PORT;
>> + list_del_rcu(&p->list);
>>
>> netdev_rx_handler_unregister(dev);
>>
>
> Hmm here we are moving list_del_rcu
> back to after nbp_vlan_flush.
> Was the reordering in the previous patch necessary?
Oops. Will fix it up.
-vlad
>
>> @@ -473,6 +473,8 @@ static void br_add_flood_port(struct net_bridge_port *p, struct net_bridge *br)
>> br->n_flood_ports++;
>> if (br->n_flood_ports == 1)
>> br->c_flood_port = p;
>> +
>> + br_fdb_addrs_sync(br);
>> }
>>
>> static void br_del_flood_port(struct net_bridge_port *p, struct net_bridge *br)
>> @@ -485,13 +487,17 @@ static void br_del_flood_port(struct net_bridge_port *p, struct net_bridge *br)
>> * set it if it is not set.
>> */
>> br->n_flood_ports--;
>> - if (p == br->c_flood_port)
>> + if (p == br->c_flood_port) {
>> + br_fdb_addrs_unsync(br);
>> br->c_flood_port = NULL;
>> + }
>>
>> if (br->n_flood_ports == 1) {
>> list_for_each_entry(port, &p->br->port_list, list) {
>> - if (port->flags & BR_FLOOD) {
>> + if (br_port_exists(port->dev) &&
>> + (port->flags & BR_FLOOD)) {
>> br->c_flood_port = port;
>> + br_fdb_addrs_sync(br);
>> break;
>> }
>> }
>> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
>> index 26a3987..40a6927 100644
>> --- a/net/bridge/br_private.h
>> +++ b/net/bridge/br_private.h
>> @@ -296,6 +296,7 @@ struct net_bridge
>> u8 vlan_enabled;
>> struct net_port_vlans __rcu *vlan_info;
>> #endif
>> + struct netdev_hw_addr_list conf_addrs;
>> };
>>
>> struct br_input_skb_cb {
>> @@ -397,6 +398,8 @@ int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev,
>> const unsigned char *addr, u16 nlh_flags);
>> int br_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
>> struct net_device *dev, int idx);
>> +void br_fdb_addrs_sync(struct net_bridge *br);
>> +void br_fdb_addrs_unsync(struct net_bridge *br);
>>
>> /* br_forward.c */
>> void br_deliver(const struct net_bridge_port *to, struct sk_buff *skb);
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 4ad1b78..eca4d476 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -5212,6 +5212,7 @@ void __dev_set_rx_mode(struct net_device *dev)
>> if (ops->ndo_set_rx_mode)
>> ops->ndo_set_rx_mode(dev);
>> }
>> +EXPORT_SYMBOL(__dev_set_rx_mode);
>>
>> void dev_set_rx_mode(struct net_device *dev)
>> {
>> diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
>> index 329d579..3de44a3 100644
>> --- a/net/core/dev_addr_lists.c
>> +++ b/net/core/dev_addr_lists.c
>> @@ -81,13 +81,14 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list,
>> sync);
>> }
>>
>> -static int __hw_addr_add(struct netdev_hw_addr_list *list,
>> - const unsigned char *addr, int addr_len,
>> - unsigned char addr_type)
>> +int __hw_addr_add(struct netdev_hw_addr_list *list,
>> + const unsigned char *addr, int addr_len,
>> + unsigned char addr_type)
>> {
>> return __hw_addr_add_ex(list, addr, addr_len, addr_type, false, false,
>> 0);
>> }
>> +EXPORT_SYMBOL(__hw_addr_add);
>>
>> static int __hw_addr_del_entry(struct netdev_hw_addr_list *list,
>> struct netdev_hw_addr *ha, bool global,
>> @@ -127,12 +128,13 @@ static int __hw_addr_del_ex(struct netdev_hw_addr_list *list,
>> return -ENOENT;
>> }
>>
>> -static int __hw_addr_del(struct netdev_hw_addr_list *list,
>> - const unsigned char *addr, int addr_len,
>> - unsigned char addr_type)
>> +int __hw_addr_del(struct netdev_hw_addr_list *list,
>> + const unsigned char *addr, int addr_len,
>> + unsigned char addr_type)
>> {
>> return __hw_addr_del_ex(list, addr, addr_len, addr_type, false, false);
>> }
>> +EXPORT_SYMBOL(__hw_addr_del);
>>
>> static int __hw_addr_sync_one(struct netdev_hw_addr_list *to_list,
>> struct netdev_hw_addr *ha,
>> --
>> 1.8.5.3
>
>
> I would split net/core/ changes out, and Cc more people
> on it.
>
next prev parent reply other threads:[~2014-02-26 15:43 UTC|newest]
Thread overview: 46+ 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 ` [Bridge] [PATCH 1/7] bridge: Turn flag change macro into a function Vlad Yasevich
2014-02-26 15:29 ` Michael S. Tsirkin
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:41 ` Michael S. Tsirkin
2014-02-26 15:41 ` Vlad Yasevich
2014-02-26 15:53 ` Michael S. Tsirkin
2014-02-27 11:59 ` Toshiaki Makita
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:46 ` Michael S. Tsirkin
2014-02-26 15:43 ` Vlad Yasevich [this message]
2014-02-26 16:23 ` Michael S. Tsirkin
2014-02-26 17:25 ` Vlad Yasevich
2014-02-26 17:33 ` Michael S. Tsirkin
2014-02-26 16:57 ` Stephen Hemminger
2014-02-26 17:35 ` Vlad Yasevich
2014-02-27 7:53 ` Michael S. Tsirkin
2014-02-27 13:08 ` Vlad Yasevich
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:51 ` Michael S. Tsirkin
2014-02-26 16:02 ` Vlad Yasevich
2014-02-26 16:58 ` Stephen Hemminger
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 ` [Bridge] [PATCH 6/7] bridge: Manage promisc mode when vlans are configured on top of a bridge Vlad Yasevich
2014-02-26 16:00 ` Michael S. Tsirkin
2014-02-26 16:05 ` Vlad Yasevich
2014-02-26 16:25 ` Michael S. Tsirkin
2014-02-27 12:06 ` Toshiaki Makita
2014-02-27 13:17 ` Vlad Yasevich
2014-02-28 19:34 ` Vlad Yasevich
2014-03-01 14:57 ` Toshiaki Makita
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:57 ` Michael S. Tsirkin
2014-02-27 3:46 ` Vlad Yasevich
2014-02-27 7:29 ` 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 23:59 ` Jamal Hadi Salim
2014-02-27 3:37 ` Vlad Yasevich
2014-02-27 8:54 ` Amidu Sila
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=530E0BBD.9050404@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 \
/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