Re: [PATCH net-next 4/5] net: mscc: ocelot: make entry_type a member of struct ocelot_multicast

From: Florian Fainelli
Date: Wed Oct 28 2020 - 22:38:13 EST




On 10/28/2020 7:27 PM, Vladimir Oltean wrote:
> This saves a re-classification of the MDB address on deletion.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
> ---

[snip]

> mc = ocelot_multicast_get(ocelot, mdb->addr, vid);
> if (!mc) {
> /* New entry */
> - int pgid = ocelot_mdb_get_pgid(ocelot, entry_type);
> + int pgid;
> +
> + mc = devm_kzalloc(ocelot->dev, sizeof(*mc), GFP_KERNEL);

If the MDB object is programmed with SWITCHDEV_OBJ_ID_HOST_MDB then you
would need this gfp_t to be GFP_ATOMIC per
net/bridge/br_mdb.c::__br_mdb_notify, if this is a regular
SWITCHDEV_OBJ_ID_MDB then GFP_KERNEL appears to be fine.

Looks like this existed before, so that might have to be fixed separately.

Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
--
Florian