Skip to content

Commit 3169241

Browse files
viviendavem330
authored andcommitted
net: dsa: support cross-chip FDB operations
When a MAC address is added to or removed from a switch port in the fabric, the target switch must program its port and adjacent switches must program their local DSA port used to reach the target switch. For this purpose, use the dsa_towards_port() helper to identify the local switch port which must be programmed. Signed-off-by: Vivien Didelot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3b8fac5 commit 3169241

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

net/dsa/switch.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,23 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds,
8383
static int dsa_switch_fdb_add(struct dsa_switch *ds,
8484
struct dsa_notifier_fdb_info *info)
8585
{
86-
/* Do not care yet about other switch chips of the fabric */
87-
if (ds->index != info->sw_index)
88-
return 0;
86+
int port = dsa_towards_port(ds, info->sw_index, info->port);
8987

9088
if (!ds->ops->port_fdb_add)
9189
return -EOPNOTSUPP;
9290

93-
return ds->ops->port_fdb_add(ds, info->port, info->addr,
94-
info->vid);
91+
return ds->ops->port_fdb_add(ds, port, info->addr, info->vid);
9592
}
9693

9794
static int dsa_switch_fdb_del(struct dsa_switch *ds,
9895
struct dsa_notifier_fdb_info *info)
9996
{
100-
/* Do not care yet about other switch chips of the fabric */
101-
if (ds->index != info->sw_index)
102-
return 0;
97+
int port = dsa_towards_port(ds, info->sw_index, info->port);
10398

10499
if (!ds->ops->port_fdb_del)
105100
return -EOPNOTSUPP;
106101

107-
return ds->ops->port_fdb_del(ds, info->port, info->addr,
108-
info->vid);
102+
return ds->ops->port_fdb_del(ds, port, info->addr, info->vid);
109103
}
110104

111105
static int

0 commit comments

Comments
 (0)