Re: [PATCH V2 3/3] net-next: dsa: add new driver for qca8xxx family
From: John Crispin
Date: Wed Sep 14 2016 - 11:48:06 EST
On 14/09/2016 12:39, John Crispin wrote:
> +static void
> +qca8k_fdb_add(struct dsa_switch *ds, int port,
> + const struct switchdev_obj_port_fdb *fdb,
> + struct switchdev_trans *trans)
> +{
> + struct qca8k_priv *priv = qca8k_to_priv(ds);
> + u16 port_mask = BIT(port);
> + u16 vid = fdb->vid;
> +
> + if (!vid)
> + vid = 1;
> +
> + qca8k_fdb_write(priv, vid, port_mask, fdb->addr,
> + QCA8K_ATU_STATUS_STATIC);
> +
> + qca8k_fdb_access(priv, QCA8K_FDB_LOAD, -1);
> +}
> +
> +static int
> +qca8k_fdb_del(struct dsa_switch *ds, int port,
> + const struct switchdev_obj_port_fdb *fdb)
> +{
> + struct qca8k_priv *priv = qca8k_to_priv(ds);
> + u16 port_mask = BIT(port);
> +
> + qca8k_fdb_write(priv, fdb->vid, port_mask, fdb->addr, 0);
> +
> + return qca8k_fdb_access(priv, QCA8K_FDB_PURGE, -1);
> +}
> +
while adding MDB support i noticed that
1) the code above is still not properly locked
2) i can unify the FDB and MDB code
i will send a V3 with those 2 changes tomorrow.
John