All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Hagan <mnhagan88@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH net-next] net: dsa: tag_qca: Check for upstream VLAN tag
Date: Sat, 5 Jun 2021 23:39:24 +0100	[thread overview]
Message-ID: <ed3940ec-5636-63db-a36b-dc6c2220b51d@gmail.com> (raw)
In-Reply-To: <YLvgI1e3tdb+9SQC@lunn.ch>

On 05/06/2021 21:35, Andrew Lunn wrote:

>> The tested case is a Meraki MX65 which features two QCA8337 switches with
>> their CPU ports attached to a BCM58625 switch ports 4 and 5 respectively.
> Hi Matthew
>
> The BCM58625 switch is also running DSA? What does you device tree
> look like? I know Florian has used two broadcom switches in cascade
> and did not have problems.
>
>     Andrew

Hi Andrew

I did discuss this with Florian, who recommended I submit the changes. Can
confirm the b53 DSA driver is being used. The issue here is that tagging
must occur on all ports. We can't selectively disable for ports 4 and 5
where the QCA switches are attached, thus this patch is required to get
things working.

Setup is like this:
                       sw0p2     sw0p4            sw1p2     sw1p4 
    wan1    wan2  sw0p1  +  sw0p3  +  sw0p5  sw1p1  +  sw1p3  +  sw1p5
     +       +      +    |    +    |    +      +    |    +    |    +
     |       |      |    |    |    |    |      |    |    |    |    |
     |       |    +--+----+----+----+----+-+ +--+----+----+----+----+-+
     |       |    |         QCA8337        | |        QCA8337         |
     |       |    +------------+-----------+ +-----------+------------+
     |       |             sw0 |                     sw1 |
+----+-------+-----------------+-------------------------+------------+
|    0       1    BCM58625     4                         5            |
+----+-------+-----------------+-------------------------+------------+

Relevant sections of the device tree are as follows:

mdio@0 {
    reg = <0x0>;
    #address-cells = <1>;
    #size-cells = <0>;

    phy_port6: phy@0 {
        reg = <0>;
    };

    phy_port7: phy@1 {
        reg = <1>;
    };

    phy_port8: phy@2 {
        reg = <2>;
    };

    phy_port9: phy@3 {
        reg = <3>;
    };

    phy_port10: phy@4 {
        reg = <4>;
    };

    switch@10 {
        compatible = "qca,qca8337";
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0x10>;
        dsa,member = <1 0>;

        ports {
            #address-cells = <1>;
            #size-cells = <0>;
            port@0 {
                reg = <0>;
                label = "cpu";
                ethernet = <&sgmii1>;
                phy-mode = "sgmii";
                fixed-link {
                    speed = <1000>;
                    full-duplex;
                };
            };

            port@1 {
                reg = <1>;
                label = "sw1p1";
                phy-handle = <&phy_port6>;
            };

            port@2 {
                reg = <2>;
                label = "sw1p2";
                phy-handle = <&phy_port7>;
            };

            port@3 {
                reg = <3>;
                label = "sw1p3";
                phy-handle = <&phy_port8>;
            };

            port@4 {
                reg = <4>;
                label = "sw1p4";
                phy-handle = <&phy_port9>;
            };

            port@5 {
                reg = <5>;
                label = "sw1p5";
                phy-handle = <&phy_port10>;
            };
        };
    };
};

mdio-mii@2000 {
    reg = <0x2000>;
    #address-cells = <1>;
    #size-cells = <0>;

    phy_port1: phy@0 {
        reg = <0>;
    };

    phy_port2: phy@1 {
        reg = <1>;
    };

    phy_port3: phy@2 {
        reg = <2>;
    };

    phy_port4: phy@3 {
        reg = <3>;
    };

    phy_port5: phy@4 {
        reg = <4>;
    };

    switch@10 {
        compatible = "qca,qca8337";
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0x10>;
        dsa,member = <2 0>;

        ports {
            #address-cells = <1>;
            #size-cells = <0>;
            port@0 {
                reg = <0>;
                label = "cpu";
                ethernet = <&sgmii0>;
                phy-mode = "sgmii";
                fixed-link {
                    speed = <1000>;
                    full-duplex;
                };
            };

            port@1 {
                reg = <1>;
                label = "sw0p1";
                phy-handle = <&phy_port1>;
            };

            port@2 {
                reg = <2>;
                label = "sw0p2";
                phy-handle = <&phy_port2>;
            };

            port@3 {
                reg = <3>;
                label = "sw0p3";
                phy-handle = <&phy_port3>;
            };

            port@4 {
                reg = <4>;
                label = "sw0p4";
                phy-handle = <&phy_port4>;
            };

            port@5 {
                reg = <5>;
                label = "sw0p5";
                phy-handle = <&phy_port5>;
            };
        };
    };
};


&srab {
    compatible = "brcm,bcm58625-srab", "brcm,nsp-srab";
    status = "okay";
    dsa,member = <0 0>;

    ports {
        #address-cells = <1>;
        #size-cells = <0>;

        port@0 {
            label = "wan1";
            reg = <0>;
        };

        port@1 {
            label = "wan2";
            reg = <1>;
        };

        sgmii0: port@4 {
            label = "sw0";
            reg = <4>;
            fixed-link {
                speed = <1000>;
                full-duplex;
            };
        };

        sgmii1: port@5 {
            label = "sw1";
            reg = <5>;
            fixed-link {
                speed = <1000>;
                full-duplex;
            };
        };

        port@8 {
            ethernet = <&amac2>;
            label = "cpu";
            reg = <8>;
            fixed-link {
                speed = <1000>;
                full-duplex;
            };
        };
    };
};

Matthew


  reply	other threads:[~2021-06-05 22:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 19:37 [RFC PATCH net-next] net: dsa: tag_qca: Check for upstream VLAN tag Matthew Hagan
2021-06-05 20:35 ` Andrew Lunn
2021-06-05 22:39   ` Matthew Hagan [this message]
2021-06-06  0:53     ` Vladimir Oltean
2021-06-06  3:34       ` Florian Fainelli
2021-06-06  9:38         ` Vladimir Oltean
2021-06-07 17:01           ` Florian Fainelli
2021-06-06 13:09       ` Matthew Hagan
2021-06-06 19:27         ` Vladimir Oltean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed3940ec-5636-63db-a36b-dc6c2220b51d@gmail.com \
    --to=mnhagan88@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.