[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241112040029.3196975-1-yong.liang.choong@linux.intel.com>
Date: Tue, 12 Nov 2024 12:00:29 +0800
From: Choong Yong Liang <yong.liang.choong@...ux.intel.com>
To: netdev@...r.kernel.org
Cc: Jamal Hadi Salim <jhs@...atatu.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Jiri Pirko <jiri@...nulli.us>,
Choong Yong Liang <yong.liang.choong@...ux.intel.com>
Subject: [PATCH iproute2-next v1] tc: Add support for Hold/Release mechanism in TSN as per IEEE 802.1Q-2018
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@...ux.intel.com>
Signed-off-by: Jose Abreu <Jose.Abreu@...opsys.com>
---
man/man8/tc-taprio.8 | 30 ++++++++++++++++++++++--------
tc/q_taprio.c | 8 ++++++++
2 files changed, 30 insertions(+), 8 deletions(-)
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;
}
--
2.34.1
Powered by blists - more mailing lists