All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH RFC net-next] net: phy: add Marvell PHY PTP support [multicast/DSA issues]
Date: Thu, 30 Jul 2020 12:54:19 +0100	[thread overview]
Message-ID: <20200730115419.GX1605@shell.armlinux.org.uk> (raw)
In-Reply-To: <20200730110613.GC1551@shell.armlinux.org.uk>

On Thu, Jul 30, 2020 at 12:06:13PM +0100, Russell King - ARM Linux admin wrote:
> On Wed, Jul 29, 2020 at 06:19:32AM -0700, Richard Cochran wrote:
> > On Wed, Jul 29, 2020 at 11:58:07AM +0100, Russell King - ARM Linux admin wrote:
> > > How do we deal with this situation - from what I can see from the
> > > ethtool API, we have to make a choice about which to use.  How do we
> > > make that choice?
> > 
> > Unfortunately the stack does not implement simultaneous MAC + PHY time
> > stamping.  If your board has both, then you make the choice to use the
> > PHY by selecting NETWORK_PHY_TIMESTAMPING at kernel compile time.
> > 
> > (Also some MAC drivers do not defer to the PHY properly.  Sometimes
> > you can work around that by de-selecting the MAC's PTP function in the
> > Kconfig if possible, but otherwise you need to patch the MAC driver.)
> >  
> > > Do we need a property to indicate whether we wish to use the PHY
> > > or MAC PTP stamping, or something more elaborate?
> > 
> > To do this at run time would require quite some work, I expect.
> 
> Okay, I'm falling into horrible multicast issues with DSA switches
> while trying to test.
> 
> Some of my platforms have IP_MULTICAST=y, others have IP_MULTICAST=n.
> This causes some to send IGMP messages when binding to the multicast
> address, others do not.
> 
> Those that do cause the DSA switch to add a static database entry
> causing all traffic for that multicast address to be only directed to
> the port(s) that the machine(s) with IP_MULTICAST=y kernels are
> connected to, depriving all IP_MULTICAST=n machines from seeing those
> packets.
> 
> Maybe, with modern networking technology, it's about time that the
> kernel configuration help recommended that kernels should be built
> with IP_MULTICAST=y ?

Hmm, and even with IP_MULTICAST=y, I still can't get the "timestamping"
program from the kernel sources to work.

On two different machines, I'm running:

# ./timestamping32 eno0 SOF_TIMESTAMPING_RX_HARDWARE SOF_TIMESTAMPING_RAW_HARDWARE

On one machine (arm32) this works - it can see the traffic it generates
and receives from the other machine.

On the other machine (arm64), it sees _no_ traffic at all, but tcpdump
on that machine can see the traffic being received:

12:36:40.002065 00:51:82:11:33:03 > 01:00:5e:00:01:82, ethertype IPv4 (0x0800),
length 166: (tos 0x0, ttl 1, id 15045, offset 0, flags [DF], proto UDP (17), length 152)
    192.168.3.1.319 > 224.0.1.130.319: [bad udp cksum 0xa5c1 -> 0x7aaa!] UDP, length 124
12:36:41.105391 00:50:43:02:03:02 > 01:00:5e:00:01:82, ethertype IPv4 (0x0800),
length 166: (tos 0x0, ttl 1, id 9715, offset 0, flags [DF], proto UDP (17), length 152)
    192.168.3.2.319 > 224.0.1.130.319: [udp sum ok] UDP, length 124

The bad udp cksum is due to checksum offloadong on transmit - 3.1 is the
arm64 host running that tcpdump.

When I look at /proc/net/snmp, I can see the IP InReceives incrementing
but not the IP InDelivers nor UDP InDatagrams counter:

Ip: 2 64 1602 0 3 0 0 0 297 531 0 46 0 0 0 0 0 0 0
Udp: 572 0 0 480 0 0 0 4
Ip: 2 64 1603 0 3 0 0 0 297 531 0 46 0 0 0 0 0 0 0
Udp: 572 0 0 480 0 0 0 4

I don't have any firewall rules on the machine.

I've checked rp_filter on the appropriate interfaces... it's disabled
on the ARM64 machine.  The only other difference in interface config
is accept_source_route, which is enabled on the ARM64 machine.

So, something in the IPv4 layer on ARM64 is silently discarding
multicast UDP PTP packets, and I've no idea what... and I'm coming to
the conclusion that this is all way too much effort and way too
unreliable to be worth spending any more time trying to make work.

I'll send out what I have in the hope that maybe someone will find it
useful and maybe able to complete the work.  However, with these
problems, it is totally unusable for me, and hence I can't test it.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2020-07-30 11:54 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 16:26 [PATCH RFC net-next] net: phy: add Marvell PHY PTP support Russell King
2020-07-15 18:38 ` Andrew Lunn
2020-07-15 18:56   ` Russell King - ARM Linux admin
2020-07-16 11:33     ` Russell King - ARM Linux admin
2020-07-16 20:53       ` Richard Cochran
2020-07-16 20:48 ` Richard Cochran
2020-07-17  7:54   ` Kurt Kanzenbach
2020-07-18  2:24     ` Richard Cochran
2020-07-20 14:21       ` Richard Cochran
2020-07-20 14:37         ` Kurt Kanzenbach
2020-07-26 23:48 ` Russell King - ARM Linux admin
2020-07-29 10:58 ` Russell King - ARM Linux admin
2020-07-29 13:19   ` Richard Cochran
2020-07-29 13:28     ` Russell King - ARM Linux admin
2020-07-29 22:07       ` Russell King - ARM Linux admin
2020-07-29 22:53         ` Vladimir Oltean
2020-07-30 15:53         ` Richard Cochran
2020-07-30 18:38           ` Russell King - ARM Linux admin
2020-07-30 19:32             ` Richard Cochran
2020-07-30 19:44               ` Russell King - ARM Linux admin
2020-07-30 11:06     ` [PATCH RFC net-next] net: phy: add Marvell PHY PTP support [multicast/DSA issues] Russell King - ARM Linux admin
2020-07-30 11:54       ` Russell King - ARM Linux admin [this message]
2020-07-30 12:47         ` Russell King - ARM Linux admin
2023-02-27 14:40           ` Köry Maincent
2023-02-27 15:20             ` Russell King (Oracle)
2023-02-27 17:30               ` Köry Maincent
2023-02-27 17:42                 ` Russell King (Oracle)
2023-02-27 19:45               ` Richard Cochran
2023-02-27 20:09                 ` Russell King (Oracle)
2023-02-27 20:19                   ` Richard Cochran
2023-02-28 12:07                     ` Russell King (Oracle)
2023-02-28 13:16                       ` Köry Maincent
2023-02-28 13:36                         ` Russell King (Oracle)
2023-02-28 14:50                           ` Köry Maincent
2023-02-28 15:16                         ` Richard Cochran
2023-02-28 15:33                           ` Andrew Lunn
2023-02-28 21:13                             ` Richard Cochran
2023-02-28 16:27                           ` Russell King (Oracle)
2023-02-28 16:44                             ` Michael Walle
2023-02-28 16:58                               ` Russell King (Oracle)
2023-02-28 20:13                                 ` Michael Walle
2023-02-28 21:11                                   ` Richard Cochran
2023-02-28 21:24                             ` Richard Cochran
2023-02-28 22:26                             ` Jakub Kicinski
2023-02-28 22:40                               ` Russell King (Oracle)
2023-02-28 22:59                                 ` Jakub Kicinski
2023-03-01 16:04                                   ` Köry Maincent
2023-03-02  4:36                                     ` Richard Cochran
2023-03-02 11:49                                       ` Russell King (Oracle)
2023-03-02 16:49                                         ` Jakub Kicinski
2023-03-02 17:06                                           ` Köry Maincent
2023-03-02 17:23                                             ` Jakub Kicinski
2023-03-03 13:12                                               ` Köry Maincent
2023-03-03 23:28                                                 ` Jakub Kicinski
2023-03-02 17:26                                           ` Russell King (Oracle)
2023-03-03 10:20                                             ` Michael Walle
2023-03-03 13:20                                               ` Andrew Lunn
2023-03-03 13:34                                                 ` Köry Maincent
2023-03-03 13:59                                                   ` Andrew Lunn
2023-03-03 14:03                                                 ` Russell King (Oracle)
2023-03-03 16:34                                                   ` Andrew Lunn
2023-03-03 17:32                                                     ` Richard Cochran
2023-03-03 17:35                                                       ` Richard Cochran
2023-03-03 23:40                                                   ` Jakub Kicinski
2023-03-02 21:28                                           ` Richard Cochran
2023-03-02 21:19                                         ` Richard Cochran
2023-04-27 15:13               ` Köry Maincent
2023-04-27 16:50                 ` Andrew Lunn
2023-04-28  8:51                   ` Köry Maincent
2020-07-30 15:50         ` Richard Cochran
2020-07-31 14:41         ` Andrew Lunn
2023-03-02 10:37   ` [PATCH RFC net-next] net: phy: add Marvell PHY PTP support Köry Maincent
2023-03-02 17:38     ` Russell King (Oracle)
2023-03-02 21:35     ` 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=20200730115419.GX1605@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.