netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: Steen.Hegelund@microchip.com, UNGLinuxDriver@microchip.com,
	daniel.machon@microchip.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, lars.povlsen@microchip.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	olteanv@gmail.com, pabeni@redhat.com, richardcochran@gmail.com
Subject: Re: [PATCH net-next v3 4/4] net: lan966x: Add ptp trap rules
Date: Thu, 08 Dec 2022 14:18:25 +0100	[thread overview]
Message-ID: <adb8e2312b169d13e756ff23c45872c3@walle.cc> (raw)
In-Reply-To: <20221208130444.xshazhpg4e2utvjs@soft-dev3-1>

Hi Horatiu,

Am 2022-12-08 14:04, schrieb Horatiu Vultur:
>> > > Currently lan966x, doesn't allow to run PTP over interfaces that are
>> > > part of the bridge. The reason is when the lan966x was receiving a
>> > > PTP frame (regardless if L2/IPv4/IPv6) the HW it would flood this
>> > > frame.
>> > > Now that it is possible to add VCAP rules to the HW, such to trap
>> > > these
>> > > frames to the CPU, it is possible to run PTP also over interfaces that
>> > > are part of the bridge.
>> >
>> > This gives me:
>> >
>> > # /etc/init.d/S65ptp4l start
>> > Starting linuxptp daemon: OK
>> > [   44.136870] vcap_val_rule:1678: keyset was not updated: -22
>> > [   44.140196] vcap_val_rule:1678: keyset was not updated: -22
>> > #
>> >
>> > # ptp4l -v
>> > 3.1.1
>> > # uname -a
>> > Linux buildroot 6.1.0-rc8-next-20221208+ #924 SMP Thu Dec  8 10:08:58
>> > CET 2022 armv7l GNU/Linux
>> >
>> > I don't know whats going on, but I'm happy to help with debugging with
>> > some
>> > guidance.
>> 
>> Oh, and linuxptp is running on eth0, no bridges are set up. linuxptp
>> is started with "/usr/sbin/ptp4l -f /etc/linuxptp.cfg"
>> 
>> # cat /etc/linuxptp.cfg
>> # LinuxPTP configuration file for synchronizing the system clock to
>> # a remote PTP master in slave-only mode.
>> #
>> # By default synchronize time in slave-only mode using UDP and 
>> hardware
>> time
>> # stamps on eth0. If the difference to master is >1.0 second correct 
>> by
>> # stepping the clock instead of adjusting the frequency.
>> #
>> # If you change the configuration don't forget to update the phc2sys
>> # parameters accordingly in linuxptp-system-clock.service (systemd)
>> # or the linuxptp SysV init script.
>> 
>> [global]
>> slaveOnly               1
>> delay_mechanism         Auto
>> network_transport       UDPv4
>> time_stamping           hardware
>> step_threshold          1.0
>> 
>> [eth0]
> 
> Thanks for trying this!

Actually I was just booting my board which happens to have linuxptp
started by default. And the error messages were new. But I'm not so
sure anymore if PTP was really working. I'm still puzzled by reading
your commit message. Was it already working for interfaces which aren't
part of a bridge and this commit will make it work even for interfaces
which are part of a bridge?

> The issue is because you have not enabled the TCAM lookups per
> port. They can be enabled using this commands:
> 
> tc qdisc add dev eth0 clsact

This gives me the following error, might be a missing kconfig option:

# tc qdisc add dev eth0 clsact
RTNETLINK answers: Operation not supported

> tc filter add dev eth0 ingress prio 5 handle 5 matchall skip_sw action
> goto chain 8000000
> 
> This will enable the lookup and then you should be able to start again
> the ptp4l. Sorry for not mention this, at least I should have written 
> it
> somewhere that this is required.
> 
> I was not sure if lan966x should or not enable tcam lookups
> automatically when a ptp trap action is added. I am open to suggestion
> here.

IMHO, from a user point of view this should just work. For a user
there is no connection between running linuxptp and some filtering
stuff with 'tc'.

Also, if the answer to my question above is yes, and ptp should
have worked on eth0 before, this is a regression then.

-michael

  reply	other threads:[~2022-12-08 13:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03 10:43 [PATCH net-next v3 0/4] net: lan966x: Enable PTP on bridge interfaces Horatiu Vultur
2022-12-03 10:43 ` [PATCH net-next v3 1/4] net: microchip: vcap: Add vcap_get_rule Horatiu Vultur
2022-12-06 12:31   ` Paolo Abeni
2022-12-07  8:30     ` Horatiu Vultur
2022-12-03 10:43 ` [PATCH net-next v3 2/4] net: microchip: vcap: Add vcap_mod_rule Horatiu Vultur
2022-12-03 10:43 ` [PATCH net-next v3 3/4] net: microchip: vcap: Add vcap_rule_get_key_u32 Horatiu Vultur
2022-12-03 10:43 ` [PATCH net-next v3 4/4] net: lan966x: Add ptp trap rules Horatiu Vultur
2022-12-08  9:25   ` Michael Walle
2022-12-08  9:27     ` Michael Walle
2022-12-08 13:04       ` Horatiu Vultur
2022-12-08 13:18         ` Michael Walle [this message]
2022-12-09  9:29           ` Horatiu Vultur
2022-12-09 12:10             ` Michael Walle
2022-12-09 12:58               ` Horatiu Vultur
2022-12-09 12:56                 ` Vladimir Oltean
2022-12-09 14:05                   ` Michael Walle
2022-12-09 14:14                     ` Vladimir Oltean
2022-12-09 14:20                     ` Horatiu Vultur
2022-12-09 14:23                       ` Michael Walle
2022-12-09 14:54                         ` Horatiu Vultur
2022-12-09 14:43                       ` Vladimir Oltean
2022-12-09 14:47                         ` Vladimir Oltean
2022-12-09 14:57                         ` Horatiu Vultur
2022-12-09 14:56                           ` Vladimir Oltean
2022-12-09 15:30                             ` Horatiu Vultur
2022-12-09 15:27                               ` Vladimir Oltean
2022-12-09 23:03                                 ` Jakub Kicinski
2022-12-12 14:27                                   ` Horatiu Vultur
2022-12-12 14:20                                 ` Horatiu Vultur
2023-01-05 15:09             ` Michael Walle
2023-01-05 21:55               ` Horatiu Vultur
2022-12-06 12:40 ` [PATCH net-next v3 0/4] net: lan966x: Enable PTP on bridge interfaces patchwork-bot+netdevbpf

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=adb8e2312b169d13e756ff23c45872c3@walle.cc \
    --to=michael@walle.cc \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=daniel.machon@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@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).