[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHA+R7OycteYron5K3YJ3qtsEE-5uUxhPkictJDWosXCihR5hA@mail.gmail.com>
Date: Thu, 2 Oct 2014 21:41:46 -0700
From: Cong Wang <cwang@...pensource.com>
To: Vladislav Yasevich <vyasevich@...il.com>
Cc: netdev <netdev@...r.kernel.org>,
Stephen Hemminger <stephen@...workplumber.org>,
"bridge@...ts.linux-foundation.org"
<bridge@...ts.linux-foundation.org>, toshiaki.makita1@...il.com,
Vladislav Yasevich <vyasevic@...hat.com>
Subject: Re: [PATCH v3 net-next 3/3] bridge: Add filtering support for default_pvid
On Thu, Oct 2, 2014 at 4:54 PM, Vladislav Yasevich <vyasevich@...il.com> wrote:
> +static void br_vlan_disable_default_pvid(struct net_bridge *br)
> +{
> + struct net_bridge_port *p;
> + u16 pvid = br->default_pvid;
> +
> + /* Disable default_pvid on all ports where it is still
> + * configured.
> + */
> +
This empty line is not necessary.
> + if (vlan_default_pvid(br_get_vlan_info(br), pvid))
> + br_vlan_delete(br, pvid);
> +
> + list_for_each_entry(p, &br->port_list, list) {
> + if (vlan_default_pvid(nbp_get_vlan_info(p), pvid))
> + nbp_vlan_delete(p, pvid);
> + }
> +
> + br->default_pvid = 0;
> +}
> +
> +static int __br_vlan_set_default_pvid(struct net_bridge *br, u16 pvid)
> +{
> + struct net_bridge_port *p;
> + u16 old_pvid;
> + int err;
> + DECLARE_BITMAP(changed, BR_MAX_PORTS);
This bitmap will use 128 bytes on stack, why not using heap?
> +
> + bitmap_zero(changed, BR_MAX_PORTS);
> +
> + /* This function runs with filtering turned off so we can
> + * remove the old pvid configuration and add the new one after
> + * without impacting traffic.
> + */
> +
> + old_pvid = br->default_pvid;
Remove the empty line.
[...]
> +int nbp_vlan_init(struct net_bridge_port *p)
> +{
> + int rc = 0;
> +
> + if (p->br->default_pvid) {
> + rc = nbp_vlan_add(p, p->br->default_pvid,
> + BRIDGE_VLAN_INFO_PVID |
> + BRIDGE_VLAN_INFO_UNTAGGED);
> + }
> +
> + return rc;
> +}
'rc' can be removed.
--
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