From: Vladimir Oltean <olteanv@gmail.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
Tobias Waldekranz <tobias@waldekranz.com>,
Kurt Kanzenbach <kurt@kmk-computers.de>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v1] net: dsa: mv88e6xxx: Trap PTP traffic
Date: Mon, 13 Dec 2021 20:58:35 +0200 [thread overview]
Message-ID: <20211213185835.ltvv5qz7pincloyj@skbuf> (raw)
In-Reply-To: <20211213171140.GB14706@hoboy.vegasvil.org>
On Mon, Dec 13, 2021 at 09:11:40AM -0800, Richard Cochran wrote:
> On Mon, Dec 13, 2021 at 02:31:47PM +0200, Vladimir Oltean wrote:
>
> > With other drivers, all packets injected from the CPU port act as if in
> > "god mode", bypassing any STP state. It then becomes the responsibility
> > of the software to not send packets on a port that is blocking,
> > except for packets for control protocols. Would you agree that ptp4l
> > should consider monitoring whether its ports are under a bridge, and
> > what STP state that bridge port is in?
>
> Perhaps. linuxptp TC mode will forward frames out all configured
> interfaces. If the bridge can't drop the PTP frames automatically,
> then this could cause loops.
Considering that in this configuration:
ip link add br0 type bridge
ip link set swp0 master br0
ip link set swp1 master br0
ip link set swp2 master br0
ip link set swp3 master br0
ptp4l -i swp0 -i swp1 -i swp2 -i swp3 -f configs/P2P-TC.cfg -m
the kernel code path for PTP packets has nothing to do with the bridge
driver (unless maybe an explicit netfilter rule to tell the bridge RX
handler to not steal those packets from the physical port), I think it's
safe to say that yes, the bridge can't drop the PTP frames automatically.
> So if switch HW in general won't drop them, then, yes, the TC user
> space stack will need to follow the STP state.
The hardware offloads tend to follow the software model as closely as
possible, and as mentioned, I think this has to do with the software
model in this case, rather than a hardware quirk. I would consider the
hardware to be quirky quite in the opposite case: you send a packet
through a physical port rather than the bridge, and that one is affected
by the STP state. We have switch drivers like that too, but let's not go
there, they're rather the exception.
> > I think this isn't even specific
> > to DSA, the same thing would happen with software bridging:
>
> (Linux doesn't support even SW time stamping on SW bridges, so you
> can't have a TC running in this case.)
As also rephrased in the replies above, the point was that STP state has
nothing to do, in general, with whether this is a DSA switch or not.
It is a bridging service concept, and applies to data plane packets,
which ptp4l isn't sending/receiving, since as you very well point out,
your socket is opened on the physical port and not on the bridge device.
So don't expect the STP state of the port to do something here. If you
send a packet on a socket opened on an interface that is backed by a
physical port, expect that packet to be sent - is the main point.
The fact that I used the "software bridging" term was just to clarify
that it hasn't got anything to do with whether the bridging is offloaded
or not.
next prev parent reply other threads:[~2021-12-13 18:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-09 17:33 [PATCH net-next v1] net: dsa: mv88e6xxx: Trap PTP traffic Kurt Kanzenbach
2021-12-10 0:07 ` Tobias Waldekranz
2021-12-10 17:39 ` Kurt Kanzenbach
2021-12-11 23:02 ` Tobias Waldekranz
2021-12-13 18:54 ` Kurt Kanzenbach
2021-12-11 5:14 ` Jakub Kicinski
2021-12-11 15:39 ` Richard Cochran
2021-12-12 15:16 ` Kurt Kanzenbach
2021-12-13 12:10 ` Richard Cochran
2021-12-13 12:31 ` Vladimir Oltean
2021-12-13 15:27 ` Andrew Lunn
2021-12-13 17:11 ` Richard Cochran
2021-12-13 18:58 ` Vladimir Oltean [this message]
2021-12-13 16:44 ` Jakub Kicinski
2021-12-13 17:04 ` Richard Cochran
2021-12-13 18:40 ` Kurt Kanzenbach
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=20211213185835.ltvv5qz7pincloyj@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=kurt@kmk-computers.de \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--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