All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: DENG Qingfang <dqfext@gmail.com>, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: dsa: tag_rtl4_a: Drop bit 9 from egress frames
Date: Fri, 24 Sep 2021 02:11:45 +0300	[thread overview]
Message-ID: <20210923231145.pmbr6py32owurmic@skbuf> (raw)
In-Reply-To: <CACRpkdYGy+tKUGudFLKL_U6DYpdJLnDxz1gh2gH=drOw9YdB6w@mail.gmail.com>

On Fri, Sep 24, 2021 at 12:58:00AM +0200, Linus Walleij wrote:
> On Fri, Sep 24, 2021 at 12:25 AM Vladimir Oltean <olteanv@gmail.com> wrote:
> > On Fri, Sep 24, 2021 at 12:21:39AM +0200, Linus Walleij wrote:
> > > > > Do we have some use for that feature in DSA taggers?
> > > >
> > > > Yes.
> > >
> > > OK I'll add it to my TODO, right now trying to fix up the base
> > > of the RTL8366RB patch set to handle VLANs the right way.
> >
> > But you didn't ask what that use is...
> 
> Allright spill the beans :D I might not be the most clever at times...

So the essence of the answer is in the discussion we've already had on
your v1 attempt to disable this "unknown" bit:
https://patchwork.kernel.org/project/netdevbpf/patch/20210828235619.249757-1-linus.walleij@linaro.org/

The idea is that bridges should learn only from data plane packets, and
the only chance a DSA tagger has to distinguish between a data and a
control packet sent by the network stack is to look at
skb->offload_fwd_mark, which will be set on xmit by the bridge driver,
if you implement the .port_bridge_tx_fwd_offload and .port_bridge_tx_fwd_unoffload
methods, and declare a non-zero ds->max_num_bridges value (note: the API
for bridge TX forwarding offload in DSA is subject to change/get
simplified during this development cycle). And to offload the replication
for data packets correctly, you should really re-read the discussion we
had about what happens when the egress port mask set by the tagger is all-zeroes.

Not to blow my own horn or anything, but I've repeated this stuff for so many
times now that I wrote it down for future reference, you can find the basic
concepts detailed in chapter "The data plane and the control plane" from the
paper attached here (there are also pictures, not sure how much they help):
https://linuxplumbersconf.org/event/11/contributions/949/

      reply	other threads:[~2021-09-23 23:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 14:31 [PATCH net-next] net: dsa: tag_rtl4_a: Drop bit 9 from egress frames Linus Walleij
2021-09-13 16:05 ` Andrew Lunn
2021-09-13 16:06 ` Florian Fainelli
2021-09-15  3:10 ` patchwork-bot+netdevbpf
2021-09-15  7:19 ` DENG Qingfang
2021-09-23 21:59   ` Linus Walleij
2021-09-23 22:12     ` Vladimir Oltean
2021-09-23 22:21       ` Linus Walleij
2021-09-23 22:25         ` Vladimir Oltean
2021-09-23 22:58           ` Linus Walleij
2021-09-23 23:11             ` Vladimir Oltean [this message]

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=20210923231145.pmbr6py32owurmic@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=netdev@vger.kernel.org \
    --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.