public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Jonas Gorski <jonas.gorski@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Frank Wunderlich <frankwu@gmx.de>, Chad Monroe <chad@monroe.io>,
	Cezary Wilmanski <cezary.wilmanski@adtran.com>,
	Liang Xu <lxu@maxlinear.com>,
	"Benny (Ying-Tsan) Weng" <yweng@maxlinear.com>,
	Jose Maria Verdu Munoz <jverdu@maxlinear.com>,
	Avinash Jayaraman <ajayaraman@maxlinear.com>,
	John Crispin <john@phrozen.org>
Subject: Re: [PATCH net-next 1/2] dsa: tag_mxl862xx: set dsa_default_offload_fwd_mark()
Date: Mon, 9 Mar 2026 00:02:47 +0000	[thread overview]
Message-ID: <aa4OJ7hkqoR6oDxZ@makrotopia.org> (raw)
In-Reply-To: <CAOiHx=n9_asSiAhB=aZKRenh6BsBAYP_3i7WxfBsbUBDz3BrWw@mail.gmail.com>

On Sun, Mar 08, 2026 at 09:15:42PM +0100, Jonas Gorski wrote:
> On Sun, Mar 8, 2026 at 4:19 PM Daniel Golle <daniel@makrotopia.org> wrote:
> >
> > On Sat, Mar 07, 2026 at 10:57:56AM +0100, Jonas Gorski wrote:
> > > Hi,
> > >
> > > On 07/03/2026 04:30, Daniel Golle wrote:
> > > > The MxL862xx offloads forwarding between bridged ports to the
> > > > hardware, so set dsa_default_offload_fwd_mark() to avoid duplicate
> > > > forwarding of packets of (eg. flooded) frames arriving at the CPU
> > > > port.
> > > >
> > > > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> > > > ---
> > > >  net/dsa/tag_mxl862xx.c | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > >
> > > > diff --git a/net/dsa/tag_mxl862xx.c b/net/dsa/tag_mxl862xx.c
> > > > index 01f2158682718..c02f69de61cbb 100644
> > > > --- a/net/dsa/tag_mxl862xx.c
> > > > +++ b/net/dsa/tag_mxl862xx.c
> > > > @@ -92,6 +92,8 @@ static struct sk_buff *mxl862_tag_rcv(struct sk_buff *skb,
> > > >     skb_pull_rcsum(skb, MXL862_HEADER_LEN);
> > > >     dsa_strip_etype_header(skb, MXL862_HEADER_LEN);
> > > >
> > > > +   dsa_default_offload_fwd_mark(skb);
> > >
> > > Does the switch (by default) also flood link local traffic (e.g. STP, LACP,
> > > etc)? If not, you should not mark these as fwd offloaded.
> >
> > No, it doesn't. Testing revealed that apparently it silently consumes them.
> > I assume we'll need something like
> >
> > if (likely(!is_link_local_ether_addr(eth_hdr(skb)->h_dest)))
> >     dsa_default_offload_fwd_mark(skb);
> >
> > similar to tag_brcm.c, right?
> 
> Yepp, that would have been my suggestion :-)

Ok, I'll do that then.

> 
> > > Is there is a bit in the header that says whether a packet was flooded or
> > > trapped that you can check?
> >
> > Earlier testing showed that frames arriving at the microcontroller under
> > some conditions are relayed to the DSA CPU port -- and are destinguishable
> > as such. However, there is not bit directly indicating whether the packet
> > was (also) flooded already.
> 
> So you know if they were copied to the cpu port due to some rules, but
> not if they were snooped or trapped?

I haven't found any details about that documented, and all I can say
is that in some cases (some of the IEEE1588v2 frames generated by the
local_termination.sh selftest, for example) the microcontroller seems
to send an additional copy of the frame to the DSA CPU port using
fields of the 8-byte tag which usually aren't used -- and that's why I
even noticed them. The initial driver now merged upstream disabled the
microcontroller SDMA and FMDA, effectively disconnecting it from the
switch datapath, so it would shut up, and this effect can now longer
be observed.

Now, when testing if link-local frames would be forwarded I noticed
that there is a set of default rules instatiated after reset which
trap link-local frames to the microcontroller port. I suppose it could
also be setup to snoop instead of trap by manually erasing these PCE
rules and setting new ones instead. In this case, however, there would
be no way to tell from the frame received on the DSA CPU port if the
frame had also been sent to the microcontroller.

  reply	other threads:[~2026-03-09  0:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-07  3:29 [PATCH net-next 0/2] net: dsa: mxl862xx: add support for bridge offloading Daniel Golle
2026-03-07  3:30 ` [PATCH net-next 1/2] dsa: tag_mxl862xx: set dsa_default_offload_fwd_mark() Daniel Golle
2026-03-07  9:57   ` Jonas Gorski
2026-03-08 15:18     ` Daniel Golle
2026-03-08 20:15       ` Jonas Gorski
2026-03-09  0:02         ` Daniel Golle [this message]
2026-03-09  8:07           ` Jonas Gorski
2026-03-09 12:23             ` Daniel Golle
2026-03-09 23:33             ` Vladimir Oltean
2026-03-07  3:31 ` [PATCH net-next 2/2] net: dsa: mxl862xx: implement bridge offloading Daniel Golle
2026-03-09 23:22   ` Jakub Kicinski
2026-03-09 23:27   ` Vladimir Oltean
2026-03-07  3:39 ` [PATCH net-next 0/2] net: dsa: mxl862xx: add support for " Daniel Golle

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=aa4OJ7hkqoR6oDxZ@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=ajayaraman@maxlinear.com \
    --cc=andrew@lunn.ch \
    --cc=cezary.wilmanski@adtran.com \
    --cc=chad@monroe.io \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=frankwu@gmx.de \
    --cc=horms@kernel.org \
    --cc=john@phrozen.org \
    --cc=jonas.gorski@gmail.com \
    --cc=jverdu@maxlinear.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lxu@maxlinear.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=yweng@maxlinear.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