From: Greg Ungerer <gerg@kernel.org>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: sean.wang@mediatek.com, andrew@lunn.ch,
vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com,
netdev@vger.kernel.org, blogic@openwrt.org, neil@brown.name,
"René van Dorst" <opensource@vdorst.com>
Subject: Re: [PATCH 0/3]: net: dsa: mt7530: support MT7530 in the MT7621 SoC
Date: Mon, 3 Dec 2018 17:20:10 +1000 [thread overview]
Message-ID: <0ef5a725-a88a-0a6e-1a69-9106cead6b65@kernel.org> (raw)
In-Reply-To: <87r2f2pxpa.fsf@miraculix.mork.no>
Hi Bjorn,
On 30/11/18 10:16 pm, Bjørn Mork wrote:
> gerg@kernel.org writes:
>
>> I have been working towards supporting the MT7530 switch as used in the
>> MediaTek MT7621 SoC. Unlike the MediaTek MT7623 the MT7621 is built around
>> a dual core MIPS CPU architecture. But underneath it is what appears to
>> be the same 7530 switch.
>
> Great! Good to see someone pushing this idea forward.
>
>> The following 3 patches are more of an RFC than anything. They allow
>> use of the mt7530 dsa driver on this device - though with some issues
>> still to resolve. The primary change required is to not use the 7623
>> specific clock and regulator setup - none of that applies when using
>> the 7621 (and maybe other devices?). The other change required is to
>> set the 7530 MFC register CPU port number and enable bit.
>>
>> The unresolved issues I still have appear to be more related to the
>> MT7621 ethernet driver (drivers/staging/mt7621-eth/*). I am hoping
>> someone might have some ideas on these. I don't really have any good
>> documentation on the ethernet devices on the 7621, so I am kind of
>> working in the dark here.
>
> No offense, but the mt7621-eth driver in staging is horrible. What both
> René and I have had some success with is adapting the mtk_eth_soc driver
> already in drivers/net/ethernet/mediatek/. Yes, I know this is supposed
> to be for other SoCs, but the basic design is obviously the same.
>
> I have had some success with a first hackish attemt based on OpenWrt.
> You can find the early tree here, but note that my focus was basically
> getting one specific MT7621 board up and running:
> https://github.com/bmork/LEDE/tree/mt7621-with-mainline-eth-driver
>
> This patch has most of the necessary changes to enable that driver for
> MT7621:
> https://github.com/bmork/LEDE/commit/3293bc63f5461ca1eb0bbc4ed90145335e7e3404
I applied this to my main debug linux-4.19 kernel. Didn't apply completely
cleanly but was easy to fix up.
Using that everything came up detected (the 7530 switch) and I could
quickly see that it does not suffer the problems I listed below. Both
RX and TX packets of any size work!
However I also quickly discovered that this driver was pretty unstable.
Put a bit of packet load on it, and it would stop responding, CPU lock up,
and occasional rcu stalled messages from the kernel.
The following change helped alot, but I still get some problems under
sustained load and some types of port setups. Still trying to figure
out what exactly is going on.
--- a/linux/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/linux/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1750,8 +1750,8 @@ static irqreturn_t mtk_handle_irq_rx(int irq, void *_eth)
if (likely(napi_schedule_prep(ð->rx_napi))) {
__napi_schedule(ð->rx_napi);
- mtk_rx_irq_disable(eth, MTK_RX_DONE_INT);
}
+ mtk_rx_irq_disable(eth, MTK_RX_DONE_INT);
return IRQ_HANDLED;
}
@@ -1762,11 +1762,53 @@ static irqreturn_t mtk_handle_irq_tx(int irq, void *_eth)
if (likely(napi_schedule_prep(ð->tx_napi))) {
__napi_schedule(ð->tx_napi);
- mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
}
+ mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
return IRQ_HANDLED;
}
Anyway, this really looks like the right approach to me. This driver is
clearly capable of supporting the mt7621 ethernet ports. No need for the
staging driver.
Regards
Greg
> Not a big deal, as you can see. There is of course a reason I didn't
> submit this here yet: It is by no means finished... But it works. And I
> have both GMACs working with this driver, which was my primary goal.
>
>> 1. TX packets are not getting an IP header checksum via the normal
>> off-loaded checksumming when in DSA mode. I have to switch off
>> NETIF_F_IP_CSUM, so the software stack generates the checksum.
>> That checksum offloading works ok when not using the 7530 DSA driver.
>
> Hmm. How do I test this?
>
>> 2. Maximal sized RX packets get silently dropped. So receive side packets
>> that are large (perfect case is the all-but-last packets in a fragemented
>> larger packet) appear to be dropped at the mt7621 ethernet MAC level.
>> The 7530 MIB switch register counters show receive packets at the physical
>> switch port side and at the CPU switch port - but I get no packets
>> received or errors in the 7621 ethernet MAC. If I set the mtu of the
>> server at the other end a little smaller (a few bytes is enough) then
>> I get all the packets through. It seems like the DSA/VLAN tag bytes
>> are causing a too large packet to get silently dropped somewhere.
>
> Are you referring to the configured MTU size or some other maximal size?
> If MTU, then I don't seem to have this issue with the driver from
> drivers/net/ethernet/mediatek/.
>
>
>
> Bjørn
>
next prev parent reply other threads:[~2018-12-03 7:20 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 7:57 [PATCH 0/3]: net: dsa: mt7530: support MT7530 in the MT7621 SoC gerg
2018-11-30 7:57 ` [PATCH 1/3] net: dsa: mt7530: make clock/regulator setup optional gerg
2018-11-30 7:57 ` [PATCH 2/3] net: dsa: mt7530: optional setting CPU field in MFC register gerg
2018-11-30 7:57 ` [PATCH 3/3] dt-bindings: net: dsa: add new bindings MT7530 gerg
2018-11-30 17:41 ` Florian Fainelli
2018-12-03 7:03 ` Greg Ungerer
2018-12-03 13:19 ` Andrew Lunn
2018-11-30 11:27 ` [PATCH 0/3]: net: dsa: mt7530: support MT7530 in the MT7621 SoC René van Dorst
2018-11-30 13:25 ` Greg Ungerer
2018-11-30 11:30 ` René van Dorst
2018-11-30 12:16 ` Bjørn Mork
2018-11-30 13:41 ` Greg Ungerer
2018-11-30 13:42 ` Andrew Lunn
2018-12-03 7:20 ` Greg Ungerer [this message]
2018-12-03 11:34 ` Bjørn Mork
2018-12-03 14:00 ` René van Dorst
2018-12-03 14:02 ` John Crispin
2018-12-07 7:12 ` Greg Ungerer
2018-12-04 7:23 ` Greg Ungerer
2018-12-11 5:02 ` NeilBrown
2018-12-11 8:28 ` Bjørn Mork
2018-12-16 22:08 ` NeilBrown
2018-12-16 22:14 ` David Miller
2018-12-16 23:19 ` NeilBrown
2018-12-17 0:00 ` Florian Fainelli
2018-12-17 7:11 ` NeilBrown
2018-11-30 13:33 ` Andrew Lunn
2018-12-03 6:47 ` Greg Ungerer
2018-11-30 13:37 ` Andrew Lunn
2018-11-30 13:45 ` Greg Ungerer
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=0ef5a725-a88a-0a6e-1a69-9106cead6b65@kernel.org \
--to=gerg@kernel.org \
--cc=andrew@lunn.ch \
--cc=bjorn@mork.no \
--cc=blogic@openwrt.org \
--cc=f.fainelli@gmail.com \
--cc=neil@brown.name \
--cc=netdev@vger.kernel.org \
--cc=opensource@vdorst.com \
--cc=sean.wang@mediatek.com \
--cc=vivien.didelot@savoirfairelinux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).