Commit 15c1567b authored by Adam Wujek's avatar Adam Wujek 💬

Merge branch 'adam-ppsi-conf'

parents 7d04c427 106f2fd2
......@@ -112,80 +112,81 @@ menu "Port Timing Configuration"
config PORT00_PARAMS
string "Parameters for the first port"
default "name=wr0,tx=0,rx=160000,role=slave,fiber=0"
default "name=wr0,proto=raw,tx=0,rx=160000,role=slave,fiber=0" if TIME_BC
default "name=wr0,proto=raw,tx=0,rx=160000,role=master,fiber=0"
help
This item, and the following ones, are used to assign the
constant delays (likely from calibration), port roles and
type of fiber for each of the ports. Please refer to the
user manual for more information.
constant delays (likely from calibration), protocol type (raw or udp),
port roles and type of fiber for each of the ports. Please refer to
the user manual for more information.
config PORT01_PARAMS
string "Parameters for the second port"
default "name=wr1,tx=0,rx=160000,role=slave,fiber=0"
default "name=wr1,proto=raw,tx=0,rx=160000,role=master,fiber=0"
config PORT02_PARAMS
string "Parameters for a further port"
default "name=wr2,tx=0,rx=160000,role=master,fiber=0"
default "name=wr2,proto=raw,tx=0,rx=160000,role=master,fiber=0"
config PORT03_PARAMS
string "Parameters for a further port"
default "name=wr3,tx=0,rx=160000,role=master,fiber=0"
default "name=wr3,proto=raw,tx=0,rx=160000,role=master,fiber=0"
config PORT04_PARAMS
string "Parameters for a further port"
default "name=wr4,tx=0,rx=161200,role=master,fiber=0"
default "name=wr4,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT05_PARAMS
string "Parameters for a further port"
default "name=wr5,tx=0,rx=161200,role=master,fiber=0"
default "name=wr5,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT06_PARAMS
string "Parameters for a further port"
default "name=wr6,tx=0,rx=161200,role=master,fiber=0"
default "name=wr6,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT07_PARAMS
string "Parameters for a further port"
default "name=wr7,tx=0,rx=161200,role=master,fiber=0"
default "name=wr7,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT08_PARAMS
string "Parameters for a further port"
default "name=wr8,tx=0,rx=161200,role=master,fiber=0"
default "name=wr8,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT09_PARAMS
string "Parameters for a further port"
default "name=wr9,tx=0,rx=161200,role=master,fiber=0"
default "name=wr9,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT10_PARAMS
string "Parameters for a further port"
default "name=wr10,tx=0,rx=161200,role=master,fiber=0"
default "name=wr10,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT11_PARAMS
string "Parameters for a further port"
default "name=wr11,tx=0,rx=161200,role=master,fiber=0"
default "name=wr11,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT12_PARAMS
string "Parameters for a further port"
default "name=wr12,tx=0,rx=161200,role=master,fiber=0"
default "name=wr12,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT13_PARAMS
string "Parameters for a further port"
default "name=wr13,tx=0,rx=161200,role=master,fiber=0"
default "name=wr13,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT14_PARAMS
string "Parameters for a further port"
default "name=wr14,tx=0,rx=161200,role=master,fiber=0"
default "name=wr14,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT15_PARAMS
string "Parameters for a further port"
default "name=wr15,tx=0,rx=161200,role=master,fiber=0"
default "name=wr15,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT16_PARAMS
string "Parameters for a further port"
default "name=wr16,tx=0,rx=161200,role=master,fiber=0"
default "name=wr16,proto=raw,tx=0,rx=161200,role=master,fiber=0"
config PORT17_PARAMS
string "Parameters for a further port"
default "name=wr17,tx=0,rx=161200,role=master,fiber=0"
default "name=wr17,proto=raw,tx=0,rx=161200,role=master,fiber=0"
endmenu
......@@ -285,44 +286,37 @@ endchoice
choice
prompt "PTP Port Assignment"
default PTP_WR_DEFAULT if TIME_BC
default PTP_WR_MASTER
default PTP_PORT_PARAMS
config PTP_WR_DEFAULT
bool "Raw Ethernet, WR on, Slave on wr0/wr1, Master on other ports"
config PTP_PORT_PARAMS
bool "Raw Ethernet, WR on, Slave on wr0, Master on other ports"
help
You can choose between one from a set of predefined
configuration files from your PTP server running in the
switch, or define your own custom configuration file.
You can choose wether to use parameters defined in PORTXX_PARAMS or
your own custom configuration file /wr/etc/ppsi.conf_custom
The default setting for boundary clock forces ports wr0 and
wr1 to be PTP slaves and all other ports to be master, in
Ethernet mode and with full WR protocol extensions. The default
The default setting for boundary clock forces port wr0
to be PTP slave and all other ports to be master, in
Ethernet mode and with full WR protocol extensions. The default
for a Grand-Master or Free-Running master has all ports as
master ports.
master ports. PPSI's global settings can be set in file
/wr/etc/ppsi-pre.conf
Other predefined choices select more flexible configuration used
mainly for test purposes. Any special need can be addressed by
providing your own ppsi.conf file, that you should copy
providing your own ppsi.conf_custom file, that you should copy
to your switch.
config PTP_WR_MASTER
bool "Raw Ethernet, WR on, Master on all ports"
config PTP_WR_AUTO
bool "Raw Ethernet, WR on, Auto master/slave on all ports"
config PTP_WR_AUTO_UDP
bool "UDP mode, WR on, Auto master/slave on all ports"
config PTP_NONWR_UDP_ALL
bool "UDP mode, No WR, all ports (including eth0)"
config PTP_CUSTOM
bool "Custom ppsi.conf"
bool "Custom ppsi.conf"
endchoice
config PTP_CUSTOM_FILENAME
string "Pathname for your custom ppsi.conf"
depends on PTP_CUSTOM
default "/wr/etc/ppsi-custom.conf"
menu "Management configuration"
config SNMP_TRAPSINK_ADDRESS
string "Static IP address or name where to send SNMPv1 traps"
......@@ -416,8 +410,3 @@ config SNMP_SWCORESTATUS_RX_PRIO_FRAME_RATE
endmenu
config PTP_CUSTOM_FILENAME
string "Pathname for your custom ppsi.conf"
depends on PTP_CUSTOM
default "/wr/etc/ppsi-custom.conf"
......@@ -491,8 +491,8 @@ value is changed by the web interface, proper action is taken.
@itemx CONFIG_PORT17_PARAMS
These configuration items are used to set up port parameters;
this includes the delays, the PTP role (not currently used,
though) and the fiber type as an integer index. Most likely
this includes the delays, the PTP role, PTP protocol type
and the fiber type as an integer index. Most likely
the default values work for you. See @ref{Timing Configuration}
for details.
......@@ -526,23 +526,30 @@ value is changed by the web interface, proper action is taken.
external reference; or a normal ``boundary-clock'' device that
is slave on some ports and master on other ports.
@item CONFIG_PTP_*
@item CONFIG_PTP_PORT_PARAMS
@itemx CONFIG_PTP_CUSTOM
We support a set of PPSi configuration files, for different PTP
roles. The default option being selected by @i{Kconfig} is
@t{PTP_WR_DEFAULT} for @t{TIME_BC} devices and @t{PTP_WR_MASTER}
for @t{GM} and @t{FM} devices. The former configuration selects
a mandated slave PTP role on ports @t{wr0} and @t{wr1}, and
mandated master on all other ports; the latter conifiguration
is master on all ports. Please see the help provided within
@i{Kconfig} for more details about the various options we support.
By default, PPSi configuration file is assembled based on role and
protocol parameters stored in @t{PORTxx_PARAMS}. @t{TIME_BC} selected
by @i{Kconfig} defaults role of port @t{wr0} to slave, other ports
to master. For @t{TIME_GM} and @t{TIME_FM} all ports are mandated to
master.
Parameters @t{clock-class} and @t{clock-accuracy} can be changed
or new global PPSi settings can be added by editing file
@t{/wr/etc/ppsi-pre.conf}, which is used as begging of final
ppsi configuration file.
Alternatively PPSi can use custom user file for configuration
(@t{CONFIG_PTP_CUSTOM}).
Please see the help provided within @i{Kconfig} for more details about
the various options we support.
@item CONFIG_PTP_CUSTOM_FILENAME
If you chose @t{CONFIG_PTP_CUSTOM} in the choice above, you
can provide your own filename for the PPSi configuration file;
the chosen name is expected to be intalled in the @sc{wrs}
filesystem.
the chosen name is expected to be installed in the @sc{wrs}
filesystem.
@end table
......@@ -561,7 +568,7 @@ description.
This is, for explanation's sake, an example of such items:
@smallexample
CONFIG_PORT09_PARAMS="name=wr9,tx=226214,rx=226758,role=slave,fiber=2"
CONFIG_PORT09_PARAMS="name=wr9,proto=raw,tx=226214,rx=226758,role=slave,fiber=2"
CONFIG_SFP00_PARAMS="pn=AXGE-1254-0531,tx=0,rx=0,wl_txrx=1310+1490"
CONFIG_FIBER02_PARAMS="alpha_1310_1490=2.6787e-04"
@end smallexample
......@@ -577,8 +584,8 @@ values depend on trace length and other hardware-specific details
and are determined by a calibration procedure. These values are
used as constant delays in the @i{tx} and @i{rx} directions.
@item The port is also configured as slave (information not used
at this point) and is deployed using fiber type 2 -- this number
@item The port is also configured as slave (@i{role}) using raw whiterabbit
prootocol (@i{proto}) and is deployed using fiber type 2 -- this number
is just a local enumeration of fiber types; most likely you'll be
using type ``0'' in every port.
......@@ -602,7 +609,7 @@ opposite one (@t{alpha_1490_1310}) is calculated by software.
SFP matching is based on vendor name (@i{vn}), part number (@i{pn}) and vendor
serial (@i{vs}). While matching SFP's values are compared with values stored in
@t{CONFIG_SFPXX_PARAMS}.
@t{CONFIG_SFPxx_PARAMS}.
First try is to match all SFP identifiers (@i{vn}, @i{pn} and @i{vs}) with
stored in config. If match is not successful, @i{vn} and @i{pn} of SFP are
compared only with config entries without vendor serial. If match is still not
......@@ -936,7 +943,12 @@ The following tools and scripts are provided:
The script is used to apply @t{dot-config} settings to the
current configuration files. It is run at boot time before
any service is started. The @t{dot-config} mechanism is
documented in the @i{@sc{wrs} Users' Manual}.
documented in @ref{Configuration of the Device}.
@item assembly_ppsi_conf.sh
The script is used to assembly ppsi configuration file based on
information stored in @t{PORTxx_PARAMS}.
This script is called by @i{apply_dot-config}.
@item change_dot-config
This script changes the current @t{dot-config} file. It is
......
......@@ -89,12 +89,14 @@ done
copy_conf /wr/sbin/start-daemons.sh
# Select a ppsi configuration file
for n in /wr/etc/ppsi-conf-pool/*; do
cfg=CONFIG_PTP_$(basename $n)
if [ "$cfg" = "y" ]; then
cp $n /wr/etc/ppsi.conf
fi
done
if [ "$CONFIG_PTP_CUSTOM" = "y" ]; then
if [ "$CONFIG_PTP_PORT_PARAMS" = "y" ]; then
/wr/bin/assembly_ppsi_conf.sh
elif [ "$CONFIG_PTP_CUSTOM" = "y" ]; then
cp "$CONFIG_PTP_CUSTOM_FILENAME" /wr/etc/ppsi.conf
fi
\ No newline at end of file
else
# no valid PTP option keep ppsi.conf with old postfix
echo "No valid PTP option in dot-config!"
if [ -f /wr/etc/ppsi.conf ]; then
mv -f /wr/etc/ppsi.conf /wr/etc/ppsi.conf.old
fi
fi
#!/bin/bash
# Adam Wujek @ CERN
# script to assembly ppsi.conf based on dot-config configuration
PRE_FILE="/wr/etc/ppsi-pre.conf"
OUTPUT_FILE="/wr/etc/ppsi.conf"
if [ -f /wr/etc/dot-config ]; then
. /wr/etc/dot-config
else
# if dot-config not available remove ppsi's config
rm $OUTPUT_FILE
exit 1
fi
echo "# Autogenerated file, please don't edit." > $OUTPUT_FILE
echo "# This file will be overwritten at next boot." >> $OUTPUT_FILE
#copy top of ppsi.conf
cat $PRE_FILE >> $OUTPUT_FILE
for i_zero in {00..17};do
# unset parametes
unset p_name
unset p_proto
unset p_role
# parse parameters
param_line=$(eval "echo \$CONFIG_PORT"$i_zero"_PARAMS")
IFS_OLD=$IFS
IFS=','
# save pairs into array
pair_array=($param_line)
IFS=$IFS_OLD
for pair in ${pair_array[@]}
do
# split pairs
IFS='=' read param value <<< "$pair"
case $param in
"name")
p_name="$value";;
"proto")
p_proto="$value";;
"role")
p_role="$value";;
esac
done
# if role "non-wr" skip port configuration
if [ "$p_role" == "non-wr" ]; then
continue
fi
#remove leading zero from i_zero (params has numbers with leading zero,
#interface names are without leading zero)
i=$(expr $i_zero + 0)
if [ -n "$p_proto" ]; then
echo "port wr$i-$p_proto" >> $OUTPUT_FILE
echo "proto $p_proto" >> $OUTPUT_FILE
else
echo "port wr$i-raw" >> $OUTPUT_FILE
fi
echo "iface wr$i" >> $OUTPUT_FILE
if [ -n "$p_role" ]; then
echo "role $p_role" >> $OUTPUT_FILE
fi
#hardcode whiterabbit as extension
echo "extension whiterabbit" >> $OUTPUT_FILE
# separate ports
echo "" >> $OUTPUT_FILE
done
# Autoselection of port mode, including eth0 (both raw and udp, for variety)
# Global settings
clock-class 187
clock-accuracy 254
port eth-udp
proto udp
iface eth0
role auto
extension none
port eth-raw
proto raw
iface eth0
role auto
extension none
port wr0
proto udp
iface wr0
role auto
extension none
port wr1
proto udp
iface wr1
role auto
extension none
port wr2
proto udp
iface wr2
role auto
extension none
port wr3
proto udp
iface wr3
role auto
extension none
port wr4
proto udp
iface wr4
role auto
extension none
port wr5
proto udp
iface wr5
role auto
extension none
port wr6
proto udp
iface wr6
role auto
extension none
port wr7
proto udp
iface wr7
role auto
extension none
port wr8
proto udp
iface wr8
role auto
extension none
port wr9
proto udp
iface wr9
role auto
extension none
port wr10
proto udp
iface wr10
role auto
extension none
port wr11
proto udp
iface wr11
role auto
extension none
port wr12
proto udp
iface wr12
role auto
extension none
port wr13
proto udp
iface wr13
role auto
extension none
port wr14
proto udp
iface wr14
role auto
extension none
port wr15
proto udp
iface wr15
role auto
extension none
port wr16
proto udp
iface wr16
role auto
extension none
port wr17
proto udp
iface wr17
role auto
extension none
# Autoselection of port modepgrandmasters
# Global settings
clock-class 187
clock-accuracy 254
port wr0
iface wr0
role auto
extension whiterabbit
port wr1
iface wr1
role auto
extension whiterabbit
port wr2
iface wr2
role auto
extension whiterabbit
port wr3
iface wr3
role auto
extension whiterabbit
port wr4
iface wr4
role auto
extension whiterabbit
port wr5
iface wr5
role auto
extension whiterabbit
port wr6
iface wr6
role auto
extension whiterabbit
port wr7
iface wr7
role auto
extension whiterabbit
port wr8
iface wr8
role auto
extension whiterabbit
port wr9
iface wr9
role auto
extension whiterabbit
port wr10
iface wr10
role auto
extension whiterabbit
port wr11
iface wr11
role auto
extension whiterabbit
port wr12
iface wr12
role auto
extension whiterabbit
port wr13
iface wr13
role auto
extension whiterabbit
port wr14
iface wr14
role auto
extension whiterabbit
port wr15
iface wr15
role auto
extension whiterabbit
port wr16
iface wr16
role auto
extension whiterabbit
port wr17
iface wr17
role auto
extension whiterabbit
# Autoselection of port mode
# Global settings
clock-class 187
clock-accuracy 254
port wr0
proto udp
iface wr0
role auto
extension whiterabbit
port wr1
proto udp
iface wr1
role auto
extension whiterabbit
port wr2
proto udp
iface wr2
role auto
extension whiterabbit
port wr3
proto udp
iface wr3
role auto
extension whiterabbit
port wr4
proto udp
iface wr4
role auto
extension whiterabbit
port wr5
proto udp
iface wr5
role auto
extension whiterabbit
port wr6
proto udp
iface wr6
role auto
extension whiterabbit
port wr7
proto udp
iface wr7
role auto
extension whiterabbit
port wr8
proto udp
iface wr8
role auto
extension whiterabbit
port wr9
proto udp
iface wr9
role auto
extension whiterabbit
port wr10
proto udp
iface wr10
role auto
extension whiterabbit
port wr11
proto udp
iface wr11
role auto
extension whiterabbit
port wr12
proto udp
iface wr12
role auto
extension whiterabbit
port wr13
proto udp
iface wr13
role auto
extension whiterabbit
port wr14
proto udp
iface wr14
role auto
extension whiterabbit
port wr15
proto udp
iface wr15
role auto
extension whiterabbit
port wr16
proto udp
iface wr16
role auto
extension whiterabbit
port wr17
proto udp
iface wr17
role auto
extension whiterabbit
# Default for boundary clocks
# Global settings
clock-class 187
clock-accuracy 254
port slave0
iface wr0
role slave
extension whiterabbit
port slave1
iface wr1
role slave
extension whiterabbit
port master2
iface wr2
role master
extension whiterabbit
port master3
iface wr3
role master
extension whiterabbit
port master4
iface wr4
role master
extension whiterabbit
port master5
iface wr5
role master
extension whiterabbit
port master6
iface wr6
role master
extension whiterabbit
port master7
iface wr7
role master
extension whiterabbit
port master8
iface wr8
role master
extension whiterabbit
port master9
iface wr9
role master
extension whiterabbit
port master10
iface wr10
role master
extension whiterabbit
port master11
iface wr11
role master
extension whiterabbit
port master12
iface wr12
role master
extension whiterabbit
port master13
iface wr13
role master
extension whiterabbit
port master14
iface wr14
role master
extension whiterabbit
port master15
iface wr15
role master
extension whiterabbit
port master16
iface wr16
role master
extension whiterabbit
port master17
iface wr17
role master
extension whiterabbit
# Default for grandmasters
# Global settings
clock-class 187
clock-accuracy 254
port master0
iface wr0
role master
extension whiterabbit
port master1
iface wr1
role master
extension whiterabbit
port master2
iface wr2
role master
extension whiterabbit
port master3
iface wr3
role master
extension whiterabbit
port master4
iface wr4
role master
extension whiterabbit
port master5
iface wr5
role master
extension whiterabbit
port master6
iface wr6
role master
extension whiterabbit
port master7
iface wr7
role master
extension whiterabbit
port master8
iface wr8
role master
extension whiterabbit
port master9
iface wr9
role master
extension whiterabbit
port master10
iface wr10
role master
extension whiterabbit
port master11
iface wr11
role master
extension whiterabbit
port master12
iface wr12
role master
extension whiterabbit
port master13
iface wr13
role master
extension whiterabbit
port master14
iface wr14
role master
extension whiterabbit
port master15
iface wr15
role master
extension whiterabbit
port master16
iface wr16
role master
extension whiterabbit
port master17
iface wr17
role master
extension whiterabbit
# Global settings
clock-class 187
clock-accuracy 254
# ppsi suggested configuration file the White Rabbit Switch
# The WRS looks for this in /wr/etc/ppsi.conf or /etc/ppsi.conf
# Global settings
clock-class 187
clock-accuracy 254
port slave
iface wr0
role slave
extension whiterabbit
port master1
iface wr1
role auto
extension whiterabbit
port master2
iface wr2
role auto
extension whiterabbit
port master3
iface wr3
role auto
extension whiterabbit
port master4
iface wr4
role auto
extension whiterabbit
port master5
iface wr5
role auto
extension whiterabbit
port master6
iface wr6
role auto
extension whiterabbit
port master7
iface wr7
role auto
extension whiterabbit
port master8
iface wr8
role auto
extension whiterabbit
port master9
iface wr9
role auto
extension whiterabbit
port master10
iface wr10
role auto
extension whiterabbit
port master11
iface wr11
role auto
extension whiterabbit
port master12
iface wr12
role auto
extension whiterabbit
port master13
iface wr13
role auto
extension whiterabbit
port master14
iface wr14
role auto
extension whiterabbit
port master15
iface wr15
role auto
extension whiterabbit
port master16
iface wr16
role auto
extension whiterabbit
port master17
iface wr17
role auto
extension whiterabbit
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment