netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Tobias Waldekranz <tobias@waldekranz.com>
Cc: davem@davemloft.net, kuba@kernel.org, andrew@lunn.ch,
	vivien.didelot@gmail.com, f.fainelli@gmail.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: mv88e6xxx: Allow dynamic reconfiguration of tag protocol
Date: Wed, 24 Mar 2021 17:08:07 +0200	[thread overview]
Message-ID: <20210324150807.f2amekt2jdcvqhhl@skbuf> (raw)
In-Reply-To: <87pmzolhlv.fsf@waldekranz.com>

On Wed, Mar 24, 2021 at 04:02:52PM +0100, Tobias Waldekranz wrote:
> On Wed, Mar 24, 2021 at 16:03, Vladimir Oltean <olteanv@gmail.com> wrote:
> > On Tue, Mar 23, 2021 at 10:17:30PM +0100, Tobias Waldekranz wrote:
> >> > I don't see any place in the network stack that recalculates the FCS if
> >> > NETIF_F_RXALL is set. Additionally, without NETIF_F_RXFCS, I don't even
> >> > know how could the stack even tell a packet with bad FCS apart from one
> >> > with good FCS. If NETIF_F_RXALL is set, then once a packet is received,
> >> > it's taken for granted as good.
> >> 
> >> Right, but there is a difference between a user explicitly enabling it
> >> on a device and us enabling it because we need it internally in the
> >> kernel.
> >> 
> >> In the first scenario, the user can hardly complain as they have
> >> explicitly requested to see all packets on that device. That would not
> >> be true in the second one because there would be no way for the user to
> >> turn it off. It feels like you would end up in a similar situation as
> >> with the user- vs. kernel- promiscuous setting.
> >> 
> >> It seems to me if we enable it, we are responsible for not letting crap
> >> through to the port netdevs.
> >
> > I think there exists an intermediate approach between processing the
> > frames on the RX queue and installing a soft parser.
> >
> > The BMI of FMan RX ports has a configurable pipeline through Next
> > Invoked Actions (NIA). Through the FMBM_RFNE register (Rx Frame Next
> > Engine), it is possible to change the Next Invoked Action from the
> > default value (which is the hardware parser). You can choose to make the
> > Buffer Manager Interface enqueue the packet directly to the Queue
> > Manager Interface (QMI). This will effectively bypass the hardware
> > parser, so DSA frames will never be sent to the error queue if they have
> > an invalid EtherType/Length field.
> >
> > Additionally, frames with a bad FCS should still be discarded, as that
> > is done by the MAC (an earlier stage compared to the BMI).
> 
> Yeah this sounds like the perfect middle ground. I guess that would then
> be activated with an `if (netdev_uses_dsa(dev))`-guard in the driver,
> like how Florian solved it for stmmac? Since it is not quite "rx-all".

I think this would have to be guarded by netdev_uses_dsa for now, yes.
Also, it is far from being a "perfect" middle ground, because if you
disable the hardware parser, you also lose the ability to do frame
classification and hashing/flow steering to multiple RX queues on that
port, I think.

  reply	other threads:[~2021-03-24 15:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 10:23 [PATCH net-next] net: dsa: mv88e6xxx: Allow dynamic reconfiguration of tag protocol Tobias Waldekranz
2021-03-23 11:35 ` Vladimir Oltean
2021-03-23 12:32   ` Andrew Lunn
2021-03-23 14:48   ` Tobias Waldekranz
2021-03-23 16:30     ` Florian Fainelli
2021-03-23 19:03     ` Vladimir Oltean
2021-03-23 21:17       ` Tobias Waldekranz
2021-03-23 23:15         ` Vladimir Oltean
2021-03-24 10:52           ` Tobias Waldekranz
2021-03-24 11:34             ` Vladimir Oltean
2021-03-24 13:01               ` Tobias Waldekranz
2021-03-24 13:24                 ` Vladimir Oltean
2021-03-24 14:03         ` Vladimir Oltean
2021-03-24 14:10           ` Vladimir Oltean
2021-03-24 15:02           ` Tobias Waldekranz
2021-03-24 15:08             ` Vladimir Oltean [this message]
2021-03-24 16:07               ` Tobias Waldekranz
2021-03-25  1:34                 ` Vladimir Oltean
2021-03-25  8:04                   ` Tobias Waldekranz
2021-03-23 12:41 ` Andrew Lunn
2021-03-23 14:49   ` Tobias Waldekranz
2021-03-23 16:53     ` Florian Fainelli
2021-03-23 20:50       ` Tobias Waldekranz
2021-03-24  0:44     ` Andrew Lunn
2021-03-24 12:53       ` Tobias Waldekranz

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=20210324150807.f2amekt2jdcvqhhl@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tobias@waldekranz.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).