Skip to content

Commit 3c7b51b

Browse files
Xiaoliang Yangdavem330
Xiaoliang Yang
authored andcommitted
net: dsa: felix: allow flooding for all traffic classes
Right now it can be seen that the VSC9959 (Felix) switch will not flood frames if they have a VLAN tag with a PCP of 1-7 (nonzero). It turns out that Felix is quite different from its cousin, Ocelot, in that frame flooding can be allowed/denied per traffic class. Where Ocelot has 1 instance of the ANA_FLOODING register, Felix has 8. The approach that this driver is going to take is "thanks, but no thanks". We have no use case of limiting the flooding domain based on traffic class, so we just want to allow packets to be flooded, no matter what traffic class they have. So we copy the line of code from ocelot.c which does the one-shot initialization of the flooding PGIDs, and we add it to felix.c as well - except replicated 8 times. Signed-off-by: Xiaoliang Yang <[email protected]> Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dfddb54 commit 3c7b51b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/net/dsa/ocelot/felix.c

+7
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ static int felix_setup(struct dsa_switch *ds)
522522
struct ocelot *ocelot = ds->priv;
523523
struct felix *felix = ocelot_to_felix(ocelot);
524524
int port, err;
525+
int tc;
525526

526527
err = felix_init_structs(felix, ds->num_ports);
527528
if (err)
@@ -555,6 +556,12 @@ static int felix_setup(struct dsa_switch *ds)
555556
ocelot_write_rix(ocelot,
556557
ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
557558
ANA_PGID_PGID, PGID_UC);
559+
/* Setup the per-traffic class flooding PGIDs */
560+
for (tc = 0; tc < FELIX_NUM_TC; tc++)
561+
ocelot_write_rix(ocelot, ANA_FLOODING_FLD_MULTICAST(PGID_MC) |
562+
ANA_FLOODING_FLD_BROADCAST(PGID_MC) |
563+
ANA_FLOODING_FLD_UNICAST(PGID_UC),
564+
ANA_FLOODING, tc);
558565

559566
ds->mtu_enforcement_ingress = true;
560567
/* It looks like the MAC/PCS interrupt register - PM0_IEVENT (0x8040)

drivers/net/dsa/ocelot/felix.h

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define _MSCC_FELIX_H
66

77
#define ocelot_to_felix(o) container_of((o), struct felix, ocelot)
8+
#define FELIX_NUM_TC 8
89

910
/* Platform-specific information */
1011
struct felix_info {

0 commit comments

Comments
 (0)