Skip to content

Commit 70d39a6

Browse files
vladimirolteankuba-moo
authored andcommitted
net: mscc: ocelot: export NUM_TC constant from felix to common switch lib
We should be moving anything that isn't DSA-specific or SoC-specific out of the felix DSA driver, and into the common mscc_ocelot switch library. The number of traffic classes is one of the aspects that is common between all ocelot switches, so it belongs in the library. This patch also makes seville use 8 TX queues, and therefore enables prioritization via the QOS_CLASS field in the NPI injection header. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d19741b commit 70d39a6

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

drivers/net/dsa/ocelot/felix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ static void felix_port_qos_map_init(struct ocelot *ocelot, int port)
299299
ANA_PORT_QOS_CFG,
300300
port);
301301

302-
for (i = 0; i < FELIX_NUM_TC * 2; i++) {
302+
for (i = 0; i < OCELOT_NUM_TC * 2; i++) {
303303
ocelot_rmw_ix(ocelot,
304304
(ANA_PORT_PCP_DEI_MAP_DP_PCP_DEI_VAL & i) |
305305
ANA_PORT_PCP_DEI_MAP_QOS_PCP_DEI_VAL(i),

drivers/net/dsa/ocelot/felix.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#define _MSCC_FELIX_H
66

77
#define ocelot_to_felix(o) container_of((o), struct felix, ocelot)
8-
#define FELIX_NUM_TC 8
98

109
/* Platform-specific information */
1110
struct felix_info {

drivers/net/dsa/ocelot/felix_vsc9959.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ static const struct felix_info felix_info_vsc9959 = {
13761376
.vcap = vsc9959_vcap_props,
13771377
.num_mact_rows = 2048,
13781378
.num_ports = 6,
1379-
.num_tx_queues = FELIX_NUM_TC,
1379+
.num_tx_queues = OCELOT_NUM_TC,
13801380
.switch_pci_bar = 4,
13811381
.imdio_pci_bar = 0,
13821382
.ptp_caps = &vsc9959_ptp_caps,
@@ -1435,7 +1435,7 @@ static int felix_pci_probe(struct pci_dev *pdev,
14351435
pci_set_drvdata(pdev, felix);
14361436
ocelot = &felix->ocelot;
14371437
ocelot->dev = &pdev->dev;
1438-
ocelot->num_flooding_pgids = FELIX_NUM_TC;
1438+
ocelot->num_flooding_pgids = OCELOT_NUM_TC;
14391439
felix->info = &felix_info_vsc9959;
14401440
felix->switch_base = pci_resource_start(pdev,
14411441
felix->info->switch_pci_bar);

drivers/net/dsa/ocelot/seville_vsc9953.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ static const struct felix_info seville_info_vsc9953 = {
12011201
.vcap = vsc9953_vcap_props,
12021202
.num_mact_rows = 2048,
12031203
.num_ports = 10,
1204+
.num_tx_queues = OCELOT_NUM_TC,
12041205
.mdio_bus_alloc = vsc9953_mdio_bus_alloc,
12051206
.mdio_bus_free = vsc9953_mdio_bus_free,
12061207
.phylink_validate = vsc9953_phylink_validate,

include/soc/mscc/ocelot.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
#define IFH_REW_OP_TWO_STEP_PTP 0x3
9999
#define IFH_REW_OP_ORIGIN_PTP 0x5
100100

101+
#define OCELOT_NUM_TC 8
101102
#define OCELOT_TAG_LEN 16
102103
#define OCELOT_SHORT_PREFIX_LEN 4
103104
#define OCELOT_LONG_PREFIX_LEN 16

0 commit comments

Comments
 (0)