From: Lukasz Majewski <lukma@denx.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Peng Fan <peng.fan@nxp.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Fugang Duan <fugang.duan@nxp.com>,
stefan.agner@toradex.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, krzk@kernel.org,
Vivien Didelot <vivien.didelot@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>,
Fabio Estevam <festevam@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
Vladimir Oltean <olteanv@gmail.com>,
Shawn Guo <shawnguo@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC 0/4] net: l2switch: Provide support for L2 switch on i.MX28 SoC
Date: Fri, 27 Nov 2020 01:03:25 +0100 [thread overview]
Message-ID: <20201127010325.5d929362@jawa> (raw)
In-Reply-To: <20201126144546.GN2075216@lunn.ch>
[-- Attachment #1.1: Type: text/plain, Size: 3811 bytes --]
Hi Andrew,
> > > What is not yet clear to me is how you direct frames out specific
> > > interfaces. This is where i think we hit problems. I don't see a
> > > generic mechanism, which is probably why Lukasz put tagger as
> > > None.
> >
> > I've put the "None" tag just to share the "testable" RFC code.
>
> Tagging is a core feature of DSA. Without being able to direct a
> packet out a specific port, it is not really a DSA driver. It is also
> core requirement of integrating a switch into Linux. A DSA driver, or
> a pure switchdev driver expects to be able to forward frames out
> specific ports.
Please find my answer, which I gave to Vladimir in the other mail (you
were CC'ed).
As a backup plan - the vlan tagging may be worth to investigate.
>
> > It is possible to "tag" frames - at least from the manual [0]:
> > Chapter: "29.4.9.2 Forced Forwarding".
> >
> > With using register HW_ENET_SWI_FORCE_FWD_P0
> > 29.9.34 ENET SWI Enable forced forwarding for a frame processed
> > from port 0 (HW_ENET_SWI_FORCE_FWD_P0)
> >
> > One can "tag" the packet going from port0 (internal one from SoC)
> > to be forwarded to port1 (ENET-MAC0) or port2 (ENET-MAC1).
> >
> > According to the legacy driver [1]:
> > "* It only replace the MAC lookup function,
> > * all other filtering(eg.VLAN verification) act as normal"
>
> This might solve your outgoing frame problems. But you need to dive
> deep into how the FEC driver works, especially in a DSA like
> setup.
Agree.
> The normal path would be, the slave interface passes a frame to
> the tagger driver, living in net/dsa/tag_*.c. Normally, it adds a
> header/trailer which the switch looks at. It then hands to packet over
> to the master Ethernet driver, which at some point will send the
> frame. Because the frame is self contained, we don't care what that
> ethernet driver actually does. It can add it to a queue and send it
> later. It can look at the QoS tags and send it with low priority after
> other frames, or could put it to the head of the queue and send it
> before other frames etc.
>
Thanks for the explanation.
> Since you don't have self contained frames, this is a problem. After
> writing to this register, you need to ensure what is transmitted next
> is the specific frame you intend. It cannot be added to an existing
> queue etc. You need to know when the frame has been sent, so you can
> re-write this register for the next frame.
This needs to be assessed as the documentation is very vague. I'm
wondering how MTIP/NXP recommends usage of ESW_FFEN register.
>
> This is why i said i don't know if the DSA architecture will work. You
> need a close coupling between the tagger setting the force bits, and
> the DMA engine sending the frame.
Maybe it would be just enough to program the ESW_FFEN register when ENET
descriptor is programmed for DMA? Earlier we would append the
superfluous tag in the tag_*.c ?
>
> The other option is you totally ignore most of this and statically
> assign VLANs. Frames sent with VLAN 1 are forwarded out port 1. Frames
> sent with VLAN 2 are sent out port 2. You need the port to
> append/strip these VLAN tags for ingress/egress. tag_8021q.c gives you
> some code to help with this. But can you still use the hardware to
> switch frames between ports 1 and 2 without them going via the CPU?
Yes, it is possible to switch frames between ENET-MAC{01} ports without
any interaction from CPU.
>
> Andrew.
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-11-27 0:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 23:24 [RFC 0/4] net: l2switch: Provide support for L2 switch on i.MX28 SoC Lukasz Majewski
2020-11-25 23:24 ` [RFC 1/4] net: fec: Move some defines to ./drivers/net/ethernet/freescale/fec.h header Lukasz Majewski
2020-11-25 23:24 ` [RFC 2/4] net: dsa: Provide DSA driver for NXP's More Than IP L2 switch Lukasz Majewski
2020-11-25 23:24 ` [RFC 3/4] net: imx: l2switch: Adjust fec_main.c to provide support for " Lukasz Majewski
2020-11-25 23:24 ` [RFC 4/4] ARM: dts: imx28: Add description for L2 switch on XEA board Lukasz Majewski
2020-11-26 0:00 ` [RFC 0/4] net: l2switch: Provide support for L2 switch on i.MX28 SoC Andrew Lunn
2020-11-26 1:30 ` Florian Fainelli
2020-11-26 3:10 ` Andrew Lunn
2020-11-26 10:10 ` Lukasz Majewski
2020-11-26 14:45 ` Andrew Lunn
2020-11-27 0:03 ` Lukasz Majewski [this message]
2020-11-26 12:30 ` Vladimir Oltean
2020-11-26 23:35 ` Lukasz Majewski
2020-11-27 0:55 ` Andrew Lunn
2020-11-27 9:16 ` Lukasz Majewski
2020-11-27 1:08 ` Andrew Lunn
2020-11-27 9:25 ` Lukasz Majewski
2020-11-27 15:10 ` Andrew Lunn
2021-06-17 11:08 ` Lukasz Majewski
2021-06-17 13:57 ` Andrew Lunn
2020-11-27 19:29 ` Vladimir Oltean
2020-11-28 0:33 ` Lukasz Majewski
2020-11-28 4:34 ` Florian Fainelli
2020-11-29 21:59 ` Lukasz Majewski
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=20201127010325.5d929362@jawa \
--to=lukma@denx.de \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=festevam@gmail.com \
--cc=fugang.duan@nxp.com \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=peng.fan@nxp.com \
--cc=shawnguo@kernel.org \
--cc=stefan.agner@toradex.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 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).