This example application demonstrates how to configure the IEEE 802.1 Qbv (EST) through our TSN yang interface.
The yang interface in the TSN is governed by a module called uniconf which runs as a daemon. Any application which interacts with the uniconf is called as a uniconf client. The uniconf client configures 802.1 Qbv by opening yang database (DB), write config yang parameters to DB and triggers the uniconf for reading parameters from DB and writing to HW. The uniconf reads or writes parameters from or to HW by calling Enet LLD driver.
Please note that the file system support is not yet integrated to ethernet examples.
In this example, we configure the talker DUT to send out traffic as per the EST schedule and the listner DUT or device can verify the time-slots of the received packets.
Please note, The receive packet time stamping of non-ptp traffic is currently not supported on AM263x. User needs to use other time-stamping device to capture the receive time-stamps. The receive packet time-stamping support is available on AM243x and AM64x. If AM243x or AM64x is available, you can connect to them and configure them as listener.
See also : Enet CPSW EST Example, Ethernet TSN and gPTP Stack - API and Integration Guide
Parameter | Value |
---|---|
CPU + OS | r5fss0-0_freertos |
Toolchain | ti-arm-clang |
Boards | am263x-cc, am263x-lp |
Example folder | examples/networking/tsn/est_cpsw_app |
DEFAULT_INTERFACE_INDEX
from the qosapp_misc.h
.EST Schedule (Input parameters)
Gate Control | Time Interval |
---|---|
oCCCCCCo | 62 usecs |
oCooCoCC | 62 usecs |
oCCCCCCo | 62 usecs |
oCCCCoCC | 62 usecs |
Each of the 8 gates (one per priority) can be in one of two states:
o
' in the Gate Control column of previous table.Closed: Frames in the corresponding queue are not selected for transmission. This is represented by 'C
' in the Gate Control column.
The priority being referred to in the EST schedule described above corresponds to the CPSW destination port hardware switch priority. For VLAN tagged packets that ingress through CPSW host port, the hardware switch priority can be determined by either the CPPI channel number (P0_RX_REMAP_VLAN = 0
) or the packet priority value from the VLAN tag (P0_RX_REMAP_VLAN = 1
).
Parameters | TimeValue |
---|---|
baseTime | ((Current PTP Time + delayOffset)/delayOffset)*delayOffset |
cycleTime | 248us |
Where
baseTime
: PTP time round-off to the delayOffset
to have the same both baseTime
on talker and listener to apply the EST schedule that the same time in the future.delayOffset
: added time to current PTP time for baseTime
to apply the schedule in the future. It should be a multiple of the cycleTime
and large enough so that user can have enough time to start talker and listener by entering a character to UART terminal. The current delayOffset
is 100000*cycleTime
= 24800000us (24.8 seconds). The factor '100000' is chosen to have delayOffset
above 20secs.0–62us | 124us–186us |
62us–124us | 186us–248us |
timeSlot
of each packet is calculated using the following formula:The timeSlot is compared with the time windows above for each packet to check whether the packet received inside or outside the expected time windows. The EST works when percentage of packets received outside of expected time windows less than or equal 1%.
The EST application needs to run with the gPTP and yang configuration daemon. Therefore, the gPTP and uniconf must be run during initializing the application. To register the EST application to the initializer of the TSN App for running after the gPTP and uniconf, add the following line to the EnetApp_initTsnByCfg of the tsninit.c
Then the EST application will be started when the EnetApp_startTsn
is called.
standard/ieee/draft/802.1/Qcw/ieee802-dot1q-sched-bridge.yang
and standard/ieee/draft/802.1/Qcw/ieee802-dot1q-sched.yang
from the https://github.com/YangModels/yang.gitadmin-control-list
, baseTime
(admin-base-time
) and cycleTime (admin-cycle-time
), this section describes the parameters of the admin-control-list
Here are parameters of the admin-control-list
after converting parameters from yang to to xmlAll the supported parameters for 802.1Qbv are from yang standard except the mechanism for mapping traffic class and HW queue are augmented. To configure all parameters of 802.1Qbv above, application calls the yang_db_runtime_put_oneline
to write data to DB. After all required parameters written to the DB, application trigger the uniconf by writing the /ietf-interfaces/interfaces/interface|name:tilld0/bridge-port/gate-parameter-table/gate-enabled
so that the uniconf writes parameters to HW. See EnetEstApp_setAdminControlList
of the est_init.c
for yang configuration.
Note The network interface tilld0
is default network interface name, name of network interface can be changed by changing default Mac port configured for the example.
Refer Ethernet TSN gPTP Examples to build the enet_cpsw_tsn_est_example
Make sure you have setup the EVM with cable connections as shown in EVM Setup. In addition, follow the steps in the next section.
HW devices configuration
Connect AM263x SOC to any gPTP capable device, PC or AM243x or AM64x.
Start the talker right after the listener.
On the slave device, press t
to start a talker, It will show log on UART terminal as follows