mbox series

[net-next,v3,0/3] sfc: add support for PTP over IPv6 and 802.3

Message ID 20220825090242.12848-1-ihuguet@redhat.com (mailing list archive)
Headers show
Series sfc: add support for PTP over IPv6 and 802.3 | expand

Message

Íñigo Huguet Aug. 25, 2022, 9:02 a.m. UTC
Most recent cards (8000 series and newer) had enough hardware support
for this, but it was not enabled in the driver. The transmission of PTP
packets over these protocols was already added in commit bd4a2697e5e2
("sfc: use hardware tx timestamps for more than PTP"), but receiving
them was already unsupported so synchronization didn't happen.

These patches add support for timestamping received packets over
IPv6/UPD and IEEE802.3.

v2: fixed weird indentation in efx_ptp_init_filter
v3: fixed bug caused by usage of htons in PTP_EVENT_PORT definition.
    It was used in more places, where htons was used too, so using it
    2 times leave it again in host order. I didn't detected it in my
    tests because it only affected if timestamping through the MC, but
    the model I used do it through the MAC. Detected by kernel test
    robot <lkp@intel.com>

Íñigo Huguet (3):
  sfc: allow more flexible way of adding filters for PTP
  sfc: support PTP over IPv6/UDP
  sfc: support PTP over Ethernet

 drivers/net/ethernet/sfc/filter.h |  22 +++++
 drivers/net/ethernet/sfc/ptp.c    | 131 ++++++++++++++++++++----------
 2 files changed, 111 insertions(+), 42 deletions(-)

Comments

Andrew Lunn Aug. 25, 2022, 4:16 p.m. UTC | #1
On Thu, Aug 25, 2022 at 11:02:39AM +0200, Íñigo Huguet wrote:
> Most recent cards (8000 series and newer) had enough hardware support
> for this, but it was not enabled in the driver. The transmission of PTP
> packets over these protocols was already added in commit bd4a2697e5e2
> ("sfc: use hardware tx timestamps for more than PTP"), but receiving
> them was already unsupported so synchronization didn't happen.

You don't appear to Cc: the PTP maintainer.

    Andrew
Íñigo Huguet Aug. 26, 2022, 6:58 a.m. UTC | #2
On Thu, Aug 25, 2022 at 6:17 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Thu, Aug 25, 2022 at 11:02:39AM +0200, Íñigo Huguet wrote:
> > Most recent cards (8000 series and newer) had enough hardware support
> > for this, but it was not enabled in the driver. The transmission of PTP
> > packets over these protocols was already added in commit bd4a2697e5e2
> > ("sfc: use hardware tx timestamps for more than PTP"), but receiving
> > them was already unsupported so synchronization didn't happen.
>
> You don't appear to Cc: the PTP maintainer.
>
>     Andrew
>

I didn't think about that, but looking at MAINTAINERS, there doesn't
seem to be any. There are 2 maintainers for the drivers of the clock
devices, but none for anything related to the network protocol...
Andrew Lunn Aug. 26, 2022, 12:52 p.m. UTC | #3
On Fri, Aug 26, 2022 at 08:58:31AM +0200, Íñigo Huguet wrote:
> On Thu, Aug 25, 2022 at 6:17 PM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > On Thu, Aug 25, 2022 at 11:02:39AM +0200, Íñigo Huguet wrote:
> > > Most recent cards (8000 series and newer) had enough hardware support
> > > for this, but it was not enabled in the driver. The transmission of PTP
> > > packets over these protocols was already added in commit bd4a2697e5e2
> > > ("sfc: use hardware tx timestamps for more than PTP"), but receiving
> > > them was already unsupported so synchronization didn't happen.
> >
> > You don't appear to Cc: the PTP maintainer.
> >
> >     Andrew
> >
> 
> I didn't think about that, but looking at MAINTAINERS, there doesn't
> seem to be any. There are 2 maintainers for the drivers of the clock
> devices, but none for anything related to the network protocol...

PTP HARDWARE CLOCK SUPPORT
M:      Richard Cochran <richardcochran@gmail.com>
L:      netdev@vger.kernel.org
S:      Maintained
W:      http://linuxptp.sourceforge.net/
F:      Documentation/ABI/testing/sysfs-ptp
F:      Documentation/driver-api/ptp.rst
F:      drivers/net/phy/dp83640*
F:      drivers/ptp/*
F:      include/linux/ptp_cl*

I assume you are using linuxptp with this?

  Andrew
Íñigo Huguet Aug. 29, 2022, 7:09 a.m. UTC | #4
On Fri, Aug 26, 2022 at 2:52 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Fri, Aug 26, 2022 at 08:58:31AM +0200, Íñigo Huguet wrote:
> > On Thu, Aug 25, 2022 at 6:17 PM Andrew Lunn <andrew@lunn.ch> wrote:
> > >
> > > On Thu, Aug 25, 2022 at 11:02:39AM +0200, Íñigo Huguet wrote:
> > > > Most recent cards (8000 series and newer) had enough hardware support
> > > > for this, but it was not enabled in the driver. The transmission of PTP
> > > > packets over these protocols was already added in commit bd4a2697e5e2
> > > > ("sfc: use hardware tx timestamps for more than PTP"), but receiving
> > > > them was already unsupported so synchronization didn't happen.
> > >
> > > You don't appear to Cc: the PTP maintainer.
> > >
> > >     Andrew
> > >
> >
> > I didn't think about that, but looking at MAINTAINERS, there doesn't
> > seem to be any. There are 2 maintainers for the drivers of the clock
> > devices, but none for anything related to the network protocol...
>
> PTP HARDWARE CLOCK SUPPORT
> M:      Richard Cochran <richardcochran@gmail.com>
> L:      netdev@vger.kernel.org
> S:      Maintained
> W:      http://linuxptp.sourceforge.net/
> F:      Documentation/ABI/testing/sysfs-ptp
> F:      Documentation/driver-api/ptp.rst
> F:      drivers/net/phy/dp83640*
> F:      drivers/ptp/*
> F:      include/linux/ptp_cl*
>
> I assume you are using linuxptp with this?
>
>   Andrew
>

I'm still not sure if this falls under his responsibility because it
doesn't affect the part of the clock device, but in any case it
doesn't hurt to CC him as you suggest. Thanks!

Richard, missed to CC you in this patch series, just in case it's of
your interest.
Richard Cochran Aug. 29, 2022, 2:38 p.m. UTC | #5
On Mon, Aug 29, 2022 at 09:09:48AM +0200, Íñigo Huguet wrote:
> Richard, missed to CC you in this patch series, just in case it's of
> your interest.

I do appreciate being on CC for anything PTP related.

Thanks,

Richard
Andrew Lunn Aug. 29, 2022, 4:15 p.m. UTC | #6
On Mon, Aug 29, 2022 at 07:38:36AM -0700, Richard Cochran wrote:
> On Mon, Aug 29, 2022 at 09:09:48AM +0200, Íñigo Huguet wrote:
> > Richard, missed to CC you in this patch series, just in case it's of
> > your interest.
> 
> I do appreciate being on CC for anything PTP related.

Russell King had the issue he was being missed on a lot of PHYLINK
patches. He updated the MAINTAINERS entry with:

K:	phylink\.h|struct\s+phylink|\.phylink|>phylink_|phylink_(autoneg|clear|connect|create|destroy|disconnect|ethtool|helper|mac|mii|of|set|start|stop|test|validate)

Maybe you could add some sort of regex for common ptp functions and structures?

      Andrew
Jakub Kicinski Aug. 30, 2022, 12:30 a.m. UTC | #7
On Mon, 29 Aug 2022 18:15:16 +0200 Andrew Lunn wrote:
> On Mon, Aug 29, 2022 at 07:38:36AM -0700, Richard Cochran wrote:
> > On Mon, Aug 29, 2022 at 09:09:48AM +0200, Íñigo Huguet wrote:  
> > > Richard, missed to CC you in this patch series, just in case it's of
> > > your interest.  
> > 
> > I do appreciate being on CC for anything PTP related.  
> 
> Russell King had the issue he was being missed on a lot of PHYLINK
> patches. He updated the MAINTAINERS entry with:
> 
> K:	phylink\.h|struct\s+phylink|\.phylink|>phylink_|phylink_(autoneg|clear|connect|create|destroy|disconnect|ethtool|helper|mac|mii|of|set|start|stop|test|validate)
> 
> Maybe you could add some sort of regex for common ptp functions and structures?

+1