linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Eggers <ceggers@arri.de>
To: <Tristram.Ha@microchip.com>
Cc: <olteanv@gmail.com>, <kuba@kernel.org>, <andrew@lunn.ch>,
	<richardcochran@gmail.com>, <robh+dt@kernel.org>,
	<vivien.didelot@gmail.com>, <davem@davemloft.net>,
	<kurt.kanzenbach@linutronix.de>, <george.mccollister@gmail.com>,
	<marex@denx.de>, <helmut.grohne@intenta.de>,
	<pbarker@konsulko.com>, <Codrin.Ciubotariu@microchip.com>,
	<Woojung.Huh@microchip.com>, <UNGLinuxDriver@microchip.com>,
	<netdev@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v3 00/12] net: dsa: microchip: PTP support for KSZ956x
Date: Wed, 25 Nov 2020 22:08:39 +0100	[thread overview]
Message-ID: <3569829.EPWo3g8d0Q@n95hx1g2> (raw)
In-Reply-To: <BYAPR11MB35582F880B533EB2EE0CDD1DECE00@BYAPR11MB3558.namprd11.prod.outlook.com>

I need some help from Microchip, please read below.

On Thursday, 19 November 2020, 19:51:15 CET, Tristram.Ha@microchip.com wrote:
> There is one more requirement that is a little difficult to do.  The calculated peer delay
> needs to be programmed in hardware register, but the regular PTP stack has no way to
> send that command.  I think the driver has to do its own calculation by snooping on the
> Pdelay_Req/Pdelay_Resp/Pdelay_Resp_Follow_Up messages.

In an (offline) discussion with Vladimir we discovered, that the KSZ switch
behaves different as ptp4l expects: 

The KSZ switch forwards PTP (e.g. SYNC) messages in hardware (with updating
the correction field). For this, the peer delays need be configured for each
port.

ptp4l in turn expects to do the forwarding in software (for the P2P_TC clock
configuration). For this, no hardware configuration of the peer delay is
necessary. But due to limitations of currently available hardware, this TC
forwarding is currently only supported for 2 step clocks, as a one-step clock
would probably fully replace the originTimestamp field (similar as a BC, but
not as a TC).

Vladimir suggested to configure an ACL in the KSZ switch to block forwarding
of PTP messages between the user ports and to run ptp4l as BC. My idea is to
simply block forwarding of UDP messages with destination ports 319+320 and
L2 messages with the PTP Ether-Type.

I installed the following ACL (for UDP) in the Port ACL Access registers 0-F:
|_0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F
| 00 39 01 40 01 3F 42 22 00 00 00 60 00 00 00 01
ACL index: 0

Match: 
- MD=11 (L4)
- ENB=10 (UDP ports)
- S/D=0 (dst)
- EQ=1 (equal)
- MAX_PORT=320
- MIN_PORT=319
- PC=01 (min or max)
- PRO=17 (UDP, don't care?)
- FME=0 (disabled)

Action:
- PM=0 (disabled)
- P=0 (don't care)
- RPE=0 (disabled)
- RP=0 (don't care)
- MM=11 (replace)
- PORT_FWD_MAP: all ports to 0

Processing entry:
- Ruleset=0x0001
- FRN=0

Unfortunately, with this configuration PTP messages are still forwarded from
port 1 to port 2. Although I was successful in blocking other communication
(e.g. by MAC address), the matching rules above seem not to work. Is there an
error in the ACL, or is forwarding of PTP traffic independent of configured
ACLs?

regards
Christian




  parent reply	other threads:[~2020-11-25 21:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 20:30 [PATCH net-next v3 00/12] net: dsa: microchip: PTP support for KSZ956x Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 01/12] dt-bindings: net: dsa: convert ksz bindings document to yaml Christian Eggers
2020-11-19 13:42   ` Rob Herring
2020-11-19 13:48   ` Rob Herring
2020-11-19 20:22     ` Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 02/12] net: dsa: microchip: support for "ethernet-ports" node Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 03/12] net: dsa: microchip: rename ksz9477.c to ksz9477_main.c Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 04/12] dt-bindings: net: dsa: microchip,ksz: add interrupt property Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 05/12] net: dsa: microchip: ksz9477: move chip reset to ksz9477_switch_init() Christian Eggers
2020-11-20 22:49   ` Vladimir Oltean
2020-11-18 20:30 ` [PATCH net-next v3 06/12] net: dsa: microchip: ksz9477: basic interrupt support Christian Eggers
2020-11-20 23:03   ` Vladimir Oltean
2020-11-18 20:30 ` [PATCH net-next v3 07/12] net: dsa: microchip: ksz9477: add Posix clock support for chip PTP clock Christian Eggers
2020-11-20 23:14   ` Vladimir Oltean
2020-11-18 20:30 ` [PATCH net-next v3 08/12] net: ptp: add helper for one-step P2P clocks Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 09/12] net: dsa: microchip: ksz9477: initial hardware time stamping support Christian Eggers
2020-11-20 23:27   ` Vladimir Oltean
2020-11-18 20:30 ` [PATCH net-next v3 10/12] net: dsa: microchip: ksz9477: remaining " Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 11/12] net: dsa: microchip: ksz9477: add Pulse Per Second (PPS) support Christian Eggers
2020-11-18 20:30 ` [PATCH net-next v3 12/12] net: dsa: microchip: ksz9477: add periodic output support Christian Eggers
2020-11-20 23:48   ` Vladimir Oltean
2020-11-18 23:40 ` [PATCH net-next v3 00/12] net: dsa: microchip: PTP support for KSZ956x Vladimir Oltean
2020-11-19  5:28   ` Christian Eggers
2020-11-19 18:51     ` Tristram.Ha
2020-11-19 20:16       ` Christian Eggers
2020-11-21  1:26       ` Vladimir Oltean
2020-11-22  1:36         ` Richard Cochran
2020-11-22  1:53         ` Richard Cochran
2020-11-25 21:08       ` Christian Eggers [this message]
2020-11-26 16:53         ` Christian Eggers
2020-11-30 21:01           ` Tristram.Ha
2020-11-30 22:28             ` Richard Cochran

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=3569829.EPWo3g8d0Q@n95hx1g2 \
    --to=ceggers@arri.de \
    --cc=Codrin.Ciubotariu@microchip.com \
    --cc=Tristram.Ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=george.mccollister@gmail.com \
    --cc=helmut.grohne@intenta.de \
    --cc=kuba@kernel.org \
    --cc=kurt.kanzenbach@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pbarker@konsulko.com \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@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 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).