netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matej Zachar <zachar.matej@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org
Subject: Re: [DSA] fallback PTP to master port when switch does not support it
Date: Tue, 5 Apr 2022 16:21:47 +0200	[thread overview]
Message-ID: <AC44DB40-88EB-4613-ABEA-FA8C1062EA3A@gmail.com> (raw)
In-Reply-To: <YktrbtbSr77bDckl@lunn.ch>

Hi Andrew,
thank you for the quick response.

> On 5. 4. 2022, at 0:04, Andrew Lunn <andrew@lunn.ch> wrote:
> 
> 
> Did you try just running PTP on the master device? I'm wondering if
> the DSA headers get in the way?

Yes this is exactly the problem as the master device is used as “conduit interface”
so the switch is dropping the frames as there are no correct DSA headers present.

So running ptp4l on eth0 (master) interface configures the hardware time-stamping correctly but no traffic is received.
running it on lan1 (slave) interface you get the packets but no hardware time-stamping support.

I though this should be in a way similar to the case when you run ptp4l over vlan interfaces (without dsa switch) - it fallbacks to the master port.

> 
> What i don't like about your proposed fallback is that it gives the
> impression the slave ports actually support PTP, when they do not. And
> maybe you want to run different ports in different modes, one upstream
> towards a grand master and one downstream? I suspect the errors you
> get are not obvious. Where as if you just run PTP on the master, the
> errors would be more obvious.
> 

I’m using switch ports in “single port” configuration so there is lan1 lan2 interfaces connected to different network segments.
So it can behave as you described in upstream/downstream configuration as “boundary” PTP clock or as a redundancy where
lan1 & lan2 are connected to physically separate networks - including switches and cables. 

> 
> And this is another advantage of just using master directly. You can
> even use master when the switch ports do support PTP.

I do not see how is that possible as the DSA headers are in the way and packets get dropped by the switch but maybe I am missing something.

My second idea was to check the return values and fallback based on that so the switch driver could still implement
.get_ts_info and .port_hwtstamp_get/set from dsa_switch_ops struct. This was just quick proof to test if it would work over slave interface.

If there is better approach I could explore I’m happy to try.

Matej.


  reply	other threads:[~2022-04-05 20:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04 19:28 [DSA] fallback PTP to master port when switch does not support it Matej Zachar
2022-04-04 22:04 ` Andrew Lunn
2022-04-05 14:21   ` Matej Zachar [this message]
2022-04-05 19:48   ` Jakub Kicinski
2022-04-07  9:44     ` Vladimir Oltean
2022-05-25 15:00       ` Rodolfo Giometti
2022-05-25 15:55         ` Vladimir Oltean
2022-05-26  7:45           ` Rodolfo Giometti
2022-05-26 12:31             ` Vladimir Oltean
2022-05-25 18:18         ` Andrew Lunn

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=AC44DB40-88EB-4613-ABEA-FA8C1062EA3A@gmail.com \
    --to=zachar.matej@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=netdev@vger.kernel.org \
    /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).