Skip to contentSkip to conversation

Add support for Frame preemption (IEEE

RFC PATCH In review Pranavi Somisetty 3 participants 7 messages Nov 3, 2022 – Nov 4, 2022

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

cover Add support for Frame preemption (IEEE

Frame Preemption is one of the core standards of TSN. It enables low latency trasmission of time-critical frames by allowing them to interrupt the transmission of other non time-critical traffic. Frame preemption is only active when the link partner is also capable of it. This negotiation is done using LLDP as specified by the standard. Open source lldp utilities and other applications, can make use of the ioctls and the header being here, to query preemption capabilities and configure various parameters.

Pranavi Somisetty (2):
include: uapi: Add new ioctl definitions to support Frame Preemption
include: uapi: Add Frame preemption parameters

 include/uapi/linux/preemption_8023br.h | 30 ++++++++++++++++++++++++++
 include/uapi/linux/sockios.h           |  6 ++++++
 net/core/dev_ioctl.c                   |  6 +++++-
 3 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 include/uapi/linux/preemption_8023br.h
Signature · 1 line
2.36.1
#1 lore raw

RFC PATCH 1/2 include: uapi: Add new ioctl definitions to support Frame Preemption

Add new ioctl definitions, SIOC_PREEMPTION_EN, SIOC_PREEMPTION_CTRL, SIOC_PREEMPTION_STS, SIOC_PREEMPTION_COUNTER, to support IEEE 802.3br.

---
 include/uapi/linux/sockios.h | 6 ++++++
 net/core/dev_ioctl.c         | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
include/uapi/linux/sockios.h +6 -0
index 7d1bccbbef78..382f959fb371 100644
@@ -153,6 +153,12 @@
 #define SIOCSHWTSTAMP	0x89b0		/* set and get config		*/
 #define SIOCGHWTSTAMP	0x89b1		/* get config			*/
 
+/* Frame Preemption, IEEE 802.3br */
+#define SIOC_PREEMPTION_EN	0x89b2	/* enable frame preemption		*/
+#define SIOC_PREEMPTION_CTRL	0x89b3	/* configure preemption parameters	*/
+#define SIOC_PREEMPTION_STS	0x89b4	/* get preemption status		*/
+#define SIOC_PREEMPTION_COUNTER	0x89b5	/* read preemption statistics		*/
+
 /* Device private ioctl calls */
 
 /*
net/core/dev_ioctl.c +5 -1
index 7674bb9f3076..46fb963cd13a 100644
@@ -409,7 +409,11 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data,
 		    cmd == SIOCGMIIREG ||
 		    cmd == SIOCSMIIREG ||
 		    cmd == SIOCSHWTSTAMP ||
-		    cmd == SIOCGHWTSTAMP) {
+		    cmd == SIOCGHWTSTAMP ||
+		    cmd == SIOC_PREEMPTION_EN ||
+		    cmd == SIOC_PREEMPTION_CTRL ||
+		    cmd == SIOC_PREEMPTION_STS ||
+		    cmd == SIOC_PREEMPTION_COUNTER) {
 			err = dev_eth_ioctl(dev, ifr, cmd);
 		} else if (cmd == SIOCBONDENSLAVE ||
 		    cmd == SIOCBONDRELEASE ||
Signature · 1 line
2.36.1
#2 lore raw

Re: [RFC PATCH net-next 1/2] include: uapi: Add new ioctl definitions to support Frame Preemption

Quoted 2 lines · Pranavi Somisetty

Add new ioctl definitions, SIOC_PREEMPTION_EN, SIOC_PREEMPTION_CTRL, SIOC_PREEMPTION_STS, SIOC_PREEMPTION_COUNTER, to support IEEE 802.3br.

Please justify using an IOCTL when everything else in the network stack is configured using netlink.

Andrew

#3 lore raw

RFC PATCH 2/2 include: uapi: Add Frame preemption parameters

In reply to Pranavi Somisetty

Adds a header file for Frame preemption parameters.

---
 include/uapi/linux/preemption_8023br.h | 30 ++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 include/uapi/linux/preemption_8023br.h
include/uapi/linux/preemption_8023br.h new file +30 -0
new file mode 100644
index 000000000000..762fe4dd1906
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+#ifndef PREEMPTION_H
+#define PREEMPTION_H
+/*
+ * IEEE 802.3br - Frame Preemption header
+ */
+
+/**
+ *  struct preempt_ctrl_sts:	Preemption configuration and status.
+ *  @version:			version for backward compatibility
+ *  @preemp_sup:		Preemption capable
+ *  @preemp_enabled:		Preemption enabled
+ *  @tx_preemp_sts:		TX Preemption Status
+ *  @mac_tx_verify_sts:		MAC Merge TX Verify Status
+ *  @verify_timer_value:	Verify Timer Value
+ *  @additional_frag_size:	Additional Fragment Size
+ *  @disable_preemp_verify:	Disable Preemption Verification
+ */
+struct preempt_ctrl_sts {
+	unsigned int version;
+	unsigned int preemp_sup;
+	unsigned int preemp_en;
+	unsigned int tx_preemp_sts;
+	unsigned int mac_tx_verify_sts;
+	unsigned int verify_timer_value;
+	unsigned int additional_frag_size;
+	unsigned int disable_preemp_verify;
+};
+#endif
+
Signature · 1 line
2.36.1
#4 lore raw
In reply to Pranavi Somisetty

Hi Pranavi,

Quoted 13 lines · Pranavi Somisetty

Frame Preemption is one of the core standards of TSN. It enables low latency trasmission of time-critical frames by allowing them to interrupt the transmission of other non time-critical traffic. Frame preemption is only active when the link partner is also capable of it. This negotiation is done using LLDP as specified by the standard. Open source lldp utilities and other applications, can make use of the ioctls and the header being here, to query preemption capabilities and configure various parameters.

Pranavi Somisetty (2):
include: uapi: Add new ioctl definitions to support Frame Preemption
include: uapi: Add Frame preemption parameters

Quoted 9 lines
 include/uapi/linux/preemption_8023br.h | 30 ++++++++++++++++++++++++++
 include/uapi/linux/sockios.h           |  6 ++++++
 net/core/dev_ioctl.c                   |  6 +++++-
 3 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 include/uapi/linux/preemption_8023br.h
Signature · 1 line
2.36.1

Have you seen:
https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/

#5 lore raw
Quoted 38 lines

-----Original Message-----
From: Vladimir Oltean <[email protected]>
Sent: Friday, November 4, 2022 4:21 AM
To: Somisetty, Pranavi <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; git (AMD-Xilinx) <[email protected]>; Katakam, Harini <[email protected]>; Pandey, Radhey Shyam <[email protected]>; Simek, Michal <[email protected]>; [email protected]; [email protected]
Subject: Re: [RFC PATCH net-next 0/2] Add support for Frame preemption (IEEE

Hi Pranavi,

Quoted 9 lines · Pranavi Somisetty

Frame Preemption is one of the core standards of TSN. It enables low latency trasmission of time-critical frames by allowing them to interrupt the transmission of other non time-critical traffic. Frame preemption is only active when the link partner is also capable of it. This negotiation is done using LLDP as specified by the standard. Open source lldp utilities and other applications, can make use of the ioctls and the header being here, to query preemption capabilities and configure various parameters.

Quoted 5 lines

Pranavi Somisetty (2):
include: uapi: Add new ioctl definitions to support Frame Preemption
include: uapi: Add Frame preemption parameters

 include/uapi/linux/preemption_8023br.h | 30

++++++++++++++++++++++++++

Quoted 5 lines
 include/uapi/linux/sockios.h           |  6 ++++++
 net/core/dev_ioctl.c                   |  6 +++++-
 3 files changed, 41 insertions(+), 1 deletion(-)  create mode 100644

include/uapi/linux/preemption_8023br.h

Quoted 7 lines
Quoted 3 lines

--
2.36.1

Have you seen:
https://patchwork.kernel.org/project/netdevbpf/cover/20220816222920.195
[email protected]/

Thanks Vladimir, I hadn't, we will try to use your RFC.

Regards
Pranavi

#6 lore raw
Quoted 5 lines · Pranavi
Quoted 3 lines

Have you seen:
https://patchwork.kernel.org/project/netdevbpf/cover/20220816222920.195
[email protected]/

Thanks Vladimir, I hadn't, we will try to use your RFC.

The point is not to *use* it (you can't even without some major effort - I didn't even publish the user space patches, even though I have ethtool ready and openlldp almost completely ready as well; plus I also did some more rework to the posted RFC, which I didn't repost yet).

The point is that the RFC has stalled due to seemingly no clear answers to some fundamental questions about the placement of these new features. It would be good if some extra feedback from people familiar with frame preemption/MAC merge could be provided there.

Thanks.