How to configure TSN

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.8.1
[●] DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
[●] Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
[●] DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
1.9.3.10904
[●] other

Host Machine Version
[●] native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

I want to set TSN to mgbe3_0’s vlan.
I referred to the URL below.

The command I did was…
sudo ip link add link mgbe3_0 name mgbe3_0.100 type vlan id 100 egress 0:7 1:7 2:7 3:7 4:7 5:7 6:7 7:7
sudo ip link add link mgbe3_0 name mgbe3_0.200 type vlan id 200 egress 0:2 1:2 2:2 3:2 4:2 5:2 6:2 7:2

When I executed ether_api, which was generated by compiling ether_api.c, against a vlan, an IOCTL error occurred.
./ether_api mgbe3_0.100 est 1 0 0 0 0 0xF4240 0 2 0xAAE60 0x493E0
Speed is 10000MBps
est en_dis = 0x1
btr(nsec) = 0x0
btr(sec) = 0x0
btr_offset(nsec) = 0x0
btr_offset(sec) = 0x0
ctr(nsec) = 0xf4240
ctr(sec) = 0x0
llr=0x2
GCL[0] = 0xaae60
GCL[1] = 0x493e0
IOCTL Error in program_est()

I don’t really understand how to use ethtool -S , so I don’t know if I was able to set up TSN.
How can I set TSN on a vlan?
Also, please tell me how to confirm that the TSN settings are correct.

Could you provide more information of your question?

Are you using Drive Orin platform?

Yes, I’m using AGX orin p3710-10-s05.

Could you provide more details about the “ether_api” you mentioned? For “ethtool”, you may want to refer to its online manual.

ether_api.c is located in the following directory within the SDK.
/nvidia/nvidia_sdk/DRIVE_OS_6.0.6_SDK_Linux_DRIVE_AGX_ORIN_DEVKITS/DRIVEOS/drive-linux/samples/ether_api.c

I think that ether_api.c corresponds to 「nvether_sample_app」 written in the online manual.
Because the same command options are available.
Is this idea correct?

Please upgrade to the latest version (DRIVE OS 6.0.8.1) to try this. Thanks.

I upgraded to DRIVE OS 6.0.8.1 and was able to use “nvether_sample_app”, but the situation remains the same.
Why is base_time_reg_err counted up when I execute the ethtool -S mgbe3_0 command?

Could you please share more details about the setup and the specific steps you followed to observe this behavior?

Sorry for the lack of words.
I installed DRIVEOS 6.0.8.1 using Docker on ubuntu20.04LTS.

I put “ptp4l”, “automotive-slave.cfg”, and “nvether_sample_app” that were in the SDK into the tegra file system.

Then connect mgbe3_0 and ubuntuPC.

The command executed in this state is…
・Specify mgbe2_0 and perform gptp communication.
sudo ./ptp4l -f automotive-slave.cfg -i mgbe2_0 -p /dev/ptp2 &

・ Prepare two vlans for mgbe3_0.
sudo ip link add link mgbe3_0 name mgbe3_0.100 type vlan id 100 egress 0:7 1:7 2:7 3:7 4:7 5:7 6:7 7:7
sudo ip link set dev mgbe3_0.100 up

sudo ip link add link mgbe3_0 name mgbe3_0.200 type vlan id 200 egress 0:2 1:2 2:2 3:2 4:2 5:2 6:2 7:2
sudo ip link set dev mgbe3_0.200 up
(Finally, I would like to send packets from these two at the same time and check whether TSN is set.)

・And when I run the TSN application by specifying the vlan, an error is output.
$ ./nvether_sample_app mgbe3_0.100 est 1 0 0 0 0 0xF4240 0 2 0xAAE60 0x493E0
Speed is 10000MBps
est en_dis = 0x1
btr(nsec) = 0x0
btr(sec) = 0x0
btr_offset(nsec) = 0x0
btr_offset(sec) = 0x0
ctr(nsec) = 0xf4240
ctr(sec) = 0x0
llr=0x2
GCL[0] = 0xaae60
GCL[1] = 0x493e0
IOCTL Error in program_est()

If you specify an interface other than vlan and run it, no error will occur, but if you run the ethtool -S mgbe3_0 command, base_time_reg_err will count up.
./nvether_sample_app mgbe3_0 est 1 0 0 0 0 0xF4240 0 2 0xAAE60 0x493E0

However, if you specify 10sec for the base-time offset option as shown in the online manual, base_time_reg_err will not be counted up.
./nvether_sample_app mgbe3_0 est 1 0 0 0 10 0xF4240 0 2 0xAAE60 0x493E0

The first thing I want to ask is

  1. Is it possible to set TSN on the vlan interface?
    2.What is the cause of base_time_reg_err being counted up?

Thank you for providing detailed information. I’ll check this with our team and update you here.

thank you.
I look forward to your reply.

Has there been any progress?

We have been able to reproduce this issue with VLAN interfaces and are actively investigating it. We will provide updates as soon as we make progress.

Your understanding is correct. The error you encountered is likely because the TSN (Time-Sensitive Networking) configuration in the Tegra system uses a private ioctl SIOCDEVPRIVATE, and it doesn’t have support for VLAN interfaces. This results in an ioctl error when trying to configure TSN for the VLAN interfaces directly.

As a workaround, you can configure TSN for the main interface (in this case, mgbe3_0) since TSN settings on the main interface are typically applicable to the VLAN interfaces created under it. This should help you achieve the desired TSN configuration without encountering the ioctl error when configuring TSN for the VLAN interfaces individually.

When you specify 0 for the base-time offset, the application takes the current PTP time as the base time but adds an offset of 0 seconds, resulting in the inclusion of the just-expired time.

As a consequence, the base_time_reg_err counter increments because it measures the error in the registration of the base time compared to the current PTP time.

Thank you for your reply.
I choose to set up TSN on the main interface.

I have another question at that time.
I have this explanation for GCL entries:
[0x<8 bit gate mask> <24 bit interval - value in ns>]
The first two digits of this description indicate which priority packets are allowed to pass.
And the last 6 digits mean how many nanoseconds should it pass?
Does 6 digits mean 16,777,215ns is the maximum value that can be set?

for example
Is the following command correct so that the overall cycle time is 16,777,685 ns, priority 7 packets are 10,000,000 ns, and priority 2 packets are 6,000,000 ns?
./nvether_sample_app mgbe3_0 est 1 0 0 0 10 0x10001d5 0 2 0x80989680 0x45B8D80

We will check it with our team and get back to you.

Please find our clarification regarding the GCL entry.

The GCL entry specifies when a gate (communication channel) is open or closed, allowing or preventing the transmission of frames.

GCL entry has two fields:

8-bit Gate Mask
This field represents a bitmask where each bit corresponds to a specific gate. The bit being set indicates that the corresponding gate is open during the specified time interval. The 8-bit gate mask allows you to control up to 8 gates simultaneously.

24-bit Interval
This field represents the time interval the gate is open or closed. The value is expressed in nanoseconds(ns).

Each GCL entry represents a specific time interval when certain gates are scheduled to open or close.
In case of multiple GCL entries, they are processed sequentially according to their order in the list.

If we take the example mentioned by you,

./nvether_sample_app mgbe3_0 est 1 0 0 0 10 0x10001d5 0 2 0x80989680 0x45B8D80

Here there are two GCL entries,

  • GCL entry 1 :
    0x80989680
    where the 8-bit Gate mask is 0x80 (1000 0000) and the 24-bit interval is 0x989680
    It means the 7th gate will be open and other gates will be closed for 10000000 ns

  • GCL entry 2:
    0x45B8D80
    where the 8-bit Gate mask is 0x04 (0000 0100) and the 24-bit interval is 0x5B8D80
    It means 2nd gate will be open and the other gates will be closed for 6000000 ns

So, in simple terms, the first entry indicates that the 7th gate will be open and other gates will be closed for 10,000,000 ns, and then the second entry specifies that the 2nd gate will be open and other gates will be closed for 6,000,000 ns. This cycle will be repeated, taking the Cycle Time Register (CTR) into consideration.

./nvether_sample_app mgbe3_0 est 1 0 0 0 10 0x10001d5 0 2 0x80989680 0x45B8D80
With this command, I was able to apply 802.1Qbv to VLAN and schedule packets.
thank you.

I also have a question about 802.1CB.

Looking at this URL, it says that it supports 802.1CB.
However, I can’t find any specific instructions on how to apply it.
First, please tell me the options of the nvether_sample_app command to apply it to 802.1CB.

Great to hear that 802.1Qbv is working for you! For your question about 802.1CB, it would be best to create a new topic dedicated to that feature. This helps keep discussions organized and makes it easier for the community to provide targeted assistance. Feel free to create a new topic, and I’ll check with our team about your 802.1CB-related inquiries.