|
|
|
|
|
|
|
This page contains the steps to setup a 2 nodes TSN demo using the Debian PC’s and S2OPC
|
|
|
|
toolkit.
|
|
|
|
|
|
|
|
# Steps to install the Kernel and applying RT patch
|
|
|
|
|
|
|
|
## Prerequisite
|
|
|
|
|
|
|
|
This S2OPC demo over TSN is based on two equipment with the below configuration:
|
|
|
|
- i5 Quad core based PC or equivalent
|
|
|
|
- Intel i210 NIC card (https://www8.hp.com/emea_africa/en/desktops/product-details/5383389)
|
|
|
|
- Install Debian 9.3 (https://cdimage.debian.org/mirror/cdimage/archive/9.3.0/amd64/iso-
|
|
|
|
dvd/)
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
1. After installing Debian in the DUT’s, login and open terminal
|
|
|
|
2. Login as root
|
|
|
|
```
|
|
|
|
$ su
|
|
|
|
```
|
|
|
|
3. Install the below dependency packages on the DUT before installing the kernel
|
|
|
|
4. Open the source list file:
|
|
|
|
```
|
|
|
|
# nano /etc/apt/sources.list
|
|
|
|
```
|
|
|
|
copy/paste the below mirror links into the file:
|
|
|
|
```
|
|
|
|
deb http://security.debian.org/debian-security stretch/updates main
|
|
|
|
deb-src http://security.debian.org/debian-security stretch/updates main
|
|
|
|
deb http://deb.debian.org/debian stretch main
|
|
|
|
deb http://deb.debian.org/debian stretch-updates main contrib non-free
|
|
|
|
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free
|
|
|
|
```
|
|
|
|
5. Now, update and upgrade the packages
|
|
|
|
```
|
|
|
|
# apt-get update && apt-get upgrade
|
|
|
|
# apt-get install g++ cmake-curses-gui libmbedtls-dev bc libelf-dev tcpdump tshark rt-tests
|
|
|
|
libssl-dev libncurses5-dev qt4-default qt4-dev-tools libncurses-dev quilt flex bison gnuplot
|
|
|
|
cmake pkg-config net-tools autoconf libmnl-dev
|
|
|
|
```
|
|
|
|
6. Download and install latest PTP stack v3.1 – release
|
|
|
|
```
|
|
|
|
# wget https://github.com/richardcochran/linuxptp/archive/v3.1.tar.gz -O linuxptp-3.1.tar.gz
|
|
|
|
# tar -xvf linuxptp-3.1.tar.gz
|
|
|
|
# cd linuxptp-3.1/
|
|
|
|
# make
|
|
|
|
# make install
|
|
|
|
# cd ..
|
|
|
|
```
|
|
|
|
7. Download and install iproute2 v5.0 – release
|
|
|
|
```
|
|
|
|
# wget https://github.com/shemminger/iproute2/archive/v5.0.0.tar.gz -O iproute2-
|
|
|
|
5.0.0.tar.gz
|
|
|
|
# tar -xvzf iproute2-5.0.0.tar.gz
|
|
|
|
# cd iproute2-5.0.0/
|
|
|
|
# ./configure
|
|
|
|
# make
|
|
|
|
# make install
|
|
|
|
# cd ..
|
|
|
|
```
|
|
|
|
|
|
|
|
## Download the kernel and RT patch
|
|
|
|
|
|
|
|
1. Download the linux kernel from the below given weblink:
|
|
|
|
```
|
|
|
|
# wget https://cdn.kernel.org/pub/linux/kernel/v5.x/ linux-5.0.5.tar.xz
|
|
|
|
```
|
|
|
|
2. Extract the kernel and create a new folder to store the PREEMPT_RT patch
|
|
|
|
```
|
|
|
|
# tar -Jxvf linux-5.0.5.tar.xz
|
|
|
|
# mv linux-5.0.5 linux-5.0.5-rt3
|
|
|
|
# cd linux-5.0.5-rt3
|
|
|
|
# mkdir patches
|
|
|
|
# cd patches/
|
|
|
|
```
|
|
|
|
3. Download the RT patch from then given weblink:
|
|
|
|
```
|
|
|
|
# wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.0/ older/patch-5.0.5-rt3.patch.xz
|
|
|
|
```
|
|
|
|
4. Apply the patch. For applying the bulk patches and managing, instead of “ls patch-5.0.5-
|
|
|
|
rt3.patch” change to “ls *.patch” (Multiple patches from the OSADL can be applied such
|
|
|
|
kernel latency histogram patch etc..,). This demo uses single patch file, so use below
|
|
|
|
commands
|
|
|
|
```
|
|
|
|
# unxz patch-5.0.5-rt3.patch.xz
|
|
|
|
# ls patch-5.0.5-rt3.patch > series
|
|
|
|
# cd ..
|
|
|
|
# quilt push -a
|
|
|
|
```
|
|
|
|
Copy the PC configuration file to .config
|
|
|
|
```
|
|
|
|
# cp /boot/config-<YOUR_CURRENT_KERNEL_CONFIG> .config
|
|
|
|
```
|
|
|
|
[Note]: The boot configuration file(.config) of the current kernel varies /boot/config-
|
|
|
|
$kernel_version from system to system. For Ex: /boot/config-4.9.0-4-amd64
|
|
|
|
|
|
|
|
### Kernel Configuration
|
|
|
|
|
|
|
|
1. Modify kernel configuration before RT kernel compilation. Run the below command to
|
|
|
|
open kernel “General Setup” menu
|
|
|
|
```
|
|
|
|
# make menuconfig
|
|
|
|
```
|
|
|
|
2. Follow the below screen shots and modify the necessary kernel options. Press <spacebar> to
|
|
|
|
change the option. Press <esc><esc> twice to come back
|
|
|
|
- Enable RT preempt. In “General Setup” menu, select “Preemption Model (Voluntaary
|
|
|
|
kernel Preemption)”
|
|
|
|
- Enable the kernel .config support
|
|
|
|
- Enable the ETF, CBS, MQPRIO and TAPRIO scheduler. Select “General Setup” ->
|
|
|
|
“Networking support” -> “Networking Options” -> “Qos and/or fair queueing”
|
|
|
|
3. Now, save in “.config” file and exit
|
|
|
|
4. Compile the kernel using the below commands. First command will take maximum 1
|
|
|
|
hour to compile the kernel with the given settings.
|
|
|
|
```
|
|
|
|
# make -j4 all
|
|
|
|
# make modules_install
|
|
|
|
# make install
|
|
|
|
```
|
|
|
|
5. After installation reboot the DUT. By default the RT kernel is booted up, if not you can
|
|
|
|
select the kernel 5.0.5-rt from the “Advanced Options” in the GRUB menu
|
|
|
|
6. To ensure that “ETF” kernel module is loaded, run the below command in sudo mode
|
|
|
|
```
|
|
|
|
# sudo su
|
|
|
|
# find /lib/modules/$(uname -r) -type f -name '*.ko' | grep sch_et
|
|
|
|
```
|
|
|
|
7. To ensure the PC is booted up with the RT patch. Follow to below command and check
|
|
|
|
whether the command results “5.0.5-rt3”
|
|
|
|
```
|
|
|
|
# uname -r
|
|
|
|
```
|
|
|
|
|
|
|
|
# References
|
|
|
|
|
|
|
|
|
|
|
|
| Description | Reference |
|
|
|
|
| ------ | ------ |
|
|
|
|
| Concept of TSN and i210 data sheet | https://software.intel.com/content/www/us/en/ |
|
|
|
|
| TC qdisc – Manual | https://man7.org/linux/man-pages/man8/tc.8.html |
|
|
|
|
| Real time – preempt patch | https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/preemptrt_setup |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|