Commit 70d39a6e authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski
Browse files

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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d19741b0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -299,7 +299,7 @@ static void felix_port_qos_map_init(struct ocelot *ocelot, int port)
		       ANA_PORT_QOS_CFG,
		       port);

	for (i = 0; i < FELIX_NUM_TC * 2; i++) {
	for (i = 0; i < OCELOT_NUM_TC * 2; i++) {
		ocelot_rmw_ix(ocelot,
			      (ANA_PORT_PCP_DEI_MAP_DP_PCP_DEI_VAL & i) |
			      ANA_PORT_PCP_DEI_MAP_QOS_PCP_DEI_VAL(i),
+0 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
#define _MSCC_FELIX_H

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

/* Platform-specific information */
struct felix_info {
+2 −2
Original line number Diff line number Diff line
@@ -1376,7 +1376,7 @@ static const struct felix_info felix_info_vsc9959 = {
	.vcap			= vsc9959_vcap_props,
	.num_mact_rows		= 2048,
	.num_ports		= 6,
	.num_tx_queues		= FELIX_NUM_TC,
	.num_tx_queues		= OCELOT_NUM_TC,
	.switch_pci_bar		= 4,
	.imdio_pci_bar		= 0,
	.ptp_caps		= &vsc9959_ptp_caps,
@@ -1435,7 +1435,7 @@ static int felix_pci_probe(struct pci_dev *pdev,
	pci_set_drvdata(pdev, felix);
	ocelot = &felix->ocelot;
	ocelot->dev = &pdev->dev;
	ocelot->num_flooding_pgids = FELIX_NUM_TC;
	ocelot->num_flooding_pgids = OCELOT_NUM_TC;
	felix->info = &felix_info_vsc9959;
	felix->switch_base = pci_resource_start(pdev,
						felix->info->switch_pci_bar);
+1 −0
Original line number Diff line number Diff line
@@ -1201,6 +1201,7 @@ static const struct felix_info seville_info_vsc9953 = {
	.vcap			= vsc9953_vcap_props,
	.num_mact_rows		= 2048,
	.num_ports		= 10,
	.num_tx_queues		= OCELOT_NUM_TC,
	.mdio_bus_alloc		= vsc9953_mdio_bus_alloc,
	.mdio_bus_free		= vsc9953_mdio_bus_free,
	.phylink_validate	= vsc9953_phylink_validate,
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@
#define IFH_REW_OP_TWO_STEP_PTP		0x3
#define IFH_REW_OP_ORIGIN_PTP		0x5

#define OCELOT_NUM_TC			8
#define OCELOT_TAG_LEN			16
#define OCELOT_SHORT_PREFIX_LEN		4
#define OCELOT_LONG_PREFIX_LEN		16