Skip to contentSkip to conversation

Remove unneeded PHY time stamping option.

PATCH NAK Richard Cochran 4 participants 15 messages Jan 21, 2021 – Jan 23, 2021

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover Remove unneeded PHY time stamping option.

The NETWORK_PHY_TIMESTAMPING configuration option adds additional checks into the networking hot path, and it is only needed by two rather esoteric devices, namely the TI DP83640 PHYTER and the ZHAW InES 1588 IP core. Very few end users have these devices, and those that do have them are building specialized embedded systems.

Unfortunately two unrelated drivers depend on this option, and two defconfigs enable it. It is probably my fault for not paying enough attention in reviews.

This series corrects the gratuitous use of NETWORK_PHY_TIMESTAMPING.

Richard Cochran (4):
net: dsa: mv88e6xxx: Remove bogus Kconfig dependency.
net: mvpp2: Remove unneeded Kconfig dependency.
ARM: socfpga_defconfig: Disable PHY time stamping by default.
ARM: axm55xx_defconfig: Disable PHY time stamping by default.

 arch/arm/configs/axm55xx_defconfig   | 1 -
 arch/arm/configs/socfpga_defconfig   | 6 +-----
 drivers/net/dsa/mv88e6xxx/Kconfig    | 1 -
 drivers/net/ethernet/marvell/Kconfig | 1 -
 4 files changed, 1 insertion(+), 8 deletions(-)
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw

PATCH 2/4 net: mvpp2: Remove unneeded Kconfig dependency.

The mvpp2 is an Ethernet driver, and it implements MAC style time stamping of PTP frames. It has no need of the expensive option to enable PHY time stamping. Remove the incorrect dependency.

Fixes 91dd71950bd7 ("net: mvpp2: ptp: add TAI support")
---
 drivers/net/ethernet/marvell/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/marvell/Kconfig +0 -1
index 41815b609569..7fe15a3286f4 100644
@@ -94,7 +94,6 @@ config MVPP2
 
 config MVPP2_PTP
 	bool "Marvell Armada 8K Enable PTP support"
-	depends on NETWORK_PHY_TIMESTAMPING
 	depends on (PTP_1588_CLOCK = y && MVPP2 = y) || \
 		   (PTP_1588_CLOCK && MVPP2 = m)
 
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

PATCH 1/4 net: dsa: mv88e6xxx: Remove bogus Kconfig dependency.

In reply to Richard Cochran

The mv88e6xxx is a DSA driver, and it implements DSA style time stamping of PTP frames. It has no need of the expensive option to enable PHY time stamping. Remove the bogus dependency.

Fixes 2fa8d3af4bad ("net: dsa: mv88e6xxx: expose switch time as a PTP hardware clock")
---
 drivers/net/dsa/mv88e6xxx/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/net/dsa/mv88e6xxx/Kconfig +0 -1
index 51185e4d7d15..b17540926c11 100644
@@ -25,7 +25,6 @@ config NET_DSA_MV88E6XXX_PTP
 	default n
 	depends on NET_DSA_MV88E6XXX_GLOBAL2
 	depends on PTP_1588_CLOCK
-	imply NETWORK_PHY_TIMESTAMPING
 	help
 	  Say Y to enable PTP hardware timestamping on Marvell 88E6xxx switch
 	  chips that support it.
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#13 lore raw

PATCH 4/4 ARM: axm55xx_defconfig: Disable PHY time stamping by default.

In reply to Richard Cochran

The NETWORK_PHY_TIMESTAMPING configuration option adds overhead into the networking stack. When enabled, all transmitted and received frames are subjected to extra tests to determine whether they just might be PTP frames to be presented to esoteric PHY time stamping drivers.

However, no System on Chip, least ways not the axm55xx SoC, includes such a PHY time stamping device. Disable the unneeded option by default.

---
 arch/arm/configs/axm55xx_defconfig | 1 -
 1 file changed, 1 deletion(-)
arch/arm/configs/axm55xx_defconfig +0 -1
index 46075216ee6d..2d1a45066649 100644
@@ -73,7 +73,6 @@ CONFIG_INET_AH=y
 CONFIG_INET_ESP=y
 CONFIG_INET_IPCOMP=y
 # CONFIG_IPV6 is not set
-CONFIG_NETWORK_PHY_TIMESTAMPING=y
 CONFIG_BRIDGE=y
 # CONFIG_WIRELESS is not set
 CONFIG_DEVTMPFS=y
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#12 lore raw

PATCH 3/4 ARM: socfpga_defconfig: Disable PHY time stamping by default.

In reply to Richard Cochran

The NETWORK_PHY_TIMESTAMPING configuration option adds overhead into the networking stack. When enabled, all transmitted and received frames are subjected to extra tests to determine whether they just might be PTP frames to be presented to esoteric PHY time stamping drivers.

However, no System on Chip, least ways not the socfpga SoC, includes such a PHY time stamping device. Disable the unneeded option by default.

The diff includes a bit of extra churn caused by "make savedefconfig", but the generated defconfig is now in the canonical form.

---
 arch/arm/configs/socfpga_defconfig | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/arm/configs/socfpga_defconfig +1 -5
index e73c97b0f5b0..5bd433028285 100644
@@ -14,8 +14,6 @@ CONFIG_ARM_THUMBEE=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
 CONFIG_HIGHMEM=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_OPROFILE=y
@@ -33,7 +31,6 @@ CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_RARP=y
-CONFIG_NETWORK_PHY_TIMESTAMPING=y
 CONFIG_VLAN_8021Q=y
 CONFIG_VLAN_8021Q_GVRP=y
 CONFIG_CAN=y
@@ -48,12 +45,10 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
-CONFIG_MTD_M25P80=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_NAND_DENALI_DT=y
 CONFIG_MTD_SPI_NOR=y
 # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
-CONFIG_SPI_CADENCE_QUADSPI=y
 CONFIG_OF_OVERLAY=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
@@ -89,6 +84,7 @@ CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
 CONFIG_SPI=y
+CONFIG_SPI_CADENCE_QUADSPI=y
 CONFIG_SPI_DESIGNWARE=y
 CONFIG_SPI_DW_MMIO=y
 CONFIG_SPI_SPIDEV=y
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#4 lore raw

Re: [PATCH net 2/4] net: mvpp2: Remove unneeded Kconfig dependency.

In reply to Richard Cochran
Quoted 6 lines · Richard Cochran

The mvpp2 is an Ethernet driver, and it implements MAC style time stamping of PTP frames. It has no need of the expensive option to enable PHY time stamping. Remove the incorrect dependency.

Fixes 91dd71950bd7 ("net: mvpp2: ptp: add TAI support")

NAK.

Quoted 25 lines
---
 drivers/net/ethernet/marvell/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/marvell/Kconfig +0 -1
index 41815b609569..7fe15a3286f4 100644
@@ -94,7 +94,6 @@ config MVPP2
 
 config MVPP2_PTP
 	bool "Marvell Armada 8K Enable PTP support"
-	depends on NETWORK_PHY_TIMESTAMPING
 	depends on (PTP_1588_CLOCK = y && MVPP2 = y) || \
 		   (PTP_1588_CLOCK && MVPP2 = m)
 
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 7 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#5 lore raw

Re: [PATCH net 2/4] net: mvpp2: Remove unneeded Kconfig dependency.

Quoted 9 lines · Russell King - ARM Linux admin
Quoted 6 lines · Richard Cochran

The mvpp2 is an Ethernet driver, and it implements MAC style time stamping of PTP frames. It has no need of the expensive option to enable PHY time stamping. Remove the incorrect dependency.

Fixes 91dd71950bd7 ("net: mvpp2: ptp: add TAI support")

NAK.

Can you please explain why mvpp2 requires NETWORK_PHY_TIMESTAMING?

Thanks,
Richard

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#14 lore raw
In reply to Richard Cochran
Quoted 3 lines · Richard Cochran

The NETWORK_PHY_TIMESTAMPING configuration option adds additional checks into the networking hot path, and it is only needed by two rather esoteric devices,

Correction: there are three legitimate users of PHY time stamping...

Quoted 2 lines

namely the TI DP83640 PHYTER and the ZHAW
InES 1588 IP core.

There is also net/phy/mscc.

Thanks,
Richard

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Acked-by on v1 1/4
#2 lore raw

Re: [PATCH net 1/4] net: dsa: mv88e6xxx: Remove bogus Kconfig dependency.

In reply to Richard Cochran
Quoted 6 lines · Richard Cochran

The mv88e6xxx is a DSA driver, and it implements DSA style time stamping of PTP frames. It has no need of the expensive option to enable PHY time stamping. Remove the bogus dependency.

Fixes 2fa8d3af4bad ("net: dsa: mv88e6xxx: expose switch time as a PTP hardware clock")

Ah, I must have thought I needed skb_defer_rx_timestamp in mv88e6xxx, but instead DSA gained its own timestamp path so mv88e6xxx turned out to not need that at all, and I never went back and dropped the Kconfig dependency. Whoops. Yup, I don't think we don't need it here.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#6 lore raw

Re: [PATCH net 2/4] net: mvpp2: Remove unneeded Kconfig dependency.

In reply to Richard Cochran
Quoted 6 lines · On Thu, 21 Jan 2021 07:08:02 -0800 Richard Cochran wrote:
Quoted 5 lines · Russell King - ARM Linux admin
Quoted 4 lines · Richard Cochran

The mvpp2 is an Ethernet driver, and it implements MAC style time stamping of PTP frames. It has no need of the expensive option to enable PHY time stamping. Remove the incorrect dependency.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Fixes 91dd71950bd7 ("net: mvpp2: ptp: add TAI support")

NAK.

Can you please explain why mvpp2 requires NETWORK_PHY_TIMESTAMING?

Russell, I think we all agree now this is not the solution to the problem of which entity should provide the timestamp, but the series doesn't seem objectionable in itself.

Please LMK if you think otherwise.

(I would put it in net-next tho, given the above this at most a space optimization.)

#7 lore raw

Re: [PATCH net 2/4] net: mvpp2: Remove unneeded Kconfig dependency.

Quoted 14 lines · Jakub Kicinski
Quoted 6 lines · On Thu, 21 Jan 2021 07:08:02 -0800 Richard Cochran wrote:
Quoted 5 lines · Russell King - ARM Linux admin
Quoted 4 lines · Richard Cochran

The mvpp2 is an Ethernet driver, and it implements MAC style time stamping of PTP frames. It has no need of the expensive option to enable PHY time stamping. Remove the incorrect dependency.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Fixes 91dd71950bd7 ("net: mvpp2: ptp: add TAI support")

NAK.

Can you please explain why mvpp2 requires NETWORK_PHY_TIMESTAMING?

Quoted 8 lines

Russell, I think we all agree now this is not the solution to the problem of which entity should provide the timestamp, but the series doesn't seem objectionable in itself.

Please LMK if you think otherwise.

(I would put it in net-next tho, given the above this at most a space optimization.)

Correct - my NAK is on the basis that this series was put forward as solving the issue I had raised, but in reality it does little to achieve that.

It is, as you say, just a space optimisation, and I have no issue with it being merged on that basis.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#8 lore raw

Re: [PATCH net 2/4] net: mvpp2: Remove unneeded Kconfig dependency.

In reply to Jakub Kicinski
Quoted 2 lines · Jakub Kicinski

(I would put it in net-next tho, given the above this at most a space optimization.)

It isn't just about space but also time. The reason why I targeted net and not net-next was that NETWORK_PHY_TIMESTAMPING activates a function call to skb_clone_tx_timestamp() for every transmitted frame.

	static inline void skb_tx_timestamp(struct sk_buff *skb)
	{
		skb_clone_tx_timestamp(skb);
		if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP)
			skb_tstamp_tx(skb, NULL);
	}

In the abscence of a PHY time stamping device, the check for its presence inside of skb_clone_tx_timestamp() will of course fail, but this still incurs the cost of the call on every transmitted skb.

Similarly netif_receive_skb() futilely calls skb_defer_rx_timestamp() on every received skb.

I would argue that most users don't want this option activated by accident.

(And yes, we could avoid the functions call by moving the check outside of the global functions and inline to the call sites. I'll be sure to have that in the shiny new improved scheme under discussion.)

Thanks,
Richard

maintainer
#9 lore raw

Re: [PATCH net 2/4] net: mvpp2: Remove unneeded Kconfig dependency.

Quoted 20 lines · On Sat, 23 Jan 2021 05:26:26 -0800 Richard Cochran wrote:
Quoted 2 lines · Jakub Kicinski

(I would put it in net-next tho, given the above this at most a space optimization.)

It isn't just about space but also time. The reason why I targeted net and not net-next was that NETWORK_PHY_TIMESTAMPING activates a function call to skb_clone_tx_timestamp() for every transmitted frame.

	static inline void skb_tx_timestamp(struct sk_buff *skb)
	{
		skb_clone_tx_timestamp(skb);
		if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP)
			skb_tstamp_tx(skb, NULL);
	}

In the abscence of a PHY time stamping device, the check for its presence inside of skb_clone_tx_timestamp() will of course fail, but this still incurs the cost of the call on every transmitted skb.

Quoted 5 lines

Similarly netif_receive_skb() futilely calls skb_defer_rx_timestamp() on every received skb.

I would argue that most users don't want this option activated by accident.

I see. The only thing I'm worried about then is the churn in patch 3. This would land in Linus's tree shortly before rc6, kinda late to be taking chances in the name of minor optimizations :S

Quoted 3 lines

(And yes, we could avoid the functions call by moving the check outside of the global functions and inline to the call sites. I'll be sure to have that in the shiny new improved scheme under discussion.)

#10 lore raw

Re: [PATCH net 2/4] net: mvpp2: Remove unneeded Kconfig dependency.

Quoted 3 lines · Jakub Kicinski

I see. The only thing I'm worried about then is the churn in patch 3. This would land in Linus's tree shortly before rc6, kinda late to be taking chances in the name of minor optimizations :S

;^)

Yeah, by all means, avoid ARM churn... I remember Bad Things there...

Maybe you could take #1 and #2 for net-next?

I should probably submit 3-4 throught the SoC tree anyhow.

Thanks,
Richard

maintainer
#11 lore raw

Re: [PATCH net 2/4] net: mvpp2: Remove unneeded Kconfig dependency.

Quoted 10 lines · On Sat, 23 Jan 2021 13:14:00 -0800 Richard Cochran wrote:
Quoted 3 lines · Jakub Kicinski

I see. The only thing I'm worried about then is the churn in patch 3. This would land in Linus's tree shortly before rc6, kinda late to be taking chances in the name of minor optimizations :S

;^)

Yeah, by all means, avoid ARM churn... I remember Bad Things there...

Maybe you could take #1 and #2 for net-next?

Done, thanks!

Quoted 1 line

I should probably submit 3-4 throught the SoC tree anyhow.