Skip to content

Commit dfd739f

Browse files
Ansueldavem330
authored andcommitted
net: dsa: qca8k: fix mdb add/del case with 0 VID
The qca8k switch doesn't support using 0 as VID and require a default VID to be always set. MDB add/del function doesn't currently handle this and are currently setting the default VID. Fix this by correctly handling this corner case and internally use the default VID for VID 0 case. Fixes: ba8f870 ("net: dsa: qca8k: add support for mdb_add/del") Signed-off-by: Christian Marangi <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent ae70dcb commit dfd739f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/dsa/qca/qca8k-common.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,9 @@ int qca8k_port_mdb_add(struct dsa_switch *ds, int port,
816816
const u8 *addr = mdb->addr;
817817
u16 vid = mdb->vid;
818818

819+
if (!vid)
820+
vid = QCA8K_PORT_VID_DEF;
821+
819822
return qca8k_fdb_search_and_insert(priv, BIT(port), addr, vid,
820823
QCA8K_ATU_STATUS_STATIC);
821824
}
@@ -828,6 +831,9 @@ int qca8k_port_mdb_del(struct dsa_switch *ds, int port,
828831
const u8 *addr = mdb->addr;
829832
u16 vid = mdb->vid;
830833

834+
if (!vid)
835+
vid = QCA8K_PORT_VID_DEF;
836+
831837
return qca8k_fdb_search_and_del(priv, BIT(port), addr, vid);
832838
}
833839

0 commit comments

Comments
 (0)