Message ID | cover.1599228079.git.landen.chao@mediatek.com |
---|---|
Headers | show |
Series | net-next: dsa: mt7530: add support for MT7531 | expand |
tested full series on Bananapi-r64 (mt7531) running iperf3-server [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.09 GBytes 939 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 1.09 GBytes 935 Mbits/sec receiver reverse mode (-R) [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.01 sec 1.10 GBytes 941 Mbits/sec 0 sender [ 5] 0.00-10.00 sec 1.09 GBytes 939 Mbits/sec receiver similar to bananapi-r2 (mt7530) [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.09 GBytes 938 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 1.09 GBytes 936 Mbits/sec receiver reverse-mode: [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.01 sec 1.05 GBytes 905 Mbits/sec 14533 sender <<<<<<<<<<< [ 5] 0.00-10.00 sec 1.05 GBytes 905 Mbits/sec receiver on last test i see iperf3 has ~30%cpu load and also ksoftirqd (using debian buster), so i tried opening server on my Laptop and running iperf -c on BPI-R2 with similar result [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.03 GBytes 886 Mbits/sec 13990 sender [ 5] 0.00-10.00 sec 1.03 GBytes 885 Mbits/sec receiver in dmesg of both devices only DSA-Messages (nonfatal error -95 setting MTU on port) because of missing port_change_mtu callback. here i got a patch, but had not yet time to setup environment for testing jumbo-frames too. But this just as side-note regards Frank
On Fri, 4 Sep 2020 22:21:57 +0800 Landen Chao wrote: > +static bool > +mt7530_phy_mode_supported(struct dsa_switch *ds, int port, > + const struct phylink_link_state *state) > { > struct mt7530_priv *priv = ds->priv; > - u32 mcr_cur, mcr_new; > > switch (port) { > case 0: /* Internal phy */ > @@ -1363,33 +1364,114 @@ static void mt7530_phylink_mac_config(struct dsa_switch *ds, int port, > case 3: > case 4: > if (state->interface != PHY_INTERFACE_MODE_GMII) > - return; > + goto unsupported; return false; Jumping to a label which does nothing but returns makes the code less readable. > break; > case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ > - if (priv->p5_interface == state->interface) > - break; > if (!phy_interface_mode_is_rgmii(state->interface) && > state->interface != PHY_INTERFACE_MODE_MII && > state->interface != PHY_INTERFACE_MODE_GMII) > - return; > + goto unsupported; > + break; > + case 6: /* 1st cpu port */ > + if (state->interface != PHY_INTERFACE_MODE_RGMII && > + state->interface != PHY_INTERFACE_MODE_TRGMII) > + goto unsupported; > + break; > + default: > + dev_err(priv->dev, "%s: unsupported port: %i\n", __func__, > + port); > + goto unsupported; > + } > + > + return true; > + > +unsupported: > + return false; > +} > +static void > +mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, > + const struct phylink_link_state *state) > +{ > + struct mt7530_priv *priv = ds->priv; > + u32 mcr_cur, mcr_new; > + > + if (!mt753x_phy_mode_supported(ds, port, state)) > + goto unsupported; > + > + switch (port) { > + case 0: /* Internal phy */ > + case 1: > + case 2: > + case 3: > + case 4: case 0 ... 4: > + if (state->interface != PHY_INTERFACE_MODE_GMII) > + goto unsupported; > + break; > + case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ > + if (priv->p5_interface == state->interface) > + break; > +static void > +mt753x_phylink_validate(struct dsa_switch *ds, int port, > + unsigned long *supported, > + struct phylink_link_state *state) > +{ > + struct mt7530_priv *priv = ds->priv; > __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; Please keep the variables longest to shortest (reverse xmas tree).
On Fri, 4 Sep 2020 22:21:59 +0800 Landen Chao wrote: > +static int > +mt7531_cpu_port_config(struct dsa_switch *ds, int port) > +{ > + struct mt7530_priv *priv = ds->priv; > + phy_interface_t interface; > + int speed; > + > + switch (port) { > + case 5: > + if (mt7531_is_rgmii_port(priv, port)) > + interface = PHY_INTERFACE_MODE_RGMII; > + else > + interface = PHY_INTERFACE_MODE_2500BASEX; > + > + priv->p5_interface = interface; > + break; > + case 6: > + interface = PHY_INTERFACE_MODE_2500BASEX; > + > + mt7531_pad_setup(ds, interface); > + > + priv->p6_interface = interface; > + break; > + }; stray semicolon
Hi > Gesendet: Samstag, 05. September 2020 um 10:45 Uhr > Von: "Frank Wunderlich" <frank-w@public-files.de> > similar to bananapi-r2 (mt7530) ... > reverse-mode: > > [ ID] Interval Transfer Bitrate Retr > [ 5] 0.00-10.01 sec 1.05 GBytes 905 Mbits/sec 14533 sender <<<<<<<<<<< > [ 5] 0.00-10.00 sec 1.05 GBytes 905 Mbits/sec receiver these retransmitts are caused by missing pause-statement in devicetree of bananapi-r2. I got them with mainline driver too. After fixing it [1], i got the expected results with these mt7531-Patches: iperf3-client on r2 normal mode: [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.10 GBytes 943 Mbits/sec 0 sender [ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec receiver reverse mode: [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.09 GBytes 939 Mbits/sec 0 sender [ 5] 0.00-10.00 sec 1.09 GBytes 937 Mbits/sec receiver Tested-By: Frank Wunderlich <frank-w@public-files.de> [1] https://patchwork.kernel.org/patch/11760003/ regards Frank