Skip to content

Commit

Permalink
net: dsa: ocelot: use ds->num_tx_queues = OCELOT_NUM_TC for all models
Browse files Browse the repository at this point in the history
Russell King points out that seville_vsc9953 populates
felix->info->num_tx_queues = 8, but this doesn't make it all the way
into ds->num_tx_queues (which is how the user interface netdev queues
get allocated) [1].

[1]: https://lore.kernel.org/all/20240415160150.yejcazpjqvn7vhxu@skbuf/

When num_tx_queues=0 for seville, this is implicitly converted to 1 by
dsa_user_create(), and this is good enough for basic operation for a
switch port. The tc qdisc offload layer works with netdev TX queues,
so for QoS offload we need to pretend we have multiple TX queues. The
VSC9953, like ocelot_ext, doesn't export QoS offload, so it doesn't
really matter. But we can definitely set num_tx_queues=8 for all
switches.

The felix->info->num_tx_queues construct itself seems unnecessary.
It was introduced by commit de143c0 ("net: dsa: felix: Configure
Time-Aware Scheduler via taprio offload") at a time when vsc9959
(LS1028A) was the only switch supported by the driver.

8 traffic classes, and 1 queue per traffic class, is a common
architectural feature of all switches in the family. So they could
all just set OCELOT_NUM_TC and be fine.

Signed-off-by: Vladimir Oltean <[email protected]>
Reviewed-by: Colin Foster <[email protected]>
Tested-by: Colin Foster <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vladimiroltean authored and davem330 committed Jun 3, 2024
1 parent 0367a17 commit 4ca54dd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion drivers/net/dsa/ocelot/felix.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ struct felix_info {
const u32 *port_modes;
int num_mact_rows;
int num_ports;
int num_tx_queues;
struct vcap_props *vcap;
u16 vcap_pol_base;
u16 vcap_pol_max;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/dsa/ocelot/felix_vsc9959.c
Original file line number Diff line number Diff line change
Expand Up @@ -2658,7 +2658,6 @@ static const struct felix_info felix_info_vsc9959 = {
.vcap_pol_max2 = 0,
.num_mact_rows = 2048,
.num_ports = VSC9959_NUM_PORTS,
.num_tx_queues = OCELOT_NUM_TC,
.quirks = FELIX_MAC_QUIRKS,
.quirk_no_xtr_irq = true,
.ptp_caps = &vsc9959_ptp_caps,
Expand Down Expand Up @@ -2711,7 +2710,8 @@ static int felix_pci_probe(struct pci_dev *pdev,

ds->dev = dev;
ds->num_ports = felix->info->num_ports;
ds->num_tx_queues = felix->info->num_tx_queues;
ds->num_tx_queues = OCELOT_NUM_TC;

ds->ops = &felix_switch_ops;
ds->phylink_mac_ops = &felix_phylink_mac_ops;
ds->priv = ocelot;
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/dsa/ocelot/ocelot_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ static const struct felix_info vsc7512_info = {
.vcap = vsc7514_vcap_props,
.num_mact_rows = 1024,
.num_ports = VSC7514_NUM_PORTS,
.num_tx_queues = OCELOT_NUM_TC,
.port_modes = vsc7512_port_modes,
.phylink_mac_config = ocelot_phylink_mac_config,
.configure_serdes = ocelot_port_configure_serdes,
Expand Down Expand Up @@ -90,7 +89,7 @@ static int ocelot_ext_probe(struct platform_device *pdev)

ds->dev = dev;
ds->num_ports = felix->info->num_ports;
ds->num_tx_queues = felix->info->num_tx_queues;
ds->num_tx_queues = OCELOT_NUM_TC;

ds->ops = &felix_switch_ops;
ds->phylink_mac_ops = &felix_phylink_mac_ops;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/dsa/ocelot/seville_vsc9953.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,6 @@ static const struct felix_info seville_info_vsc9953 = {
.quirks = FELIX_MAC_QUIRKS,
.num_mact_rows = 2048,
.num_ports = VSC9953_NUM_PORTS,
.num_tx_queues = OCELOT_NUM_TC,
.mdio_bus_alloc = vsc9953_mdio_bus_alloc,
.mdio_bus_free = vsc9953_mdio_bus_free,
.port_modes = vsc9953_port_modes,
Expand Down Expand Up @@ -1002,6 +1001,8 @@ static int seville_probe(struct platform_device *pdev)

ds->dev = dev;
ds->num_ports = felix->info->num_ports;
ds->num_tx_queues = OCELOT_NUM_TC;

ds->ops = &felix_switch_ops;
ds->phylink_mac_ops = &felix_phylink_mac_ops;
ds->priv = ocelot;
Expand Down

0 comments on commit 4ca54dd

Please sign in to comment.