lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 31 May 2019 18:23:34 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Richard Cochran <richardcochran@...il.com>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        "David S. Miller" <davem@...emloft.net>,
        John Stultz <john.stultz@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Stephen Boyd <sboyd@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 0/5] PTP support for the SJA1105 DSA driver

On Fri, 31 May 2019 at 18:11, Richard Cochran <richardcochran@...il.com> wrote:
>
> On Fri, May 31, 2019 at 05:27:15PM +0300, Vladimir Oltean wrote:
> > On Fri, 31 May 2019 at 17:08, Richard Cochran <richardcochran@...il.com> wrote:
> > > This can be done simply using a data structure in the driver with an
> > > appropriate locking mechanism.  Then you don't have to worry which
> > > core the driver code runs on.
> > >
> >
> > Actually you do. DSA is special because it is not the first net device
> > in the RX path that processes the frames. Something needs to be done
> > on the master port.
>
> Before you said,
>
>         the switch in its great wisdom mangles bytes 01-1B-19-xx-xx-00
>         of the DMAC to place the switch id and source port there (a
>         rudimentary tagging mechanism).
>
> So why not simply save each frame in a per-switch/port data structure?
>

You mean to queue it and subvert DSA's own RX timestamping callback?
Why would I do that? Just so as not to introduce my .can_timestamp
callback?

> Now I'm starting to understand your series.  I think it can be done in
> simpler way...
>
> sja1105_rcv_meta_state_machine - can and should be at the driver level
> and not at the port level.
>

Can: yes. Should: why?

> sja1105_port_rxtstamp_work - isn't needed at all.
>
> How about this?
>
> 1. When the driver receives a deferred PTP frame, save it into a
>    per-switch,port slot at the driver (not port) level.
>
> 2. When the driver receives a META frame, match it to the
>    per-switch,port slot.  If there is a PTP frame in that slot, then
>    deliver it with the time stamp from the META frame.
>

One important aspect makes this need be a little bit more complicated:
reconstructing these RX timestamps.
You see, there is a mutex on the SPI bus, so in practice I do need the
sja1105_port_rxtstamp_work for exactly this purpose - to read the
timestamping clock over SPI.

> Thanks,
> Richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ