[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c4825af2a2497001f64c45086e0397ce55053649.camel@microchip.com>
Date: Tue, 23 Aug 2022 11:46:05 +0200
From: Steen Hegelund <steen.hegelund@...rochip.com>
To: Casper Andersson <casper.casan@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, <netdev@...r.kernel.org>
CC: Horatiu Vultur <horatiu.vultur@...rochip.com>,
Lars Povlsen <lars.povlsen@...rochip.com>,
<UNGLinuxDriver@...rochip.com>
Subject: Re: [PATCH net-next 3/3] net: sparx5: add support for mrouter ports
Hi Casper,
On Mon, 2022-08-22 at 16:08 +0200, Casper Andersson wrote:
> +static void sparx5_port_attr_mrouter_set(struct sparx5_port *port,
> + struct net_device *orig_dev,
> + bool enable)
> +{
> + struct sparx5 *sparx5 = port->sparx5;
> + struct sparx5_mdb_entry *e;
> + bool flood_flag;
> +
> + if ((enable && port->is_mrouter) || (!enable && !port->is_mrouter))
> + return;
> +
> + /* Add/del mrouter port on all active mdb entries in HW.
> + * Don't change entry port mask, since that represents
> + * ports that actually joined that group.
> + */
> + mutex_lock(&sparx5->mdb_lock);
> + list_for_each_entry(e, &sparx5->mdb_entries, list) {
> + if (!test_bit(port->portno, e->port_mask) &&
> + ether_addr_is_ip_mcast(e->addr))
> + sparx5_pgid_update_mask(port, e->pgid_idx, enable);
> + }
> + mutex_unlock(&sparx5->mdb_lock);
> +
> + /* Enable/disable flooding depeding on if port is mrouter port
depending
> + * or if mcast flood is enabled.
> + */
> + port->is_mrouter = enable;
> + flood_flag = br_port_flag_is_set(port->ndev, BR_MCAST_FLOOD);
> + sparx5_port_update_mcast_ip_flood(port, flood_flag);
> +}
>
BR
Steen
Powered by blists - more mailing lists