Hi all,
This patch series extracts the parts of the patch set that are likely not to be
controversial and actually bringing multi-queue support to DSA-created network
devices.
With these patches, we can now use sch_multiq as documented under
Documentation/networking/multique.txt and let applications dedice the switch
port output queue they want to use. Currently only Broadcom tags utilize that
information.
Changes from RFC:
- dropped the ability to configure RX queues since we don't do anything with
those just yet
- dropped the patches that dealt with binding the DSA slave network devices
queues with their master network devices queues this will be worked on
separately.
Florian Fainelli (4):
net: dsa: Allow switch drivers to indicate number of TX queues
net: dsa: tag_brcm: Set output queue from skb queue mapping
net: dsa: bcm_sf2: Advertise number of egress queues
net: dsa: bcm_sf2: Configure IMP port TC2QOS mapping
drivers/net/dsa/bcm_sf2.c | 12 ++++++++++++
include/net/dsa.h | 3 +++
net/dsa/slave.c | 8 ++++++--
net/dsa/tag_brcm.c | 3 ++-
4 files changed, 23 insertions(+), 3 deletions(-)
--
1.9.1
Let switch drivers indicate how many TX queues they support. Some
switches, such as Broadcom Starfighter 2 are designed with 8 egress
queues. Future changes will allow us to leverage the queue mapping and
direct the transmission towards a particular queue.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
include/net/dsa.h | 3 +++
net/dsa/slave.c | 8 ++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
@@ -243,6 +243,9 @@ struct dsa_switch {/* devlink used to represent this switch device */structdevlink*devlink;+/* Number of switch port queues */+unsignedintnum_tx_queues;+/* Dynamically allocated ports, keep last */size_tnum_ports;structdsa_portports[];
We originally used skb->priority but that was not quite correct as this
bitfield needs to contain the egress switch queue we intend to send this
SKB to.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
net/dsa/tag_brcm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
The switch supports 8 egress queues per port, so indicate that such that
net/dsa/slave.c::dsa_slave_create can allocate the right number of TX
queues.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 3 +++
1 file changed, 3 insertions(+)
Even though TC2QOS mapping is for switch egress queues, we need to
configure it correclty in order for the Broadcom tag ingress (CPU ->
switch) queue selection to work correctly since there is a 1:1 mapping
between switch egress queues and ingress queues.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 9 +++++++++
1 file changed, 9 insertions(+)
@@ -129,6 +130,14 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)reg|=MII_DUMB_FWDG_EN;core_writel(priv,reg,CORE_SWITCH_CTRL);+/* Configure Traffic Class to QoS mapping, allow each priority to map+*toadifferentqueuenumber+*/+reg=core_readl(priv,CORE_PORT_TC2_QOS_MAP_PORT(port));+for(i=0;i<8;i++)+reg|=i<<(PRT_TO_QID_SHIFT*i);+core_writel(priv,reg,CORE_PORT_TC2_QOS_MAP_PORT(port));+bcm_sf2_brcm_hdr_setup(priv,port);/* Force link status for IMP port */
From: Andrew Lunn <andrew@lunn.ch> Date: 2017-09-02 16:31:01
quoted hunk
@@ -129,6 +130,14 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) reg |= MII_DUMB_FWDG_EN; core_writel(priv, reg, CORE_SWITCH_CTRL);+ /* Configure Traffic Class to QoS mapping, allow each priority to map+ * to a different queue number+ */+ reg = core_readl(priv, CORE_PORT_TC2_QOS_MAP_PORT(port));+ for (i = 0; i < 8; i++)+ reg |= i << (PRT_TO_QID_SHIFT * i);
Hi Florian
Rather than 8, would ds->num_tx_queues be more descriptive?
Andrew
@@ -129,6 +130,14 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) reg |= MII_DUMB_FWDG_EN; core_writel(priv, reg, CORE_SWITCH_CTRL);+ /* Configure Traffic Class to QoS mapping, allow each priority to map+ * to a different queue number+ */+ reg = core_readl(priv, CORE_PORT_TC2_QOS_MAP_PORT(port));+ for (i = 0; i < 8; i++)+ reg |= i << (PRT_TO_QID_SHIFT * i);
Hi Florian
Rather than 8, would ds->num_tx_queues be more descriptive?
I actually have a patch on top of this which defines a constant for the
number of queues instead of open coding 8 here. Thanks!
--
Florian
From: Andrew Lunn <andrew@lunn.ch> Date: 2017-09-02 17:47:58
On Sat, Sep 02, 2017 at 09:32:08AM -0700, Florian Fainelli wrote:
On 09/02/2017 09:30 AM, Andrew Lunn wrote:
quoted
quoted
@@ -129,6 +130,14 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) reg |= MII_DUMB_FWDG_EN; core_writel(priv, reg, CORE_SWITCH_CTRL);+ /* Configure Traffic Class to QoS mapping, allow each priority to map+ * to a different queue number+ */+ reg = core_readl(priv, CORE_PORT_TC2_QOS_MAP_PORT(port));+ for (i = 0; i < 8; i++)+ reg |= i << (PRT_TO_QID_SHIFT * i);
Hi Florian
Rather than 8, would ds->num_tx_queues be more descriptive?
I actually have a patch on top of this which defines a constant for the
number of queues instead of open coding 8 here. Thanks!
Hi Florian
It sounds like it should be part of 3/4?
Andrew
On Sat, Sep 02, 2017 at 09:32:08AM -0700, Florian Fainelli wrote:
quoted
On 09/02/2017 09:30 AM, Andrew Lunn wrote:
quoted
quoted
@@ -129,6 +130,14 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) reg |= MII_DUMB_FWDG_EN; core_writel(priv, reg, CORE_SWITCH_CTRL);+ /* Configure Traffic Class to QoS mapping, allow each priority to map+ * to a different queue number+ */+ reg = core_readl(priv, CORE_PORT_TC2_QOS_MAP_PORT(port));+ for (i = 0; i < 8; i++)+ reg |= i << (PRT_TO_QID_SHIFT * i);
Hi Florian
Rather than 8, would ds->num_tx_queues be more descriptive?
I actually have a patch on top of this which defines a constant for the
number of queues instead of open coding 8 here. Thanks!
Hi Florian
It sounds like it should be part of 3/4?
Right, let me re-submit with that change included. Thanks
--
Florian