diff mbox series

[iproute2-next,v1] tc: Add support for Hold/Release mechanism in TSN as per IEEE 802.1Q-2018

Message ID 20241112040029.3196975-1-yong.liang.choong@linux.intel.com (mailing list archive)
State Accepted
Commit 863c96cea49d4a873a584f63e8851e661e475835
Delegated to: David Ahern
Headers show
Series [iproute2-next,v1] tc: Add support for Hold/Release mechanism in TSN as per IEEE 802.1Q-2018 | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Choong Yong Liang Nov. 12, 2024, 4 a.m. UTC
This commit enhances the q_taprio module by adding support for the
Hold/Release mechanism in Time-Sensitive Networking (TSN), as specified
in the IEEE 802.1Q-2018 standard.

Changes include:
- Addition of `TC_TAPRIO_CMD_SET_AND_HOLD` and `TC_TAPRIO_CMD_SET_AND_RELEASE`
cases in the `entry_cmd_to_str` function to return "H" and "R" respectively.
- Addition of corresponding string comparisons in the `str_to_entry_cmd`
function to map "H" and "R" to `TC_TAPRIO_CMD_SET_AND_HOLD` and
`TC_TAPRIO_CMD_SET_AND_RELEASE`.

The Hold/Release feature works as follows:
- Set-And-Hold-MAC (H): This command sets the gates and holds the current
configuration, preventing any further changes until a release command is
issued.
- Set-And-Release-MAC (R): This command releases the hold, allowing
subsequent gate configuration changes to take effect.

These changes ensure that the q_taprio module can correctly interpret and
handle the Hold/Release commands, aligning with the IEEE 802.1Q-2018 standard
for enhanced TSN configuration.

Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
---
 man/man8/tc-taprio.8 | 30 ++++++++++++++++++++++--------
 tc/q_taprio.c        |  8 ++++++++
 2 files changed, 30 insertions(+), 8 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 18, 2024, 5 p.m. UTC | #1
Hello:

This patch was applied to iproute2/iproute2-next.git (main)
by David Ahern <dsahern@kernel.org>:

On Tue, 12 Nov 2024 12:00:29 +0800 you wrote:
> This commit enhances the q_taprio module by adding support for the
> Hold/Release mechanism in Time-Sensitive Networking (TSN), as specified
> in the IEEE 802.1Q-2018 standard.
> 
> Changes include:
> - Addition of `TC_TAPRIO_CMD_SET_AND_HOLD` and `TC_TAPRIO_CMD_SET_AND_RELEASE`
> cases in the `entry_cmd_to_str` function to return "H" and "R" respectively.
> - Addition of corresponding string comparisons in the `str_to_entry_cmd`
> function to map "H" and "R" to `TC_TAPRIO_CMD_SET_AND_HOLD` and
> `TC_TAPRIO_CMD_SET_AND_RELEASE`.
> 
> [...]

Here is the summary with links:
  - [iproute2-next,v1] tc: Add support for Hold/Release mechanism in TSN as per IEEE 802.1Q-2018
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=863c96cea49d

You are awesome, thank you!
diff mbox series

Patch

diff --git a/man/man8/tc-taprio.8 b/man/man8/tc-taprio.8
index bf489b03..b7a81faf 100644
--- a/man/man8/tc-taprio.8
+++ b/man/man8/tc-taprio.8
@@ -115,14 +115,28 @@  parameters in a single schedule. Each one has the
 
 sched-entry <command> <gatemask> <interval>
 
-format. The only supported <command> is "S", which
-means "SetGateStates", following the IEEE 802.1Q-2018 definition
-(Table 8-7). <gate mask> is a bitmask where each bit is a associated
-with a traffic class, so bit 0 (the least significant bit) being "on"
-means that traffic class 0 is "active" for that schedule entry.
-<interval> is a time duration, in nanoseconds, that specifies for how
-long that state defined by <command> and <gate mask> should be held
-before moving to the next entry.
+format.
+
+<command> support the following values:
+.br
+.I "S"
+for SetGateStates
+.br
+.I "H"
+for Set-And-Hold-MAC
+.br
+.I "R"
+for Set-And-Release-MAC
+.br
+These commands follow the IEEE 802.1Q-2018 definition (Table 8-7).
+
+<gate mask> is a bitmask where each bit is associated with a traffic class, so
+bit 0 (the least significant bit) being "on" means that traffic class 0 is
+"active" for that schedule entry.
+
+<interval> is a time duration, in nanoseconds, that specifies for how long that
+state defined by <command> and <gate mask> should be held before moving to
+the next entry.
 
 .TP
 flags
diff --git a/tc/q_taprio.c b/tc/q_taprio.c
index 416a222a..689c7a8f 100644
--- a/tc/q_taprio.c
+++ b/tc/q_taprio.c
@@ -53,6 +53,10 @@  static const char *entry_cmd_to_str(__u8 cmd)
 	switch (cmd) {
 	case TC_TAPRIO_CMD_SET_GATES:
 		return "S";
+	case TC_TAPRIO_CMD_SET_AND_HOLD:
+		return "H";
+	case TC_TAPRIO_CMD_SET_AND_RELEASE:
+		return "R";
 	default:
 		return "Invalid";
 	}
@@ -62,6 +66,10 @@  static int str_to_entry_cmd(const char *str)
 {
 	if (strcmp(str, "S") == 0)
 		return TC_TAPRIO_CMD_SET_GATES;
+	else if (strcmp(str, "H") == 0)
+		return TC_TAPRIO_CMD_SET_AND_HOLD;
+	else if (strcmp(str, "R") == 0)
+		return TC_TAPRIO_CMD_SET_AND_RELEASE;
 
 	return -1;
 }